[erlang-bugs] Local function names in Core Erlang guards

Robert Virding <>
Mon Nov 19 12:24:45 CET 2012


It's a core_lint bug! Erlang (and core and the BEAM) does not permit calling user defined functions in a guard.

The core scanning/parsing/linting was added to allow people to write code directly in Core erlang. As far as I know no one does.

Robert

----- Original Message -----
> From: "Anthony Ramine" <>
> To: 
> Cc: "Bjorn Gustavsson" <>
> Sent: Monday, 19 November, 2012 11:02:42 AM
> Subject: [erlang-bugs] Local function names in Core Erlang guards
> 
> Hi,
> 
> While patching the compiler to allow substitutions of variables which
> values are
> local function names [1], I discovered that core_lint doesn't forbid
> them in guards,
> even though that makes the compiler passes further down the road
> generate badly-formed
> BEAM code.
> 
> Is that a bug in core_lint or a bug in the BEAM code generation?
> Should local function
> names be allowed in guards?
> 
> If it is a bug in core_lint, I can make a patch for that; if it is a
> bug in the BEAM
> code generation I would love to fix it and remove the code I wrote to
> avoid the
> substitution in guards... but I lack knowledge about the BEAM
> innards.
> 
> Regards,
> 
> [1]
> http://erlang.org/pipermail/erlang-patches/2012-November/003137.html
> 
> --
> Anthony Ramine
> 
> _______________________________________________
> erlang-bugs mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-bugs
> 


More information about the erlang-bugs mailing list