[erlang-questions] Problems with erl_call

Steve Vinoski vinoski@REDACTED
Wed Oct 6 15:52:23 CEST 2010


On Wed, Oct 6, 2010 at 4:16 AM, Simon Hillerbring
<simon.hillerbring@REDACTED> wrote:
> Hi,
> I have problems using erl_call with negative integers in the argument
> list for -a.
> Is there a way around this problem?

Definitely a bug. I assume erl_call is returning an exit status of -1
for you? Looks like the ei_format code isn't handling negative numbers
for this case. It does an isdigit test on the minus sign character and
gets an error.

It seems to work if you use the -e option and feed
erlang:integer_to_list(-1). to stdin, but the result in that case is
{ok, "-1"} rather than just "-1" so you'd have a little parsing to do
to extract the value.

Or you can wait a few minutes for the patch I'll be submitting to
erlang-patches to fix this.

--steve


More information about the erlang-questions mailing list