Enumerations: Difference between revisions
Content added Content deleted
m (Ol associative array syntax fix) |
(Added Prolog) |
||
Line 1,292: | Line 1,292: | ||
16 |
16 |
||
</pre> |
</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}}== |
=={{header|PureBasic}}== |