mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 02:13:54 +00:00
Branches: main Minor fixes. library/io.m: Add `may_not_duplicate' to some Erlang foreign_procs. tests/general/test_string_to_int_overflow.exp: tests/general/test_string_to_int_overflow.exp2: tests/general/test_string_to_int_overflow.exp3: tests/general/test_string_to_int_overflow.m: Make this test case work with arbitrary-precision integers, namely with the Erlang backend. tests/hard_coded/trace_goal_4.m: Fix a format specifier in Erlang foreign_proc. tests/hard_coded/expand.exp2: tests/hard_coded/write.exp2: tests/hard_coded/write_reg1.exp2: Delete leading zeros in exponents, not produced in any current grade. tests/hard_coded/write.exp3: Add expected output for csharp grade.
49 lines
733 B
Plaintext
49 lines
733 B
Plaintext
var("X") + int(3) * var("X^2") ; (type)
|
|
{ type }
|
|
{ ':-' }
|
|
':-'
|
|
{ blah }
|
|
blah ; (type), (type) * blah ; (type)
|
|
((blah ; blah), blah) * blah ; blah
|
|
(type) * blah ; (type)
|
|
TESTING DISCRIMINATED UNIONS
|
|
one
|
|
two
|
|
three
|
|
apple([9, 5, 1])
|
|
banana([three, one, two])
|
|
zop(3.30000000000000, 2.03000000000000)
|
|
zip(3, 2)
|
|
zap(3, -2.11100000000000)
|
|
wombat
|
|
foo
|
|
|
|
TESTING POLYMORPHISM
|
|
poly_one([2399.30000000000])
|
|
poly_two(3)
|
|
poly_three(3.33000000000000, 4, poly_one(9.11000000000000))
|
|
|
|
TESTING BUILTINS
|
|
""
|
|
"Hello, world\n"
|
|
"Foo%sFoo"
|
|
"\""
|
|
'a'
|
|
'&'
|
|
3.14159000000000
|
|
1.12832498300000e-21
|
|
2.23954899000000e+23
|
|
-65
|
|
4
|
|
univ_cons(["hi! I\'m a univ!"])
|
|
'<<predicate>>'
|
|
|
|
TESTING OTHER TYPES
|
|
var(1)
|
|
var_supply(0)
|
|
var_supply(1)
|
|
empty
|
|
qwerty(4)
|
|
array([1, 2, 3, 4])
|
|
|