Jump to content

Enumerations: Difference between revisions

m (Shortened my Scheme using syntax extension)
Line 1,421:
define("FRUIT_BANANA", 1);
define("FRUIT_CHERRY", 2);</lang>
 
=={{header|Picat}}==
{{trans|Prolog}}
Picat doesn't have enumerations but they can be simulated by facts.
 
<lang Picat>fruit(apple,1).
fruit(banana,2).
fruit(cherry,4).
print_fruit_name(N) :-
fruit(Name,N),
printf("It is %w\nn", Name).</lang>
 
 
=={{header|PicoLisp}}==
495

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.