* Izkata <[EMAIL PROTECTED]> [051001 09:24]:
> 
> >   In the same spirit as '=s, I'm trying the following
> >   =u: func[v][either unset? v[""][v]]
> >   ;; with the following results
> >   >> =u v
> >   ** Script Error: v has no value
> >   ** Near: =u v
> >   ;; so how may we intercept an unset value?
> 
> I find it a bit annoying the way unset! works, but this is
> how to use it:
> 
> >> u: func [v [any-type!]][either unset? get/any 'v [""][v]]
> >> u
> == ""
> >> u "hi"
> == "hi"
 
  Wham! 
  Now I can do the following:
  >> t: u repeat c "" collect[c]
  == ""

  Thanks Izzy!

> I avoid it, since it's a bit too easy to accidentally use v
> without checking it it's an unset! or not.
 
  Not clear on what you mean, can you elaborate on what
  the "gotcha" might be?

  cheers
  tim


-- 
Tim Johnson <[EMAIL PROTECTED]>
      http://www.alaska-internet-solutions.com
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to