[Oz] Applying a list of procedures

Denys Duchier Denys.Duchier at ps.uni-sb.de
Mon Mar 22 10:15:18 CET 1999


khoxsey at ix.netcom.com (Kent Hoxsey) writes:

> I may be misfiring, but I'm confused about how to apply a list of procedures
> to a variable. I know I can use ForAll or Map to apply a procedure to each
> element in a list, but can't quite figure out how to do it the other way.
> 
> Am I misreading the list functions, or is there an easy way to do this?

You can apply ForAll to a list of procedures:

        {ForAll Ps proc {$ P} {P X} end}

For example

        {ForAll [Show Browse] proc {$ P} {P X} end}

will execute {Show X} and {Browse X}

-- 
Dr. Denys Duchier			Denys.Duchier at ps.uni-sb.de
Forschungsbereich Programmiersysteme	(Programming Systems Lab)
Universitaet des Saarlandes, Geb. 45	http://www.ps.uni-sb.de/~duchier
Postfach 15 11 50			Phone: +49 681 302 5618
66041 Saarbruecken, Germany		Fax:   +49 681 302 5615
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.





More information about the mozart-users mailing list