Try/Cond
Luke Gorrie
luke@REDACTED
Tue Oct 21 21:44:35 CEST 2003
"Richard Carlsson" <richardc@REDACTED> writes:
> Representing a cond in Core Erlang is no problem, but there are several
> things done with the code before the Core stage, and it would have been
> nice if "cond" could be expanded into "case" expressions very early
> (so that e.g. the debugger does not have to know anything about it). But
> it was not as simple as that.
Feel free to dump the details. Maybe someone will think of the
solution in the shower :-)
My first thought was that the trouble would be getting stuck with
unwanted variable bindings from clauses that failed, for want of
`let'. But variable renaming / alpha-conversion should take care of
that. So now I'm most curious as to what the trouble is :-)
But maybe that just punts the problem until you need to export the
binding for a variable "out" of the cond for some later code. But then
you could make the assignment to that variable as soon as the cond
clause is selected. But maybe.......
-Luke (curious!)
More information about the erlang-questions
mailing list