Re: Question about bindings & STklos objects
> To what extent can an address be used in place of a variable?
>
> For example, the following didn't work:
>
> STk> (define a '(p d q))
> #[undefined]
> STk> (car a)
> p
> STk> (car (address-of a))
>
> *** Error:
> car: wrong type of argument: "#pf0f64"
> STk>
addrees-of is a kludge and I hop to be able to avoid its usage in a near
future
(of course it address-of will be supported for compatibility).
To respond to the original question, address and varibale are not
interchangable. In fact address-of returns an object of type "address"
(i.e. address? on it will yield #t). You must use read to find the value
associated to the given address. Following code illustrate this
STk> (define a '(p d q))
#[undefined]
STk> (read-from-string (format #f "~A" (address-of a)))
(p d q)
STk>
With Tk you don't see this problem since since a Tk result is always a string
which is passed to the reader for building the Scheme result.
-- Erick
Received on Mon Nov 28 1994 - 14:18:17 CET
This archive was generated by hypermail 2.3.0
: Mon Jul 21 2014 - 19:38:59 CEST