snow-deprecated icon indicating copy to clipboard operation
snow-deprecated copied to clipboard

Magic variable containing the previously evaluated expression in Interactive Snow

Open Mikoangelo opened this issue 16 years ago • 5 comments
trafficstars

In Ruby's IRB, there's the magic variable _ that contains the most recently evaluated expression at the top level. This is very convenient, so I propose an equivalent to be made available in Snow.

Mikoangelo avatar Jun 23 '09 15:06 Mikoangelo

Not a bad idea at all. The feature is specific to interactive mode, right?

simonask avatar Jun 23 '09 15:06 simonask

Traditionally, yes. I've been playing with the idea of bringing it into the language as a whole, but even ''I'' realize that's a can of worms. It's still worth some thought, though.

Mikoangelo avatar Jun 23 '09 15:06 Mikoangelo

I think it would be neat if Interactive Snow was a regular program built in Snow, and not compiled directly into the executable. It makes it far more extensible, and it's always good to eat your own ass (or whatever it's called) :-)

judofyr avatar Jun 24 '09 23:06 judofyr

I do not believe I possess the dexterity required to do that. But yeah, good point. It can be done already, using the amazing(ly undocumented) dlopen/ExternalLibrary features.

However, for debugging purposes (Snow is the thing being debugged – if something goes wrong in isn, it's nice to know that it's your code, not the isn code, that fails), I think we'll keep the C++ implementation for now, at least until Snow is somewhat more stable.

simonask avatar Jun 25 '09 06:06 simonask

I concur with both Judofyr and Simon. isn should definitely be implemented in Snow in the future, but it's probably not 0.1 material. Should a feature request be filed now? This conversation is straying slightly off topic ;)

Mikoangelo avatar Jun 25 '09 09:06 Mikoangelo