Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests stop at peek-char.2 #29

Open
Affonso-Gui opened this issue Jul 22, 2018 · 1 comment
Open

Tests stop at peek-char.2 #29

Affonso-Gui opened this issue Jul 22, 2018 · 1 comment

Comments

@Affonso-Gui
Copy link
Member

Common Lisp description:

peek-char &optional peek-type input-stream eof-error-p eof-value recursive-p => char

In eus we do not have peek-type, making the first argument be input-stream.
If input-stream is nil *standard-input* is used, if it is t *terminal-io* is used. https://github.com/euslisp/EusLisp/blob/master/lisp/c/lispio.c#L64-L65

Therefore,

(deftest peek-char.2
  (with-input-from-string
   (*standard-input* "   ab")
   (values
    (peek-char)
    (read-char)
    (peek-char t)
    (read-char)
    (peek-char t)
    (read-char)))
  #\Space #\Space #\a #\a #\b #\b)

Stops at (peek-char t), waiting for terminal input.
Pressing enter makes the tests continue.

@ericlesaquiles
Copy link
Collaborator

I have corrected that behavior on the PR. As of now, peek-type is ignored. As of now as well, or so it seems to me, those whitespace-related features are best dealt with in the C code. Adding that option in a sensible manner then (not the way I have done here) could create incompatibility with existing code, so I'm not sure whether I should do it..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants