init commit again
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving
|
||||
initialise-binding
|
||||
apply(
|
||||
sequential(print 1, function abstraction print given),
|
||||
sequential(print 2 , 3))
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [1, 2, 3];
|
||||
//Also:
|
||||
// standard-out: [2, 1, 3];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving
|
||||
initialise-binding
|
||||
scope(
|
||||
bind-value("f",
|
||||
function abstraction
|
||||
sequential(print given, integer-add(1,given))),
|
||||
print apply(
|
||||
compose(
|
||||
bound-value"f",
|
||||
function abstraction sequential(print 1, 2)),
|
||||
99))
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [1, 2, 3];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving
|
||||
initialise-binding
|
||||
scope(
|
||||
bind-value("f",
|
||||
function abstraction print given),
|
||||
apply(
|
||||
apply(curry(bound-value"f"), 1),
|
||||
2))
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [tuple(1,2)];
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving
|
||||
initialise-binding
|
||||
scope(
|
||||
bind-value("x",99),
|
||||
give(
|
||||
99,
|
||||
give(
|
||||
function abstraction(
|
||||
sequential(
|
||||
print given,
|
||||
print bound-value"x")),
|
||||
scope(
|
||||
bind-value("x",4),
|
||||
apply(
|
||||
sequential(print 1, given),
|
||||
sequential(print 2, 3))))))
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [1, 2, 3, 4];
|
||||
//Also:
|
||||
// standard-out: [2, 1, 3, 4];
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving
|
||||
initialise-binding
|
||||
scope(
|
||||
bind-value("x",4),
|
||||
give(
|
||||
99,
|
||||
give(
|
||||
function closure(
|
||||
sequential(
|
||||
print given,
|
||||
print bound-value"x")),
|
||||
scope(
|
||||
bind-value("x",99),
|
||||
apply(
|
||||
sequential(print 1, given),
|
||||
sequential(print 2, 3))))))
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [1, 2, 3, 4];
|
||||
//Also:
|
||||
// standard-out: [2, 1, 3, 4];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving
|
||||
initialise-binding
|
||||
scope(
|
||||
bind-value("f",
|
||||
function abstraction print given),
|
||||
apply(
|
||||
partial-apply(bound-value"f", 1),
|
||||
2))
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [tuple(1,2)];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving
|
||||
initialise-binding
|
||||
force(
|
||||
supply(
|
||||
sequential(print 1, function abstraction print given),
|
||||
sequential(print 2 , 3)))
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [1, 2, 3];
|
||||
//Also:
|
||||
// standard-out: [2, 1, 3];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving
|
||||
initialise-binding
|
||||
scope(
|
||||
bind-value("f",
|
||||
uncurry function abstraction
|
||||
sequential(print given,
|
||||
function abstraction print given)),
|
||||
apply(bound-value"f", tuple(1,2)))
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [1, 2];
|
||||
}
|
||||
Reference in New Issue
Block a user