sys_pre_expand compiler warning (Re: Algorithmic lists)

Ulf Wiger etxuwig@REDACTED
Tue Oct 17 09:10:58 CEST 2000


On Mon, 16 Oct 2000, Ulf Wiger wrote:

>
>Here's my first (and perhaps last) hack of sys_pre_expand.erl.
>It handles at least my very simple test function with a list
>comprehension that is fed a lazy list:

BTW, when I compiled sys_pre_expand.erl, I got the following compiler
warning:

> erlc -W sys_pre_expand.erl
/home/etxuwig/work/erlang/lazy/sys_pre_expand.erl:703: Warning:
variable 'Es' shadowed in 'fun'

The function in question looks like this:

bin_expand_strings(Es0) ->
    foldr(fun ({bin_element,Line,{string,_,S},default,default}, Es) ->
		  foldr(fun (C, Es) ->

[{bin_element,Line,{integer,Line,C},default,default}|Es]
			end, Es, S);
	      (E, Es) -> [E|Es]
	  end, [], Es0).


Now, it doesn't really seem like a bug, but wouldn't it be awfully
easy to avoid the warning and resulting confusion? ;)

/Uffe
-- 
Ulf Wiger                                    tfn: +46  8 719 81 95
Strategic Product & System Management        mob: +46 70 519 81 95
Ericsson Telecom AB,              Datacom Networks and IP Services
Varuvägen 9, Älvsjö,                    S-126 25 Stockholm, Sweden




More information about the erlang-questions mailing list