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

TYI atom not supported #2

Open
einstein95 opened this issue Sep 18, 2023 · 0 comments
Open

TYI atom not supported #2

einstein95 opened this issue Sep 18, 2023 · 0 comments

Comments

@einstein95
Copy link

Spellbreaker's Z6.ZIL has this commented-out code

<REPEAT (CHR)
        <PRINC "Debugging? (Y or N): " ,OUTCHAN>
        <SET CHR <TYI>>
        <COND (<MEMQ .CHR "Yy ">
               <PRINC " Debugging!
" ,OUTCHAN>
               <RETURN <SETG ZDEBUGGING? T>>)
              (<MEMQ .CHR "Nn">
               <PRINC " No debugging!
" ,OUTCHAN>
               <RETURN <SETG ZDEBUGGING? <>>>)
              (ELSE
               <PRINC " ??
" ,OUTCHAN>)>>

Attempting to compile with this code uncommented causes an error with

Debugging? (Y or N): [error MDL0200] z6.zil:19: calling unassigned atom: TYI
  in SET called at z6.zil:19
  in REPEAT called at z6.zil:17

This is an atom from MDL, from the manual:

<TYI 〈terminal-input:channel〉>

returns one CHARACTER from 〈channel〉 (optional, .INCHAN by default) when it is typed, rather than after $ (ESC) is typed, as is the case with READCHR. The following example echos input characters as their ASCII values, until a carriage-return is typed:

<REPEAT (( FOO <TTYECHO . INCHAN <>>))
    <AND <==? 13 <PRINC <ASCII <TYI .INCHAN >>>>
        <RETURN <TTYECHO . INCHAN T>>>>
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

1 participant