Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,10 @@
macro evalwithx(expr, a, b)
return quote
x = $a
tmp = $expr
x = $b
return $expr - tmp
end
end
@evalwithx(2 ^ x, 3, 5) # raw expression (AST)

View file

@ -0,0 +1,9 @@
function evalwithx(expr::Expr, a, b)
a = eval(quote let x = $a; return $expr end end)
b = eval(quote let x = $b; return $expr end end)
return b - a
end
evalwithx(expr::AbstractString, a, b) = evalwithx(parse(expr), a, b)
evalwithx(:(2 ^ x), 3, 5)
evalwithx("2 ^ x", 3, 5)