Peter Tanski wrote:
> // this mess is due largely to List
> val flxPty:Company =
> C (Cons ((D ("R&D", skaller,
> (Cons ((PU tryzelaar),
> Cons ((PU percossi),
> Cons ((PU tanski),
> Empty[SubUnit]) ))))), Empty[Dept]));
There's actually two ways to make this a bit cleaner. First, we just use
"+" to add list elements together:
val flxPty:Company = C (
List::Empty[Dept] + D (
"R&D",
skaller,
List::Empty[SubUnit] + (PU tryzelaar) + (PU percossi) + (PU tanski)
)
);
Second, and a bit more clear, we use the _ctor_list function
(implicitly). fyi, I had to check in a fix to get this working, so
you'll have to resync and rebuild:
open List;
val flxPty:Company = C (
list(
D (
"R&D",
skaller,
list(PU tryzelaar, PU percossi, PU tanski)
)
)
);
The only (minor) problem with the _ctor_list is that we're actually
creating an array of PU items, and passing it into the list. John, can
felix optimize away the array in this situation?
-e
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language