Created
July 9, 2012 15:14
-
-
Save ploubser/3077098 to your computer and use it in GitHub Desktop.
Illume language prototype
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
/* Check if foo is present in an array */ | |
/* General language functions */ | |
#import “stdlib” | |
func main: argv { | |
list = [‘foo’, ‘bar’, baz’]; | |
return find_value(list, ‘baz’); | |
} | |
func find_value: list, value{ | |
(size(list) == 0) -> | |
return false; | |
(list[0] == value) | |
-> | |
return true; | |
: | |
return find_value(subset(list, 1, size(list), value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment