Abstract form

Robert Virding robert.virding@REDACTED
Sat Dec 31 23:02:41 CET 2005


abstract/1 takes an erlang data structure and converts it into its 
abstract form. I quote from the manual:
|*
"*|*|abstract(Data) -> AbsTerm|*

Types:

*|Data = AbsTerm = term()|*

Converts the Erlang data structure |Data| into an abstract form of type 
|AbsTerm|. This is the inverse of |normalise/1|."

The other one is for parsing the characters in a string. RTFM. I don't 
really see the problem.

Robert

Vlad Dumitrescu XX (LN/EAB) wrote:

> Hi!
>  
> I don't usually complain about things ;-) but I find this rather annoying.
>  
> erl_parse:abstract([3,a,5]). --->
>     {cons,0,{integer,0,3},{cons,0,{atom,0,a},{string,0,[5]}}}
> erl_parse...("[3,a,5]"). --->
>     
> {cons,1,{integer,1,3},{cons,1,{atom,1,a},{cons,1,{integer,1,5},{nil,1}}}}
> I would expect the result to be the same, but abstract/1 treats lists 
> of integers as strings, while erl_parse doesn't (the latter being IMHO 
> correct).
>  
> Is there a reason for this discrepancy?
>  
> Happy new year everybody!!
>  
> regards,
> Vlad




More information about the erlang-questions mailing list