pattern matching on fields of the argument
Adam Megacz <[email protected]> Sun, 01 Aug 2004 15:03:39 -0700
| Newsgroups | gmane.comp.lang.nice.devel |
|---|---|
| Organization | Myself |
| Message-ID | <[email protected]> |
I've been really happy with Nice thus far. However, there is one
feature that I need rather rapidly, so if somebody could point me at
the right file to start digging around in in order to implement it,
I'd appreciate that.
I need something like ML/Haskell's ability to match on multiple leaves
of a data structure. For example:
data Foo = Bar Int Foo
| Baz Int Foo
blah (Bar x (Baz f)) = ...
blah (Bar x (Bar f)) = ...
Basically I want to do some tree transformations, and it makes more
sense to group the code by transformation rather than grouping by
"shared prefix".
Ideally the nice code would look something vaguely like
class Foo { ?Foo a; int b; }
void foo(Foo f);
foo(Foo(a:null)) = ...
Can anybody tell me where I might start looking for the right place to
add this? Initially I just need to get it working quickly so I can
move on with other stuff, but longer term I'd be interested in
migrating it back into the main codebase.
- a
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com