Easier syntax for quoting text and html?

Alex Tweedly alex at tweedly.net
Fri Jan 1 19:18:58 EST 2010


David Bovill wrote:
> 2009/12/31 Jim Ault <jimaultwins at yahoo.com>
>   --// html honors both quote types, ignores extra spaces
>   
Thanks Jim !! How did I get to this age in my life without realizing that !?
> NB - I do think that RunRev should add syntax to the language to make html
> quoting very easy to use for both iRev scripts We need an elegant solution
> to quoting html - other languages are easier to use and read with regard to
> html quoting! using our own custom functions does not make read/writeability
> that much easier, and makes it harder to share scripts.
>   
My first choice would be to allow either single or double quotes to 
delimit strings - then I could put the other kind within it without any 
problems (yep, idea borrowed from Python, amongst others).

So we could go one step further and also borrow from Python a neat 
method of allowing multi-line strings. Instead of using *one* quote at 
start+end of the string, you use *three* of them (which is unambiguous 
with any existing valid code, afaict).  So in revTalk terms, I could do

put 'I said "This way!"' into tVar

put "it's mine" into tVar

put """
this is a long
multi line string.
I'd say "It's easy to embed quotes within it !!"
""" into tVar

Note the starting triple-quote has to be last item on line, and the 
closing triple-quote has to be first item on its line - and the 
first/last CR within the text are not part of the resulting string.
> My suggestion is to extend the syntax for local variables and constants.
> Currently we have:
>
>   
Hmmm :-(    I'd much rather find a syntax that works equally for local, 
constants and plain old expressions - see above.

-- Alex.



More information about the use-livecode mailing list