mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-18 23:35:25 +00:00
139 lines
2.9 KiB
Plaintext
139 lines
2.9 KiB
Plaintext
TESTING DISCRIMINATED UNIONS
|
|
one/0
|
|
no arguments
|
|
expand: functor one arity 0 arguments []
|
|
|
|
two/0
|
|
no arguments
|
|
expand: functor two arity 0 arguments []
|
|
|
|
three/0
|
|
no arguments
|
|
expand: functor three arity 0 arguments []
|
|
|
|
apple/1
|
|
argument 1 of functor apple was:[9, 5, 1]
|
|
expand: functor apple arity 1 arguments [[9, 5, 1]]
|
|
|
|
banana/1
|
|
argument 1 of functor banana was:[three, one, two]
|
|
expand: functor banana arity 1 arguments [[three, one, two]]
|
|
|
|
zop/2
|
|
argument 2 of functor zop was:2.03000000000000
|
|
expand: functor zop arity 2 arguments [3.30000000000000, 2.03000000000000]
|
|
|
|
zip/2
|
|
argument 2 of functor zip was:2
|
|
expand: functor zip arity 2 arguments [3, 2]
|
|
|
|
zap/2
|
|
argument 2 of functor zap was:-2.11100000000000
|
|
expand: functor zap arity 2 arguments [3, -2.11100000000000]
|
|
|
|
wombat/0
|
|
no arguments
|
|
expand: functor wombat arity 0 arguments []
|
|
|
|
foo/0
|
|
no arguments
|
|
expand: functor foo arity 0 arguments []
|
|
|
|
|
|
TESTING POLYMORPHISM
|
|
poly_two/1
|
|
argument 1 of functor poly_two was:3
|
|
expand: functor poly_two arity 1 arguments [3]
|
|
|
|
poly_three/3
|
|
argument 3 of functor poly_three was:poly_one(9.11000000000000)
|
|
expand: functor poly_three arity 3 arguments [3.33000000000000, 4, poly_one(9.11000000000000)]
|
|
|
|
poly_one/1
|
|
argument 1 of functor poly_one was:[2399.30000000000]
|
|
expand: functor poly_one arity 1 arguments [[2399.30000000000]]
|
|
|
|
|
|
TESTING BUILTINS
|
|
""/0
|
|
no arguments
|
|
expand: functor "" arity 0 arguments []
|
|
|
|
"Hello, world
|
|
"/0
|
|
no arguments
|
|
expand: functor "Hello, world
|
|
" arity 0 arguments []
|
|
|
|
"Foo%sFoo"/0
|
|
no arguments
|
|
expand: functor "Foo%sFoo" arity 0 arguments []
|
|
|
|
"""/0
|
|
no arguments
|
|
expand: functor """ arity 0 arguments []
|
|
|
|
'a'/0
|
|
no arguments
|
|
expand: functor 'a' arity 0 arguments []
|
|
|
|
'&'/0
|
|
no arguments
|
|
expand: functor '&' arity 0 arguments []
|
|
|
|
3.14159000000000/0
|
|
no arguments
|
|
expand: functor 3.14159000000000 arity 0 arguments []
|
|
|
|
1.12832498300000e-21/0
|
|
no arguments
|
|
expand: functor 1.12832498300000e-21 arity 0 arguments []
|
|
|
|
2.23954899000000e+23/0
|
|
no arguments
|
|
expand: functor 2.23954899000000e+23 arity 0 arguments []
|
|
|
|
-65/0
|
|
no arguments
|
|
expand: functor -65 arity 0 arguments []
|
|
|
|
4/0
|
|
no arguments
|
|
expand: functor 4 arity 0 arguments []
|
|
|
|
univ_cons/1
|
|
argument 1 of functor univ_cons was:["hi! I\'m a univ!"]
|
|
expand: functor univ_cons arity 1 arguments [["hi! I\'m a univ!"]]
|
|
|
|
<<predicate>>/0
|
|
no arguments
|
|
expand: functor <<predicate>> arity 0 arguments []
|
|
|
|
{}/4
|
|
argument 4 of functor {} was:{1, 2, 3, 4}
|
|
expand: functor {} arity 4 arguments [1, 'b', "third", {1, 2, 3, 4}]
|
|
|
|
|
|
TESTING OTHER TYPES
|
|
var/1
|
|
argument 1 of functor var was:1
|
|
expand: functor var arity 1 arguments [1]
|
|
|
|
var_supply/1
|
|
argument 1 of functor var_supply was:0
|
|
expand: functor var_supply arity 1 arguments [0]
|
|
|
|
var_supply/1
|
|
argument 1 of functor var_supply was:1
|
|
expand: functor var_supply arity 1 arguments [1]
|
|
|
|
empty/0
|
|
no arguments
|
|
expand: functor empty arity 0 arguments []
|
|
|
|
qwerty/1
|
|
argument 1 of functor qwerty was:4
|
|
expand: functor qwerty arity 1 arguments [4]
|
|
|
|
|