"Maciek Godek" <[EMAIL PROTECTED]> writes:
> By the way, the let-alias syntax you
> gave me in your former letter doesn't work with guile either.
I am curious about this; was this with use-syntax on syncase, or
use-modules/#:use-module?
Or maybe it has just been a while. :)
--
I write stuff at
"Maciek Godek" <[EMAIL PROTECTED]> writes:
>> What is so wrong with forms like `(set! (vector-ref foo index) ...)'?
>
> In scheme the only problem is that they don't work, unless we
> redefine vector-ref:
> (define vector-get vector-ref)
> (define vector-ref (make-procedure-with-setter vector-get v
Clinton Ebadi:
>> I've been thinking of implementing this "location" stuff
>> as a smob, but you've got the point that it is (probably)
>> impossible to implement the location system without
>> redefining set! and define.
>
> You may want to read a few documents on functional programming to see
>
"Maciek Godek" <[EMAIL PROTECTED]> writes:
> I've been thinking of implementing this "location" stuff
> as a smob, but you've got the point that it is (probably)
> impossible to implement the location system without
> redefining set! and define.
You may want to read a few documents on functional
Kjetil:
> Well, here's a relatively clean way, I think:
>
> (define-macro (location name)
> (define new-val (gensym))
> `(lambda (,new-val)
> (set! ,name ,new-val)))
>
> (define old-set! set!)
>
> (define-macro (set! a b)
> `(if (procedure? ,a) ;; Needs a better check.
> (,a ,b)
Stephen Compall:
> Actually, if you (use-syntax (ice-9 syncase)), you should be able to
> define lexical symbol-macros that expand a single symbol, even in a
> set! place, something like:
>
> (define v #(1 2 3))
> (define-syntax v1
> (lambda (stx)
>(syntax-case stx ()
> (_ v
I don't
Kjetil:
>> Hi,
>> it's me again, asking silly questions.
>
> Not at all, your questions are very good. :-)
That's werid. Every time I write a post I've got the
strange feeling that I'm thinking in the way that
should be forbidden :)
I can give you the background of this idea.
I've been trying to
"Maciek Godek" <[EMAIL PROTECTED]> writes:
> I've tried to do it using a "procedure with
> setter", but the problem is that set! doesn't
> evaluate its first argument (as long as it's a
> symbol), so I'd have to wrap everything
> up in macros to obtain:
> (set! (vector-location v 1) 10)
Actually,
"Maciek Godek":
Subject: References/locations
To: guile-user@gnu.org
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1
Hi,
it's me again, asking silly questions.
Not at all, your questions are very good. :-)
This time I would like
Hi,
it's me again, asking silly questions.
This time I would like to know if there's
a simple way to store a reference to
a variable in another variable -- say,
an element of vector or hash table.
I imagine this could look like this:
(define v #(1 2 3))
(define v1 (vector-location v 1))
v1
: 2
(se
10 matches
Mail list logo