>
> I believe that ocaml has a special ;; character in the language specially
> for
> handling situations like that.
>
Yep, similar to how Python looks for 2 consecutive newlines to end a block.
(OCaml's ;; is sometimes useful in files, but those cases are very rare.
https://ocaml.org/learn/tut
I don't know how change the terminal IO to send eofs, but I believe
that ocaml has a special ;; character in the language specially for
handling situations like that. In other words, the user has to
explicitly delimit REPL interactions (but they don't have to do that
in other contexts).
Robby
On
Ah, ok, that (mostly) makes sense to me. I think this might be a
little bit complicated, though: in this language, definitions can
span multiple lines without necessarily any direct indication that
they continue. Think Haskell-style pattern matching:
fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) +
The intention here is that you should have a notion of an expression
that is itself consistent and you should read until you get a whole
one of those and then just return that. The different behavior you see
in DrRacket and at the terminal window prompt will, yes, cause
different behavior, but it i
I am trying to write a custom current-read-interaction for a language
with non-s-expression syntax, and I’m not sure I completely understand
the protocol for how to detect the end of input across both the command
line and DrRacket. I first wrote an implementation for DrRacket, which
appears to cont
5 matches
Mail list logo