This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: The GIMP! By gum, I forgot all about it!


On Thu, Oct 29, 1998 at 11:32:18PM -0500, Russell McManus wrote:
>Scott Goehring <scott@poverty.bloomington.in.us> writes:
>
>> SIOD, or at least the SIOD in script-fu, lets you set! a previously
>> unbound variable.  So (set! foo 5) is perfectly legal in script-fu,
>> but raises an exception in guile.  Unfortunately, a number of
>> script-fu script authors have made use of this anomalous behavior.
>
>Maybe this quick hack can be the beginning of a solution (guile
>specific code):
>
>(define %set! set!)
>(defmacro set! (name value)
>  `(begin
>     (if (not (defined? (quote ,name)))
>	 (define ,name #f))
>     (%set! ,name ,value)))

Uhm, why do you emulate define? :) (this does not solve the problem that
SIOD's set! returns the new value though)

(define set! define)

	-forcer

-- 
;; "Hello World!" 17 errors, 31 warnings.
;; email: forcer@mindless.com      -><- www: http://webserver.de/forcer/
;; IRC: forcer@#StarWars (IRCnet)  -><- PGP/GPG: available on my website