Last active
November 18, 2015 14:37
-
-
Save tetsu-miyagawa/238708b6c9be34d1e8b1 to your computer and use it in GitHub Desktop.
CTMCP Section 2.9 Exercise 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare Test | |
proc {Test X} | |
case X | |
of a|Z then {Browse 'case'(1)} | |
[] f(a) then {Browse 'case'(2)} | |
[] Y|Z andthen Y==Z then {Browse 'case'(3)} | |
[] Y|Z then {Browse 'case'(4)} | |
[] f(Y) then {Browse 'case'(5)} | |
else {Browse 'case'(6)} end | |
end | |
{Test [b c a]} | |
{Test f(b(3))} | |
{Test f(a)} | |
{Test f(a(3))} | |
{Test f(d)} | |
{Test [a b c]} | |
{Test [c a b]} | |
{Test a|a} | |
{Test '|'(a b c)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment