kitten icon indicating copy to clipboard operation
kitten copied to clipboard

Copy and paste interactive sessions

Open evincarofautumn opened this issue 7 years ago • 2 comments

It would be nice if, after an interactive mode session, you could copy and paste the entire session from your terminal into a source file and have it just work without modification. This was one of the reasons why // was chosen as the command prefix.

To do this, we would need to:

  1. Prefix or surround all compiler output with comment delimiters, or introduce an alternate “literate” notation in which the Kitten prompt is the same as the code prefix.

  2. Only allow the operands of infix operators to span multiple lines if wrapped in parentheses. (This should also help a lot with error messages.)

evincarofautumn avatar Feb 06 '17 07:02 evincarofautumn

One thing I can say in relation to this is that I really dislike // and /* */ style comments. Would much prefer Haskell's -- style. Haskell uses {- -} for multiline commrnts, which is okay. (- -) would be more Forth like. But for this issue a better idea might be to use --- to simply separate alternating code vs comment.

trans avatar Feb 06 '17 09:02 trans

I’m not sure any particular choice for comment syntax is clearly better than any other, so borrowing C-family syntax seemed reasonable. And I guess the “literate Kitten” approach is cleaner and simpler; --- would probably work for that too.

evincarofautumn avatar Feb 06 '17 10:02 evincarofautumn