[erlang-questions] Re: Special syntax for dictionaries

Toby Thain toby@REDACTED
Thu May 6 02:11:46 CEST 2010


On 5-May-10, at 11:08 PM, Hynek Vychodil wrote:

> On Wed, May 5, 2010 at 2:17 PM, Tim Fletcher <mail@REDACTED>  
> wrote:
>>> While your examples might work if the value is a simple constant or
>>> variable allowing any legal general expression will cause problems.
>>> How would you interpret <{erlang:list_to_integer("123")}> ? Note  
>>> that
>>> white space is usually ignored so making white space significant  
>>> here
>>> would be creating a special case for just this.
>>
>> You're right, that's definitely not workable.
>>
>>> This was the main reason that = is used in the record syntax.  
>>> While ~
>>> may look strange using : will cause problems. How about =? Though  
>>> this
>>> may force you to parenthesize some expressions.
>>
>> I think = is fine aesthetically, but Richard notes in his frames
>> proposal that it could also be confused with existing syntax that  
>> uses
>> =. Adopting the Ruby style "arrows" would be another option:
>>
>>  <{author=>"Mike", erlang=>list_to_integer("123")}>
>>
>> Looks clear enough, but might be a bit too verbose for typing out?
>
> Just to be correct it is not Ruby style but Perl style and it was
> found brief enough even in Perl sense.

Also PHP.

--Toby


>
>>
>> Tim
>>
>>
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>>
>>
>
>
>
> -- 
> --Hynek (Pichi) Vychodil
>
> Analyze your data in minutes. Share your insights instantly. Thrill
> your boss.  Be a data hero!
> Try GoodData now for free: www.gooddata.com
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>



More information about the erlang-questions mailing list