[erlang-questions] some language changes

Joe Armstrong <>
Mon May 21 12:24:25 CEST 2007


On 5/21/07, Anthony Shipman <> wrote:
> On Monday 21 May 2007 18:10, Joe Armstrong wrote:
> > Now the book is done I've been thinking about some language changes.
>
> >
> > 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.
> >
> >      X = C "......"
> >           C = a control atom
> >
> >        X = regexp " ... "
> >
> >           = html " .... "
> >
>
> Isn't that just a function call C("...") to inject the string into some new
> type? Being able to define a new abstract type would be a big improvement in
> the language.

No - it changes the *syntax* of a string - normally you have to quote
backspashes

Suppose I has a *simple* regexp like this:

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

I'd like to say

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

and not the more obvious

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

\Joe


>
> --
> Anthony Shipman                    Mamas don't let your babies
>                    grow up to be outsourced.
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list