[erlang-questions] Strings as Lists

Brian Cully bcully@REDACTED
Mon Feb 18 16:35:53 CET 2008


On 18-Feb-2008, at 09:49, Joe Armstrong wrote:

> ~n"...."   turn off quoting
> ~r"...."    string is a regexp
> ~x"..."    string is xml
> ~x/FlunkyStuff ... FunkyStuff  (string is xml terminated by  
> FunkyStuff)
> ~myExpander/FunkyStuff .... FunckyStuff

	I agree with the difficulty of embedding languages into strings, and  
avoid it myself whenever possible. Mostly because I'm puritanical, but  
whatever.

	My issue regards overloading the double-quote character. I'd rather  
something completely generic to avoid situations like this:

	~r"/"/"
	~xml"<root attr="oops"/>"
	and so on.

	perl's qr/w/x operators might be worth looking at. They don't  
completely fix the issue, but they work around it by allowing the  
programmer to specify delimiters.

	Personally, I'd rather just natural syntax. Both regexp and xml  
naturally terminate or have errors, so switching the parser into an  
xml/regexp mode seems reasonable to me.

-bjc



More information about the erlang-questions mailing list