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,23 @@
;; use reader macros to transform (a OP b) into (OP b a)
(lib 'match)
(define-macro invert-= (a <- b) (set! b a))
(define-macro invert-IF (a 'IF b) (when b a))
(define raining #f)
(#t <- raining)
raining
→ #t
('umbrella-need IF raining)
→ umbrella-need
(#f <- raining)
('umbrella-need IF raining)
→ #f
;; debug mode
(debug 3)
('umbrella-need IF raining)
💡 [0] invert-IF → ('umbrella-need IF raining)
compiled :: (#when raining 'umbrella-need)

View file

@ -0,0 +1,13 @@
' FB 1.05.0 Win64
#Define ThenIf(a, b) If b Then a
#Define InvertAssign(a, b) b = a
Dim As Boolean needUmbrella = False, raining = True
ThenIf(needUmbrella = True, raining = True)
Print "needUmbrella = "; needUmbrella
Dim As Integer b = 0, a = 3
InvertAssign(a, b)
Print "b is"; b
Sleep

View file

@ -0,0 +1,8 @@
# Inverted syntax with assignment
var raining = true;
[false]»(\var needumbrella);
# Inverted syntax with conditional expressions
if (raining==true) {needumbrella=true};
{needumbrella=true} -> if (raining==true);
(needumbrella=true) if (raining==true);

View file

@ -0,0 +1,29 @@
infix operator ~= {}
infix operator ! {}
func ~=(lhs:Int, inout rhs:Int) {
rhs = lhs
}
func !(lhs:(() -> Void), rhs:Bool) {
if (rhs) {
lhs()
}
}
// Traditional assignment
var a = 0
// Inverted using a custom operator
20 ~= a
let raining = true
let tornado = true
var needUmbrella = false
var stayInside = false
// Traditional conditional expression
if raining {needUmbrella = true}
// Inverted using a custom operator
_ = {stayInside = true} ! tornado

View file

@ -0,0 +1,8 @@
; a = expr
:a expr
; expr = a
~:expr a
; if cond expr
@if cond expr
; if expr cond
~@if expr cond

View file

@ -0,0 +1 @@
v as $x

View file

@ -0,0 +1,2 @@
o["a"] = 2
# or equivalently: o.a = 2