Revert "Hook XREPL into a few places where readline' and enter!' are mentioned."

This reverts commit 3223a656a6.
This commit is contained in:
Eli Barzilay 2011-07-19 17:01:27 -04:00
parent c7bf34d387
commit ccd9ab07a7
3 changed files with 31 additions and 70 deletions

View File

@ -38,9 +38,8 @@ with a @litchar{> } prompt:
> >
} }
@margin-note{For enhancing your @tech{REPL} experience, see @margin-note{For information on GNU Readline support, see
@racketmodname[xrepl]; for information on GNU Readline support, see @racketmodname[readline].}
@racketmodname[readline].}
To initialize the @tech{REPL}'s environment, @exec{racket} first To initialize the @tech{REPL}'s environment, @exec{racket} first
requires the @racketmodname[racket/init] module, which provides all of requires the @racketmodname[racket/init] module, which provides all of

View File

@ -1,6 +1,5 @@
#lang scribble/doc #lang scribble/doc
@(require scribble/manual scribble/eval scribble/bnf "guide-utils.rkt" @(require scribble/manual scribble/eval scribble/bnf "guide-utils.rkt"
(only-in scribble/core link-element)
(for-label racket/enter)) (for-label racket/enter))
@(define piece-eval (make-base-eval)) @(define piece-eval (make-base-eval))
@ -135,9 +134,6 @@ the above text in a file using your favorite editor. If you save it as
@filepath{extract.rkt}, then after starting @exec{racket} in the same @filepath{extract.rkt}, then after starting @exec{racket} in the same
directory, you'd evaluate the following sequence: directory, you'd evaluate the following sequence:
@margin-note{If you use @racketmodname[xrepl], you can use
@(link-element "plainlink" (litchar ",enter extract.rkt") `(xrepl "enter")).}
@interaction[ @interaction[
#:eval piece-eval #:eval piece-eval
(eval:alts (enter! "extract.rkt") (void)) (eval:alts (enter! "extract.rkt") (void))

View File

@ -2,58 +2,43 @@
@(require scribble/manual @(require scribble/manual
scribble/urls scribble/urls
scribble/eval scribble/eval
(only-in scribble/core link-element)
"../quick/keep.rkt" "../quick/keep.rkt"
(for-label scheme (for-label scheme
racket/enter racket/enter
xrepl
readline readline
net/url net/url
xml xml
racket/control)) racket/control))
@(begin @(define quick @other-manual['(lib "quick.scrbl" "scribblings/quick")])
@(define guide @other-manual['(lib "guide.scrbl" "scribblings/guide")])
(define quick @other-manual['(lib "quick.scrbl" "scribblings/quick")]) @(define more-eval (make-base-eval))
(define guide @other-manual['(lib "guide.scrbl" "scribblings/guide")]) @(interaction-eval #:eval more-eval
(define (show-load re?)
(fprintf (current-error-port) " [~aloading serve.rkt]\n" (if re? "re-" ""))))
@(interaction-eval #:eval more-eval
(define (serve n) void))
@(interaction-eval #:eval more-eval
(define (show-break)
(fprintf (current-error-port) "^Cuser break")))
@(interaction-eval #:eval more-eval
(define (show-fail n)
(error 'tcp-listen
"listen on ~a failed (address already in use)"
n)))
@(interaction-eval #:eval more-eval (require xml net/url))
(define more-eval (make-base-eval)) @(define (whole-prog which [last? #f])
(interaction-eval #:eval more-eval
(define (show-load re?)
(fprintf (current-error-port)
" [~aloading serve.rkt]\n" (if re? "re-" ""))))
(interaction-eval #:eval more-eval
(define (serve n) void))
(interaction-eval #:eval more-eval
(define (show-break)
(fprintf (current-error-port) "^Cuser break")))
(interaction-eval #:eval more-eval
(define (show-fail n)
(error 'tcp-listen
"listen on ~a failed (address already in use)"
n)))
(interaction-eval #:eval more-eval (require xml net/url))
(define (whole-prog which [last? #f])
(let ([file (format "step~a.txt" which)]) (let ([file (format "step~a.txt" which)])
(margin-note (keep-file file) (margin-note (keep-file file)
"Here's the " "Here's the "
(if last? (if last?
"final program" "final program"
"whole program so far") "whole program so far")
" in plain text: " " in plain text: "
(link file "step " which) "."))) (link file "step " which) ".")))
(define-syntax-rule (REQ m) @racket[(require @#,racketmodname[m])])
(define (xreplcmd name . args)
(define namestr (format ",~a" name))
(define content
(litchar (if (null? args) namestr (apply string-append namestr " " args))))
(link-element "plainlink" content `(xrepl ,(format "~a" name))))
)
@title{More: Systems Programming with Racket} @title{More: Systems Programming with Racket}
@author["Matthew Flatt"] @author["Matthew Flatt"]
@ -94,36 +79,20 @@ start @exec{racket} with no command-line arguments:
> >
} }
To get a richer read-eval-print-loop, evaluate @REQ[xrepl]. You will If you're using a plain terminal, if you have GNU Readline installed
get Readline-based input if you have GNU Readline installed on your on your system, and if you'd like Readline support in @exec{racket},
system, and a useful set of meta-commands to support exploration and then evaluate @racket[(require readline)]. If you also evaluate
development. @racket[(install-readline!)], then your @filepath{~/.racketrc} is
updated to load Readline whenever you start @exec{racket} for
@interaction[ interactive evaluation. Readline is not needed if you're running a
(eval:alts @#,REQ[xrepl] (void)) shell inside Emacs or if you're on Windows and use a @exec{cmd}
] window.
To get this as a default, use the @xreplcmd{install!} command---your
@filepath{~/.racketrc} will be updated to load @racketmodname[xrepl]
whenever you start @exec{racket} for interactive evaluation.
@margin-note{Unfortunately, for legal reasons related to GPL vs. LGPL, @margin-note{Unfortunately, for legal reasons related to GPL vs. LGPL,
@exec{racket} cannot provide @racketmodname[xrepl] or Readline @exec{racket} cannot provide Readline automatically.}
automatically.}
@; FIXME: probably needs revisions, and questionable whether readline
@; should be mentioned by itself. One thing to consider is that with
@; readline it's possible to pretend that the whole thing is one
@; session, whereas xrepl changes the prompt.
If you want @emph{just} readline support in @exec{racket}, evaluate
@REQ[readline]. To install this in your @filepath{~/.racketrc},
evaluate @racket[(install-readline!)]. Readline is not needed if you're
using @racketmodname[xrepl], if you're running a shell inside Emacs, or
if you're on Windows and use a @exec{cmd} window.
@interaction[ @interaction[
(eval:alts @#,REQ[readline] (void)) (eval:alts (require readline) (void))
(eval:alts (install-readline!) (void)) (eval:alts (install-readline!) (void))
] ]
@ -147,9 +116,6 @@ racket
Back in @exec{racket}, try loading the file and running @racket[go]: Back in @exec{racket}, try loading the file and running @racket[go]:
@margin-note{If you use @racketmodname[xrepl], you can use
@xreplcmd["enter"]{serve.rkt}.}
@interaction[ @interaction[
#:eval more-eval #:eval more-eval
(eval:alts (enter! "serve.rkt") (show-load #f)) (eval:alts (enter! "serve.rkt") (show-load #f))