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?


On Thu, Jul 27, 2000 at 10:28:40AM -0700, Carl R. Witty wrote:
> How about a generic "drop-to-scheme" operator, say '%'?

Yes, I think that probably is necessary, particularly for macros.  Why
% though?  It's already used for modulo, and though it wouldn't be
formally ambiguous, it might lead to some confusion.  I wonder if #
should be used (and not used for lists) because it kind of implies an
instructure for the compiler (or translator in this case).

Hmmm... (use-modules (ice-9 slib)) could be #include <ice-9/slib>...?
A scheme expression could be #scheme (+ 1 2)...

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

I think symbols are very important for any program in a Scheme 
environment, and the language should have a nice native representation
of them.

> > 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)

That's an interesting idea.  Unfortunately it means doing messing with
the Scheme reader... (there's a way to add new # forms to Scheme, 
though, isn't there?)

> 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.

I don't want the user to have to learn too much Scheme to use the C-like
syntax, though.  Much of the point of a C-like syntax is that it should
be easy for people to learn.  It would be nice for people to cut and
paste small expressions from documentation, though, which the escape
would provide.

  -- Ian


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