[erlang-questions] Erlang Syntax - again

Hynek Vychodil vychodil.hynek@REDACTED
Tue Mar 11 11:20:24 CET 2008


On Tue, Mar 11, 2008 at 10:02 AM, Ladislav Lenart <lenartlad@REDACTED>
wrote:

> Yariv Sadan wrote:
> > Hi Robert,
> >
> > I think the "issues" with Erlang's syntax are quite overblown. They
> > took me about a day to master and I hardly notice any of them when I'm
> > actually writing and editing code. I certainly don't want Erlang to
> > look any more like Java/C than it does now. I'm pretty happy with the
> > Erlang syntax (I also think that LFE provides a very interesting
> > option for those who are curious about Lisp :) )
> >
> > The main change I would like to see is to have the compiler
> > automatically infer the types of record variables (when possible) to
> > shorten the amount of code required for accessing their properties. I
> > created an unfinished solution here:
> > http://code.google.com/p/recless/. This page has a couple of examples
> > for how it could be used.
> >
> > I would also like to be able to overload macro names with different
> > arities and to have some mechanism for introspecting the properties of
> > records and accessing them dynamically at runtime.
>
> This is almost what I was about to write (except that I don't have partial
> solution to the problem :-)
>
> For me, the syntax is still a bit too noisy. Whenever I write a module and
> compile it I have two or three comile-error cycles on errors that wouldn't
> be there if the syntax was a little bit different. But as many pointed out
> this is not a big deal really.
>
> But what I would like to have in Erlang is definitely better introspection
> /
> reflection capabilities. I would like to have records as runtime
> structures,
> so I could write:
>
>   Var#{x = foo, y = bar}
>
> where Var could be any record that has slots x and y (it might have
> others),
> record_info would be a normal function that can operate on variables.
>

It is misunderstand what record is. Record is not this sort of things. Use
our own structure for this purpose. Record is not object, hash, dictionary
or whatever you really want. Record is not designed for some sort of
inheritance. Record is structure for memory friendly storage of fixed
"records" a which one will be changed very rare and just only by design.

>
> I would also very much like to be able to programmatically
> create/inspect/modify
> receive (and other) clauses at runtime. But this is just wishful thinking
> I think.
>
> Ladislav Lenart
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



-- 
--Hynek (Pichi) Vychodil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080311/8692aea0/attachment.htm>


More information about the erlang-questions mailing list