[erlang-questions] Frames proposal

Richard O'Keefe ok@REDACTED
Tue May 1 07:27:20 CEST 2012


On 1/05/2012, at 3:38 PM, Max Lapshin wrote:

> I mean using JSON directly inside Erlang:
> 
> 
> function({type : <<"article">>, title : Title, id : Id} = Object) ->
>   Object{id : make_permalink(Id, Title)}.
> 
> or
> 
>  Article = {id : 523, title : proplists:get_value(<<"title">>, Params)}
> 
> I mean this. Your syntax may have some historical roots, but they are
> too ancient. Nowadays such syntax <{key ~ value>} look like inventing
> bicycle with square wheels.

JSON syntax is ***Javascript*** syntax.

The frames proposal has always made it very clear why we cannot
copy JSON syntax.

{}	is already an empty TUPLE,
	it cannot also be an empty 'dictionary'.
	We cannot reasonably use unadorned curly
	braces for frames.
	
{a:f()}	already means a tuple whose one element
	is the value of a call to the f() function
	in module a.  We *CANNOT* even unreasonably
	use a colon in maplets; it is just not going
	to work.

Have a lollipop.




More information about the erlang-questions mailing list