This is the mail archive of the guile@sources.redhat.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: C-like identity?


Ian Bicking <bickiia@cs.earlham.edu> writes:

How about a generic "drop-to-scheme" operator, say '%'?

> Closures: 
>   lambda (x, y) {...body...}
> [seems fine]

yes

> Symbols: 
>   #asymbol                     
> [#? 'asymbol ? This is completely arbitrary, but I don't really want
> to use ' because it is a false-cognate for characters]

%'asymbol

(The problem with "'" signalling "character" is unfortunate, but
hopefully the "%'" is enough of a marking.)

> Constant lists: 
>   #(a b c)              
> [Should there be commas inbetween items?]

%'(a b c)

etc.

> Quasiquote (`): ??
> [not absolutely necessary, but some applications want
> specifically-formated lists that are hard to construct without it]

Along with "%", there could be a scheme syntax for falling back to
ctax mode (say "#{" "}"; then you could use something like

%`(The ,#{100+1} Dalmations)

which should evaluate to the list (The 101 Dalmations)

> use-modules:
> [This would currently translate to use_modules(ice_9(slib)); which is
> lame.  This might be an argument for why normal syntax is nice, as in 
> (use-modules '(ice-9 slib))]

%(use-modules '(ice-9 slib))

> Anyway, I'm kind of hoping people will know of C-like languages that
> have some of these features, and share their syntax.  The whole point
> of a C-like syntax is not to surprise people too much, so I don't want 
> to Innovate too much.

Sorry, I don't...

I do think that something like the "%" and "#{" escapes should be
provided.  The user of the translator may wish to use a module which
provides some macro whose default back-translation into C-like syntax
is hideous (like the example of use-modules above); the "%" escape
allows them to do so, and the "#{" escape allows them to still use as
much C-like syntax as possible.

And, as demonstrated above, the "%" syntax has the advantage that you
can put off (temporarily or forever) the decision on what C-like
syntax to use for many Guile features.

Carl Witty

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