object->let is intended as a low-level portion of a
yet-to-be-written debugger. Perhaps one simple
solution is to use (cons vector data) and pass
that around instead of the bare vector. Most
scheme objects in s7 do not have an associated
let built-in.
Hi Gregg,
Since you are using c objects already, I suppose you are also using the
getters, ie (my-vector-element) which would return a scheme string.
You could use a dilamda for the vector, and have a getter like (my-vector)
to get all the elements, (my-vector 0) to get an element and (my vector
Cool. Thanks all.
On Mon, Jul 26, 2021 at 2:18 PM wrote:
> Here's one way to do that in scheme:
>
> (require mockery.scm)
>
> (define (meta-vector v data)
>(openlet
> (sublet (*mock-vector* 'mock-vector-class)
> 'value v
> 'mock-type 'mock-vector?
> 'meta-data data)))
Bill, I'm not saying it would be good to adopt as I'm no language expert,
but Clojure has an interesting metadata system that might be worth looking
at. I mention it only because I remember you asking last year what things
from Clojure were particularly nice.
iain
On Mon, Jul 26, 2021 at 3:16 AM
Here's one way to do that in scheme:
(require mockery.scm)
(define (meta-vector v data)
(openlet
(sublet (*mock-vector* 'mock-vector-class)
'value v
'mock-type 'mock-vector?
'meta-data data)))
(define v (meta-vector #(0 1 2) "hiho"))
(display (v 1))
1
(display (v