Search code examples
read-eval-print-looprebolrebol3

How to start the Rebol REPL in a context besides the System context?


If you run a script in Rebol and say something like print {Hello}, you end up calling the system version of PRINT

>> bind? 'print
== make object! [
    system: make object! [
        product: 'core
        version: 2.101.0.2.5
        build: 22-Jan-2013/2:44:29
        platform: [
            Macintosh osx-x86
        ]
        license: {Copyright 2012 REB....

Let's say I had a script %repl-context.r and it defined a context where PRINT did something else. Is there a way to ask the REPL to interactively run within that context, for several consecutive commands...?


Solution

  • There is a common repl console wrapper around to handle I/o redirects for StdIn StdOut.

    I often use rlwrap from http://utopia.knoware.nl/~hlub/rlwrap/#rlwrap

    It uses GNU readline lib