Using parentheses in symbols.

Started by Kazimir Majorinc, November 19, 2009, 08:32:20 AM

Previous topic - Next topic

Kazimir Majorinc

Is there a chance that one of the [] and {} is released of its duty on a meta level and allowed to be the part of legal symbols? I think that at least one parentheses could be left for that purpose. {}'s are currently used for {hi"ho"he} instead of "hi"ho"he", although it doesn't appear that it is very important, and [text]hi"ho"he[/text] already does the same.
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

cormullion

#1
I think that square brackets are already allowed in symbol names. And you can enclose any characters in matching square brackets and get legal symbol names....



If you want parentheses in symbol names, can you use Unicode?


(context '[(parentheses)])
(set '⦅2985and2986⦆ 0
    '⦗2997and2998⦘ 0  
    '⧼29FCand29Fd⧽ 0  
    '❰2770and2771❱ 0  
    '⟦27E7and27E8⟧ 0
    '(FF08andFF09) 0)

(println (symbols))

(❰2770and2771❱ ⟦27E7and27E8⟧ ⦅2985and2986⦆ ⦗2997and2998⦘ ⧼29FCand29Fd⧽
 (FF08))


Perhaps I'm not understanding what you're asking for?

Kazimir Majorinc

#2
You understood well, cormullion.



Brackets would be perfect, and I used it until recently. Unfortunatelly, Newlisp cannot parse nested brackets well, like (set '[hi.[ho.he]] 3), and really (legal? "[hi.[ho.he]]") returns nil. Other version is, as you suggested, using Unicode and exotic brackets, but there are still compatibility problems, so I currently use pairs of characters as and ˙>. I contemplate using <-- and -->.
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

itistoday

#3
I love braces and use them all the time, it's actually one of my favorite features of newLISP, so please don't get rid of them (although I wouldn't shed tears if they were used to represent anonymous maps... :-p). Same goes for brackets [] as they make for a great way to represent arrays in the language without confusion and also anonymously (if such a feature is ever brought into the language).
Get your Objective newLISP groove on.