1. Euphoria v2.2Bug

Rob,

I noticed this in someone's code, didn't believe it until I tested it out
myself.

procedure foo(integer foo)
end procedure

and

procedure bar()
    integer bar
end procedure


do not generate "attempt to redefine"  errors.  Why is this happening?
Clearly the routine's own name must be in scope within the routine (since
recursive calls work), so how can this be allowable?  By the way, recursive
calls won't work if coded in the examples above, the interpreter assumes the
reference to "foo" or "bar" is the variable.

-- Mike Nelson

new topic     » topic index » view message » categorize

2. Re: Euphoria v2.2Bug

Mike Nelson writes:

> procedure foo(integer foo)
> end procedure

> procedure bar()
>    integer bar
> end procedure

> do not generate "attempt to redefine"  errors.

It's not a bug. That's what I intended.
They are "private" variables. You can choose any name
you like without fear of conflicting with another
user-defined symbol.

By the way, both situations are legal in C too.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu