[erlang-questions] some language changes

Tony Finch <>
Mon May 21 19:15:31 CEST 2007


On Mon, 21 May 2007, Joe Armstrong wrote:
>
> 3. Extended string syntax: idea - put an atom *before the string quote
>     to say what the string means and to *change* the syntax rules that apply
>     to the string content.

This is somewhat reminiscent of Lua's treatment of data. Its usual form
for function calls is f(a,b,c) but you can also write constructor-style
function calls as f "string" or f {table,literal}. Lua also has a "long
string" syntax (using [[ ]] delimiters) which does not support any escape
sequences. Combining these features, you can write your example as:

	X = regexp[[[.?!][]\"')}]*\\($\\| $\\|\t\\|  \\)[ \t\n]*]]

Tony.
-- 
f.a.n.finch  <>  http://dotat.at/
SOLE: VARIABLE BECOMING MAINLY WESTERLY 3 OR 4. SLIGHT OR MODERATE. FAIR.
GOOD.



More information about the erlang-questions mailing list