Set: Difference between revisions

715 bytes added ,  1 year ago
no edit summary
(Added XPL0 example.)
No edit summary
Line 5,806:
<!--</syntaxhighlight>-->
Same output as above. I have written a builtins/sets.e, and tried another approach with builtins/sets2.e, but neither really hit the spot.
 
=={{header|Phixmonti}}==
<syntaxhighlight lang="Phixmonti">include ..\Utilitys.pmt
 
def isElement find enddef
 
def setUnion dup >ps remove ps> chain enddef
 
def setIntersection over >ps remove ps> swap remove enddef
 
def setDifference remove enddef
 
def setSubset swap remove len not nip enddef
 
def setEquality sort swap sort == enddef
 
( 1 2 3 ) 1 isElement ?
4 isElement ?
( 3 4 5 ) setUnion ?
( 1 2 3 ) ( 3 4 5 ) setIntersection ?
( 1 2 3 ) ( 3 4 5 ) setDifference ?
( 1 2 3 ) ( 3 4 5 ) setSubset ?
( 1 2 3 ) ( 1 2 ) setSubset ?
( 1 2 3 ) ( 3 4 5 ) setEquality ?
( 1 2 3 ) ( 3 1 2 ) setEquality ?
 
</syntaxhighlight>
{{out}}
<pre>1
0
[1, 2, 3, 4, 5]
[3]
[1, 2]
0
1
0
1
 
=== Press any key to exit ===</pre>
 
=={{header|PicoLisp}}==
57

edits