I have a set of variables that every time I launch my Console I need to enter manually. (See the P.S. for an example.) This is somehow like an initial setup that I perform every time I start working with this project. By any chance, is there any way I can input all this directly from a file using a one liner?
P.S.
rascal>x = var("x");
Exp: var("x")
rascal>y = var("y");
Exp: var("y")
rascal>z = var("z");
Exp: var("z")
rascal>ex = lam("x", x);
Exp: lam(
"x",
var("x"))
rascal>ey = lam("y", y);
Exp: lam(
"y",
var("y"))
rascal>ez = lam("z", z);
Exp: lam(
"z",
var("z"))
rascal>exy = app(ex, "y");
Exp: app(
lam(
"x",
var("x")),
"y")
rascal>exz = app(ex, "z");
Exp: app(
lam(
"x",
var("x")),
"z")
rascal>e = let([binding("x1", exy), binding("x2", exz)], app(var("x1"), "x2"));
Exp: let(
[
binding(
"x1",
app(
lam(
"x",
var("x")),
"y")),
binding(
"x2",
app(
lam(
"x",
var("x")),
"z"))
],
app(
var("x1"),
"x2"))
You could create a file called init.rsc (or something else) and then open that file, select your initialization code, right click and choose "copy to console".
Asked: Jan 03
Seen: 13 times
Last updated: Jan 03
Copyright CWI, 2010-2012. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.