lists.anubis
374 Bytes
/*
* Created by PyramIDE.
* User: ricard
* Date: 22/07/2007
* Time: 16:32
*
*/
public define Bool
contains
(
List($T) l,
$T val
) =
if l is
{
[] then false,
[h . t] then
if h = val then true
else contains(t, val)
}.
public define List($T)
append_once
(
List($T) l,
$T val
) =
if contains(l, val) then l
else [val . l].