Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,6 @@
(eval (list * 6 7))
→ 42
(eval '(* 6 7)) ;; quoted argument
→ 42
(eval (read-from-string "(* 6 7)"))
→ 42

View file

@ -0,0 +1,9 @@
Procedure Main()
local bAdd := {|Label,n1,n2| Qout( Label ), QQout( n1 + n2 )}
Eval( bAdd, "5+5 = ", 5, 5 )
Eval( bAdd, "5-5 = ", 5, -5 )
return
Upon execution you see:
5+5 = 10
5-5 = 0

View file

@ -0,0 +1,30 @@
//code, fragment name, autocollect, inplaintext
local(mycode = "'Hello world, it is '+date")
sourcefile('['+#mycode+']','arbritraty_name', true, true)->invoke
'\r'
var(x = 100)
local(mycode = "Outside Lasso\r['Hello world, var x is '+var(x)]")
// autocollect (3rd param): return any output generated
// inplaintext (4th param): if true, assumes this is mixed Lasso and plain text,
// requires Lasso code to be in square brackets or other supported code block demarkation.
sourcefile(#mycode,'arbritraty_name', true, true)->invoke
'\r'
var(y = 2)
local(mycode = "'Hello world, is there output?\r'
var(x) *= var(y)")
// autocollect (3rd param): as false, no output returned
// inplaintext (4th param): as false, assumes this is Lasso code, no mixed-mode Lasso and text.
sourcefile(#mycode,'arbritraty_name', false, false)->invoke
'var x is now: '+$x
'\r'
var(z = 3)
local(mycode = "var(x) *= var(z)")
sourcefile(#mycode,'arbritraty_name', false, false)->invoke
'var x is now: '+$x

View file

@ -0,0 +1,5 @@
"[ [ $a, 12], [$b, 1.2], [ $c, [ $aaa, $bbb, $ccc ] ], [ $torun, #first ] ]" perform .s
[1] (List) [[a, 12], [b, 1.2], [c, [aaa, bbb, ccc]], [torun, #first]]
"12 13 +" perform
[1:interpreter] ExCompiler : Can't evaluate <+>

View file

@ -0,0 +1,4 @@
"12 13 + println" eval
25
": newFunction(a) a + ; 12 10 newFunction println" eval
22

View file

@ -0,0 +1,5 @@
Eval("nOutput = 5+2*5 " )
See "5+2*5 = " + nOutput + nl
Eval("for x = 1 to 10 see x + nl next")
Eval("func test see 'message from test!' ")
test()

View file

@ -0,0 +1,12 @@
5+2*5 = 15
1
2
3
4
5
6
7
8
9
10
message from test!

View file

@ -0,0 +1,9 @@
while true
see nl + "code:> "
give cCode
try
eval(cCode)
catch
see cCatchError
done
end

View file

@ -0,0 +1,20 @@
code:> see "hello world"
hello world
code:> for x = 1 to 10 see x + nl next
1
2
3
4
5
6
7
8
9
10
code:> func test see "Hello from test" + nl
code:> test()
Hello from test
code:> bye

View file

@ -0,0 +1,3 @@
var (a, b) = (-5, 7);
say eval '(a * b).abs'; # => 35
say (a * b -> abs); # => 35

View file

@ -0,0 +1,2 @@
let fn = exprtofn("13 + 37");
fn() // -> 50

View file

@ -0,0 +1,2 @@
let fn = exprtofn("#0 * #1");
fn(3, 4) // -> 12

View file

@ -0,0 +1,2 @@
let fn = compile("for (var i = 0; i < 10; i++) { print(i); }");
fn(); // result: 0 1 2 3 4 5 6 7 8 9

View file

@ -0,0 +1,2 @@
# writes hello world to the console
eval "out \"hello world\" endl console" console