Enumerations: Difference between revisions

Added Prolog
m (Ol associative array syntax fix)
(Added Prolog)
Line 1,292:
16
</pre>
 
=={{header|Prolog}}==
Prolog doesn't have enums, but they can be simulated using a set of facts.
 
<lang prolog>fruit(apple,1).
fruit(banana,2).
fruit(cherry,4).
 
write_fruit_name(N) :-
fruit(Name,N),
format('It is a ~p~n', Name).</lang>
 
=={{header|PureBasic}}==
Anonymous user