| Simon Richard Clarkstone 2007-05-21, 10:05 pm |
| Ville Oikarinen wrote:
> The discussion motivated me to implement function composition in my
> ngrease language. The following acceptance test shows it in action:
>
> $:assert:$:equals {
> abcd
> $:compose {
> _:a
> $:append-symbols {$:_ b}
> $:append-symbols {$:_ c}
> $:append-symbols {$:_ d}
> }
> }
>
> (From
> http://ngrease.svn.sourceforge.net/...209&view=markup
> )
There is a potential bug in your acceptance tests. Normally in
programming and mathematics, an empty composition is not an error but is
the identity function, as the identity function is also the left and
right identity element for function composition. Is there a special
reason that this case is different?
--
Simon Richard Clarkstone:
s.r.cl?rkst?n?@durham.ac.uk/s?m?n.cl?rkst?n?@hotmail.com
"August 9 - I just made my signature file. Its only 6 pages long.
I will have to work on it some more." -- _Diary of an AOL User_
|