[REBOL] Re: Mapping series
From: massung:gmai:l at: 8-Mar-2006 14:37
Thanks, I'll take a closer look at that one when I get a moment. Along the
same lines, has anyone come up with a version of "gensym" that can be used?
For example, using VID, I may want to dynamically create controls that
access themselves. I currently don't know of a way to do this without
generating a symbol to use. Here's a brief example of what I mean:
dyn-btn: does [
join [] [ gensym: 'button "foo" [ gensym/text: "bar" ]
]
Obviously, however, I can't use "gensym:" over and over again, I need to
have a way of "creating" the symbol on the fly and accessing it. I suppose I
could use to-word and coerce a generated string for the name (like Lisp
does). But is there a "nicer" way to do this?
On 3/8/06, Gregg Irwin <greggirwin-mindspring.com> wrote:
>
> Hi Jeff,
>
> JM> So, I'm sure REBOL has some sort of support for this, but I have yet
> to find
> JM> it. Does REBOL have any built-in support for traditional mapping
> functions
> JM> that are found in Lisp?
>
> Oddly enough, there isn't a native one. It has come up a number of
> times, and many folks have written their own; I don't know why RT
> hasn't included one yet. It's possible they're still looking for the
> right design. e.g. with refinements and such, I think there's more to
> it than just do the same thing Lisp does, when creating a standard
> function.
>
> Here's one, written by Larry Palmiter, that I use sometimes:
>
> map: apply: func [fn blk args /local result][
> result: copy []
> repeat el blk [append/only result fn :el args]
> result
> ]
>
> -- Gregg
>
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
--
massung-gmail.com