include

30 views
Skip to first unread message

saurus

unread,
Jun 14, 2016, 6:49:39 PM6/14/16
to retro-language
when i include a file, the contents are echoed to the terminal.
how do i turn it off?

also, when an error is encountered in an included file,
retro continues to load the rest of the file.
is there a way to make it abort at the error?

Charles Childers

unread,
Jun 15, 2016, 6:26:06 AM6/15/16
to retr...@googlegroups.com
There's not a good way to deal with this.

Retro's core input model assumes that only a keyboard/terminal output exist. Including a file fundamentally treats the contents as keyboard input.

You could try something like:

    &drop &putc :is
    ... include ...
    &putc :devector

On the second one: detecting the failure and aborting would require some changes to both Retro's input model and the Ngaro VM implementations.

I'm working on an updated VM model and will see if I can work out a good solution for this case once I get to the I/O part.

Sent from my iPad
--
--
--
You received this message because you are RETRO 10 discussion group.
To post to this group, send email to retr...@googlegroups.com
To unsubscribe from this group, send email to retro-10-u...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "retro-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to retro-10+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

saurus

unread,
Jun 16, 2016, 2:48:00 AM6/16/16
to retro-language, charles...@icloud.com
thanks, i'll be waiting for a new vm.
just to report:

test.rx contains:

---
&drop &putc :is
  needs dump'
&putc: devector
---

what happens is:

---

$ ./retro

Retro 11.7


ok  include test.rx 

ok  &drop 

ok  &putc 

ok  :is 

---


at this point the terminal does not accept input.


crc

unread,
Jun 20, 2016, 7:23:37 AM6/20/16
to retro-language, charles...@icloud.com
This is where it gets confusing.

    &drop &putc :is

Disables text output (globally). Input will still work, but nothing will be displayed.

    &putc :devector

Will restore text output functionality.

Retro's current I/O model doesn't provide a means of distinguishing between input sources, so we can't selectively disable echoing of input when including a file. I'll look into resolving this when I get to work on implementing I/O functionality on the new VM.

saurus

unread,
Jun 20, 2016, 7:39:25 AM6/20/16
to retro-language, charles...@icloud.com
it works.  thank you.

db0...@gmail.com

unread,
Aug 18, 2016, 8:35:31 PM8/18/16
to retro-language
You could also use hush which disables echoing of input as well as manually disabling ok: this would allow an included file to still use putc if it needs to produce output:

: nop ;      ( a no-op word )
&nop &ok :is ( make ok a no-op )
hush         ( disable echo )

And to restore echo:

echo         ( enable echo )
&ok :devector ( restore ok )

Note that there's a bug with hush described here: https://bugs.launchpad.net/retro-language/+bug/1614527 but it's easily fixed.
Reply all
Reply to author
Forward
0 new messages