dyna icon indicating copy to clipboard operation
dyna copied to clipboard

ignore comments at REPL

Open jeisner opened this issue 12 years ago • 6 comments

Cut-and-paste from .dyna files into the repl currently fails because the repl doesn't quite know about comments. A trailing comment gives an error that the line doesn't end in a period ... unless the comment ends in a period!

I think you just need to do the period check after stripping comments, not before.

jeisner avatar Jun 18 '13 14:06 jeisner

... and multi-line rules aren't handled correctly.

timvieira avatar Jun 18 '13 16:06 timvieira

Oh right, I ran into that too.

On Tue, Jun 18, 2013 at 12:04 PM, Tim Vieira [email protected]:

... and multi-line aren't handled correctly.

— Reply to this email directly or view it on GitHubhttps://github.com/nwf/dyna/issues/22#issuecomment-19621566 .

jeisner avatar Jun 18 '13 16:06 jeisner

Tim, after the LI thing, we should figure out how to make the compiler have a captive mode for the REPL's use. This seems like as good a bug as any upon which to note that.

nwf avatar Jun 28 '13 04:06 nwf

As a temporary measure you can now use the REPL command > paste which will pull rules from your clipboard and load them all at once. So, if there is a comment or line break it shouldn't break stuff.

$ ./dyna
> paste
pathto(start) min= 0 with_key [start].
pathto(V) min= pathto(U) + edge(U,V) with_key [V | bestpath(U)].
bestpath(V) = $key(pathto(V)).
>>> ok? [Y/n] 

timvieira avatar Aug 02 '13 14:08 timvieira

entertaining ...

jeisner avatar Aug 02 '13 16:08 jeisner

This is how IPython does it...

On Fri, Aug 2, 2013 at 12:37 PM, Jason Eisner [email protected]:

entertaining ...

— Reply to this email directly or view it on GitHubhttps://github.com/nwf/dyna/issues/22#issuecomment-22017736 .

timvieira avatar Aug 02 '13 16:08 timvieira