Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Oz

Name: Anonymous 2011-10-12 14:21

In OZ there is a function called map, which allows you to manipulate each member of a list and create a new list.

Map [1 2 3 4 5] fun {$ X} [X+1] end

This will add one to each element of the list and create a new one. Which would leave me with

[2 3 4 5 6]


I am trying to do something where I compare each element of the list to a Key and then print it if it matches, else nil.

I can't figure a way to get the variable Key into the anonymous function, as it will just declare a new instance. Is there a way to do this easily? Or am I trying to do this the wrong way.

Name: Anonymous 2011-10-12 15:35

I can't believe that there are actually people who use Oz.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List