For various reasons that I don't know about or don't completely understand,
several of the proposals that have already been made may be far superior to
what I am about to suggest.  In fact, there could easily be some reason why
my suggestion is completely unworkable.  Never the less, I have worked with
other languages where using named items based on the following simple syntax
seems to work well, and I'm wondering if it might be a better alternative
than some of the other suggestions:

(script-fu-foo-bar image="myimage" size=300)

Some languages allow unquoted parameter strings when the type can be
identified based on the parameter name or value and there are no embedded
blanks or other delimiters withing the parameter value.  Some languages use
single quotes instead of double quotes, and some languages allow both.  Most
languages with syntax along these lines also allow quotes characters to be
doubled up in order to represent the occurance of a quote character within
the parameter value.

Most of you guys are probably already very well aware of syntax like this,
so it may not be possible or advisable here for some reason.  But I just
thought that I'd throw this idea out in case it was being overlooked and
might solve any of the other problems that have been discussed.


----- Original Message ----- 
From: "Kelly Martin" <[EMAIL PROTECTED]>
To: "Simon Budig" <[EMAIL PROTECTED]>
Sent: Friday, March 19, 2004 7:35 PM
Subject: Re: PDB named and default parameters (was Re: [Gimp-developer] The
Mark Shuttleworth offer)

> Simon Budig wrote:
> > Ok, thinking some more about it: What about using symbols as parameter
> > identifiers?
> >
> >   (script-fu-foo-bar 'image    image
> >                      'drawable drawable
> >                      'radius   5.5
> >                      'size     300)
> >
> > passing symbols to the PDB doesn't make sense, so this could be used
> > to differentiate.
> The more Scheme-like approach would be to add a read syntax which
instantiates a
> "parameter name" type.  So, something like "(script-fu-f00-bar ::image
> (:: being an arbitrary syntactic marker that I just made for which an
> appropriate syntax macro has been defined; you can theoretically use
> not already assigned to something else), which is internally expanded to
> "(script-fu-f00-bar #<parameter image> image)" which is then magically
> to however the PDB handles parameter passing by the appropriate Scheme-C
glue code.
> Not only is this more in keeping with how Scheme is generally used, it's
> conceptually much cleaner because it avoids overloading quoted interned
> Kelly
> _______________________________________________
> Gimp-developer mailing list

Gimp-developer mailing list

Reply via email to