brownplt / pyret-lang

The Pyret language.
Other
1.07k stars 109 forks source link

lists is not available in the REPL #1278

Closed sorawee closed 6 years ago

sorawee commented 6 years ago

In the definition window, we can write:

lists.sort([list: 1, 2, 3])

In the REPL, this results in unbound id.

SethPoulsen commented 6 years ago

Should this be a code.pyret.org issue? Or does it fit here? I'm trying to figure out where I should look if I want to have a go at fixing it.

jpolitz commented 6 years ago

It's going to need to be fixed in pyret-lang. The file src/compiler/repl.arr defines the model of scope and modules in the REPL; CPO is just a client of that library.

I have a feeling this issue is deeper rooted than just a trivial fix. There are several interesting things that happen with types, scope, modules, and the REPL.

I won't say don't dive in, since you seem to be having success navigating and building the codebase! I just want to note that I suspect this could be a bit of a rabbit hole.​

SethPoulsen commented 6 years ago

Ok, sounds good. Is there currently an easy way to start a REPL without the website?

jpolitz commented 6 years ago

You can do it programmatically with the support in tests/pyret/tests/test-repl.arr (which is how pyret-lang tests the REPL without CPO being present), but the best development workflow is probably to use a local CPO.

There isn't a good command-line REPL right now. There was one a while ago but it bitrotted and never got all the way there, sad to say.

[As a medium-sized, fairly separable project, a CLI REPL could be a terrific contribution, for anyone listening in ;-)]

SethPoulsen commented 6 years ago

This can be closed now, right?

sorawee commented 6 years ago

This was merged to horizon (http://pyret-horizon.herokuapp.com/) but not CPO (http://code.pyret.org/). Probably should leave open until it's merged to CPO (to avoid people filing the same bug again)