This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
C-like identity?
- To: guile at sourceware dot cygnus dot com
- Subject: C-like identity?
- From: Ian Bicking <bickiia at cs dot earlham dot edu>
- Date: Thu, 27 Jul 2000 01:07:33 -0500 (EST)
Hi there. This is a temporary email address to avoid the (!@#@)
spam-blocking on sourceware. Anyone know an open relay I can use to get
my email off my system without using my (blocked) ISP? Haha. (but
seriously...)
Anyway, my project is having an identity crisis and I thought I'd ask
a bit of advice. First, all I can think of calling it is C-like-syntax,
which is true but not a good name. It's not quite JavaScript-like
enough to call it JavaScript->Scheme. I don't know what it is. I
could call it Fred, but then no one would know anything about it by
looking at its title.
Also, there's a bunch of non-C syntax things that I don't currently
have a thoughtful opinion on, and I'd like some help on that. I'd like
the syntax to allow just about everything Scheme normally allows. But
there's no model for a lot of them in C.
Closures:
lambda (x, y) {...body...}
[seems fine]
Symbols:
#asymbol
[#? 'asymbol ? This is completely arbitrary, but I don't really want
to use ' because it is a false-cognate for characters]
Constant lists:
#(a b c)
[Should there be commas inbetween items?]
Constant vectors:
#{1 2 3}
[Should it be skipped entirely in favor of list(1, 2, 3) and
vector(1, 2, 3)?]
Improper lists:
#(a . b)
Quasiquote (`): ??
[not absolutely necessary, but some applications want
specifically-formated lists that are hard to construct without it]
Functions that take variable number of arguments:
function foo(arg1, arg_rest*) ...
Keyword arguments (and function definitions): ??
[Variable arguments could possibly be implemented with a similar
syntax to keyword arguments, whatever that syntax might be]
for-each: ??
[You can currently do this, but a nice syntax instead of lambda might
be good, especially for people who don't grasp closures]
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))]
define-module: ??
I'm sure there's others I'm missing...?
I'm currently translating symbols so that:
i_am_a_func(x) --> (i-am-a-func x)
and:
are_you_happy_p() --> (are-you-happy?)
Should quoted symbols (#sym) also be translated like this? I might
almost allow #a-sym to work, since no one uses operations on symbols
anyway...? Except `#a==sym', perhaps.
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.
Anyway, once I write the README and stuff, I'll release it with or
without a name. These are mostly little details that might make the
language more pleasant to use. And keep it from being a second-class
citizen in a Scheme-centric environment.
-- Ian