ChitChat, a C-like dialect (was Re: jpython anyone?)
Andrew P. Black
black at cse.ogi.edu
Wed Nov 29 00:31:54 UTC 2000
>Okay, I did it. Check out the attachment. Bit of advice: it
>wasn't designed to be "elegant" as in "ooooh!" :-) It was
>designed to "feel right" for someone coming from C or (to a
>lesser extent) Python.
This is interesting. I never cease to be amazed how hard it is for
some people to grok Smalltalk syntax, once they have been exposed to
C. I find this with professional engineers, and with high school
students.
I have one suggestion for the declaration syntax. The colon is not
particularly C-like. C programmers would write "int x". Of course,
you ChitChat doesn't have types, but you might adopt the idea of
using a keyword. So, instead of
to:do (1, 8, {:(x) y:
y = nextInt (myrandom, x);
plotBetween:and (self, x, y);
});
you might try
to:do (1, 8, {param x; var y;
y = nextInt (myrandom, x);
plotBetween:and (self, x, y);
});
This means that binary messages param: or var: can't be sent, but if
one needs to do that, one can always use perform:with: as a
workaround.
Incidentally, C uses double quotes for strings, and single quotes for
characters, so it probably makes sense to adopt that convention.
Andrew
More information about the Squeak-dev
mailing list
|