This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: C-like identity?
- To: Ian Bicking <bickiia at cs dot earlham dot edu>
- Subject: Re: C-like identity?
- From: cwitty at newtonlabs dot com (Carl R. Witty)
- Date: 27 Jul 2000 10:28:40 -0700
- Cc: guile at sourceware dot cygnus dot com
- References: <Pine.BSF.4.21.0007270106420.31370-100000@cs.earlham.edu>
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