string to tupple ?

Tim Fletcher <>
Mon Jun 21 11:10:00 CEST 2010


> The obvious question is "WHY"?

Presumably you meant "why isn't that data structured relationally"
instead of "why extract data from a database" :) One possible answer
is that it's someone else's database.

> For example, if you know the numbers are whole numbers,
> the very simplest code would be
>         [X || {integer,_,X} <- erl_scan:string(String)]
> which would give you a list of integers.

That'll throw a "bad generator" error. Did you mean this:

  {ok,Tokens,_} = erl_scan:string("(1,2),(3,4)"),
  [X || {integer,_,X} <- Tokens].

?


More information about the erlang-questions mailing list