Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
# Constructing an environment has to be done by way of evaluation
|
||||
#for historical reasons which will hopefully be entirely eliminated soon.
|
||||
def bindX(value) {
|
||||
def [resolver, env] := e` # bind x and capture its resolver and the
|
||||
def x # resulting environment
|
||||
`.evalToPair(safeScope)
|
||||
resolver.resolve(value) # set the value
|
||||
return env
|
||||
}
|
||||
|
||||
def evalWithX(program, a, b) {
|
||||
def atA := program.eval(bindX(a))
|
||||
def atB := program.eval(bindX(b))
|
||||
return atB - atA
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
? evalWithX(e`(x :float64).exp()`, 0, 1)
|
||||
# value: 1.7182818284590455
|
||||
Loading…
Add table
Add a link
Reference in a new issue