Intermediate Python user needed help

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sun Aug 5 20:42:40 EDT 2012


On Sun, 05 Aug 2012 18:19:55 -0500, Tim Chase wrote:

> On 08/05/12 17:00, John Mordecai Dildy wrote:
>> since when did we start talking about lisp?
> 
> Though not a lisper, the Python tie-in was my reply:  Python (among many
> other languages) doesn't allow a "-" as a character in identifiers as
> you appeared to use it in your code.  Unlike HTML, XML, CSS, and
> apparently lisp and COBOL (thanks, MRAB, for ripping open that scab
> after years of trying to repress those COBOL memories :-)   where
> identifiers may contain the dash.

And Forth.

Generally speaking, concatenative languages like Forth can use any 
symbols they wish in identifiers, apart from the token separator (usually 
whitespace), since they don't have syntax as we know it in more 
traditional languages.

E.g. in Forth : is the word (command) to start defining a new word, but 
this does not stop you from defining a word called ::: or "foo:bar" (with 
or without the quotes!).



-- 
Steven



More information about the Python-list mailing list