Is there any language that allows spaces in its variable names [closed]

一个人想着一个人 提交于 2019-11-28 00:23:01

问题


Is there (or was there ever) any non-trivial language that allows spaces in its variable names?

I am aware of the language Whitespace, but I'm interested in a language that was actually used for something besides demonstration.

I ask this out of pure curiosity.


回答1:


In a way, yes. Several languages's variable names are really just keys to a higher-level object. Both Coldfusion and Javascript come to mind. In Javascript, you can write foo=bar, but what you've really said is:

window['foo'] = bar;

You could just as easily write

window['i haz a name'] = bar;

The various scopes in Coldfusion can also be treated as either a (dict|hash|associative array) or a name.

Of course, once you've created a name with whitespace, it's harder to access without using the hash lookup syntax.




回答2:


TSQL will allow you to use whitespace in table and column names aslong as you have it between square braces [ ]

Theres a fantastic article on just what sql will let you get away with here http://www.sqlservercentral.com/blogs/philfactor/archive/2009/08/14/evil-code.aspx



来源:https://stackoverflow.com/questions/5141160/is-there-any-language-that-allows-spaces-in-its-variable-names

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!