Logo white

Anubis / Anubis

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • anubis
  • anubis_dev
  • library
  • system
  • lists.anubis
  • Adding list.anubis file with functions 'contains' and 'append_once' ...
    b13ba73f
    New logger more secure and with color into console
    Adding to the VM the possibility to output color in console, using ANSI escape sequences
    Cédric RICARD authored
    2007-07-22 22:35:47 +0000  
    Browse Code »
lists.anubis 374 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/*
 * 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].