In einer eMail vom 23.03.00 23:25:19 (MEZ) Mitteleuropäische Zeit schreibt 
[EMAIL PROTECTED]:

> Hi Volker,
>  
>  you wrote:
>  >use and /local have another bug: you can't look in after an error!
>  
>  I'm not sure how you were trying to "look in":
>  
>  >> f: func [/local a] [a: 1 1 / 0]
>  
>  will cause a divide by zero error:
>  
>  >> f
>  ** Math Error: Attempt to divide by zero.
>  ** Where: 1 / 0
>  
>  Now let's look at the value of a:
>  
>  >> first second :f
>  == a:
>  
>  >> get first second :f
>  == 1
>  
>  "Looked in" and saw that a evaluates to 1. You must mean something quite
>  different?
>  

No. I meant that. Just have not known this way. thanks.

>  >a question: [a: do [print "1"]] does not work, how can i handle this too?
>  >i wanted to return the result of [do b] this way, with some lines after it
>  >[.. e: do b  if a-option [..]  "return" e ] ?
>  
>  print returns nothing, and nothing is a value of type unset!:
>  >> type? print "hello"
>  hello
>  == unset!
>  
>  >> type? do [print "hello"]
>  hello
>  == unset!
>  
>  >> print mold do [print "hello"]
>  hello
>  ** Script Error: mold is missing its value argument.
>  ** Where: print mold do [print "hello"]
>  
>  When type? returns the datatype unset! it is reporting that there was no
>  value:
>  
>  >> type?
>  == unset!
>  
>  There is no value to assign to 'a in your example. Otherwise it works as
>  you expect (?):
>  >> f: func [] [a: do [1 + 1] return a]
>  >> f
>  == 2
>  

My problem is: i dont know the arg of 'do. its a parameter. 
type? destroys the result. i can not store it before, because 
this can cause an error. i can not [try [a: do b] because the error
can be caused by code in 'b . maybe something like
[try [ a: try [b]], but this gets complicated. 
hm. someone more clever than me? 

>  >"code"
>  >local: func[a "vars" b "script" /local c d ][
>  >    c: copy[]   foreach i a[ append c to set-word! i]   append c none
>  
>  You could simplify your foreach loop:
>  
>  foreach i a [
>    append c compose [(to set-word! i) none]
>  ]
>  
Ah!

>  
>  


Volker

Reply via email to