Symbols and scripting

Richard Drake rdrake98 at
Sat Jan 6 09:25:19 PST 2007

P T Withington wrote:

> One of our developers wondered why no scripting language has adopted
> symbols

It depends on one's definitions of course. Peter explores possible
meanings for 'symbol' and summarizes:

> So, I think what you are mostly
> missing is the shorthand where in lisp you can write
>   'foo
> and if the symbol already exists, you get the symbol, and if it
> doesn't it will be created for you.

Note that, unlike Python, Ruby, arguably following Smalltalk as much
as Lisp, has symbols like that. Well, to be precise, like this

:'foo bar'
:"tricky #{expression}"

(p323 of 'Pickaxe', highly regarded Pragmatic Programmers book
on Ruby, gives the literal options, p631 covers the Symbol class)

And Ruby is normally considered a scripting language, no? Whether
that's a compliment or a slur I'll leave others to decide.

Anyway, I add my vote to such a shorthand (as well as concept) in
JS2 (is that the same as ES4, he asks to make clear his ignorance,
or at least the unfamiliarity of the territory), as well as what Brendan
calls an unpolluted Dictionary class.

I speak as an old Smalltalk programmer who is impressed by the
plan to specify in SML without quite knowing the implications. And
as someone who, like others, would like to see more use of JS/AS
on server as well as client.

I feel in the shallows of language design, particularly the interface
between 'dynamic' and 'strong' typing. But I've been lurking here for
a little while and on this I feel I knows what I like !

Thanks for the openness.


Ruby for laser purity
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Es4-discuss mailing list