Ask Your Question
2

Console Content Setup

asked Jan 03

Hossein gravatar image Hossein
81 8 20

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"))
delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered Jan 03

DavyLandman gravatar image DavyLandman flag of Netherlands
267 4 17
http://homepages.cwi.nl/~...

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".

link delete flag offensive edit

Comments

Oh, cool! Thanks. :)

Hossein (Jan 03)edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]
Also see the Rascal Tutor.

Question tools

Follow

subscribe to rss feed

Stats

Asked: Jan 03

Seen: 13 times

Last updated: Jan 03

Related questions