chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] define not using define


From: Elf
Subject: Re: [Chicken-users] define not using define
Date: Fri, 25 Jan 2008 07:32:56 -0800 (PST)


on that note, something that does work in the general case:

(define-macro (define-if-undefined name . val)
    `(condition-case ,name
        (()    (define ,name ,@val))))


On Fri, 25 Jan 2008, minh thu wrote:

Hi,

Is it possible to register symbols in Chicken, just as a global
(define ...) would do from arbitrary code?

I'd like to be able to write (setting 'color '#f32(1 0 0 0)) and have
the same effect
than a (define color (make-parameter '#f32(1 0 0 0)) unless the color procedure
already exists.

Is it possible to define 'setting' as a procedure and not as a macro
(or am I limited to use 'setting' at the top level (I don't mean the
repl))?

The fact color is procedure is nice for me, I'd rather call (color)
than (look-up 'color).

Thanks,
thu


_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]