LOGO-L> Re: Query 
Author Message
 LOGO-L> Re: Query

Hope you don't mind my posting my response.

I've got stumped on that one myself several times (including this
time for a little while :-)).

to trial :n [:k 0]
if :n>4[pr :k stop]
show :n
(trial :n+1 :k+1)

trial has two forms the "default" form and the alternative form.
To use the alternative form you must tell logo using parens how
many arguments you wish to pass otherwise it assumes the "default"
form which is just one argument.

When you called trial without the parens it assumed you wanted
one argument passed and did not know what to do with the second
argument (i.e. I don't know what to do with 1).

trial behaves just like any native command that has alternative forms:

print "a
(print "a "b)


> to trial :n [:k 0]
> if :n>4[pr :k stop]
> show :n
> trial :n+1 :k+1
> end

> the result from trial 2 is:
> trial 2
> 2
> 3
> 4
> 0
> You don't say what to do with 1  in trial
> [trial :n+1 :k+1]
> ------
> [:k 0] in trial :n [:k 0] sets a default value 0 for k
> thereafter I would expect :k to be 0 until the next call to trial,
> so trial :n+1 :k+1 should make k 1. It clearly does not.
> Is this the intended behaviour?  I was expecting the behaviour that
> a 'named let' in Scheme gives.

> Regards
> Mike


The www page contains some very powerful educational software.
Our single most important investment is our kids.

Thu, 28 Jun 2001 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. LOGO-L> Re: Logo query

2. LOGO-L> MSWLogo queries

3. LOGO-L> MSWLogo queries

4. Logo and non-Logo queries

5. LOGO-L> Apple logo/MSW Logo

6. LOGO-L> Reseach Machines Logo (RM LOGO)

7. WTD: 'ls -lR '->HTML code

8. MySQL query in PHP: Not query zero amounts also removes null amounts from query

9. LOGO-L> Welcome to logo-l

10. LOGO-L> Re: Dynamic scope in Logo


12. LOGO-L> Logo speed


Powered by phpBB® Forum Software