[UCBLogo] Is this a bug? 
Author Message
 [UCBLogo] Is this a bug?

to a
foreach [(2)] [op ?]
end

show a

(nothing)

Daniel

To unsubscribe from this group, send an email to:

LogoForum messages are archived at:
http://www.*-*-*.com/

Your use of Yahoo! Groups is subject to http://www.*-*-*.com/



Mon, 03 May 2004 21:45:10 GMT  
 [UCBLogo] Is this a bug?

Quote:

> to a
> foreach [(2)] [op ?]
> end

> show a

> (nothing)

> Daniel

> To unsubscribe from this group, send an email to:

> LogoForum messages are archived at:
> http://groups.yahoo.com/group/LogoForum

> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

It is interesting that you get the same behavior with
    to b
       op "(2)
    end
However with
    to b
       op 2
    end
the instruction
    show b
outputs 2.  I think this happens because words are delimited by spaces,
square brackets, and parentheses.  Hence "(2) is an empty word followed by
(2).  op never sees beyond the empty word.  In the case of the procedure a,
the (2) inside the square brackets is read as "(2), that is, as an empty
word.

_________________________________________________________


Dept. of Mathematics and Statistics
Youngstown State University
One University Plaza
Youngstown, OH  44555-0001
330-742-1817



Mon, 03 May 2004 23:05:38 GMT  
 [UCBLogo] Is this a bug?

Quote:

>to a
>foreach [(2)] [op ?]
>end

Yup, it's a bug.  To fix it, in logolib/foreach, replace FOREACH.DONE
with the following:

to foreach.done :foreach.result
if emptyp :foreach.result [op [stop]]
op (list "output "first (list first :foreach.result))
end

There's a similar bug (with a similar solution) in FOR.



Wed, 05 May 2004 03:31:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. UCBLogo 5.2 bugs fixed

2. Bug: UCBLOGO and Windows 2000

3. Bug: UCBLOGO and Windows 2000

4. [UCBLogo] Is this a bug?

5. System Bug, Or Am I Really Dense?

6. A major bug or am i Crazy (or BOTH)

7. I am clinically stupid. (fastcgi.rb bug)

8. re bug, or am I missing something?

9. BUGS, BUGS, BUGS, BUGS, C4 BUGS

10. I am not deaf, but am I mute?

11. PopupMenu bug, menu bug, apple bug (worm)?

12. History mechanism in ucblogo?

 

 
Powered by phpBB® Forum Software