Rename sequence' library to
stream', move from racket/base' to
racket'.
(cherry picked from commit 9e302a7106
)
This commit is contained in:
parent
8be4a76a61
commit
ddf8fadf18
|
@ -23,6 +23,7 @@
|
|||
racket/cmdline
|
||||
racket/promise
|
||||
racket/bool
|
||||
racket/stream
|
||||
racket/local
|
||||
racket/system
|
||||
(for-syntax racket/base))
|
||||
|
@ -50,6 +51,7 @@
|
|||
racket/cmdline
|
||||
racket/promise
|
||||
racket/bool
|
||||
racket/stream
|
||||
racket/local
|
||||
racket/system)
|
||||
(for-syntax (all-from-out racket/base)))
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
(module base "pre-base.rkt"
|
||||
|
||||
(#%require "sequence.rkt"
|
||||
"hash.rkt"
|
||||
|
||||
(#%require "hash.rkt"
|
||||
"list.rkt"
|
||||
"string.rkt"
|
||||
"stxcase-scheme.rkt"
|
||||
|
@ -23,7 +22,6 @@
|
|||
regexp-replace*
|
||||
new-apply-proc)
|
||||
struct
|
||||
(all-from "sequence.rkt")
|
||||
(all-from "hash.rkt")
|
||||
(all-from "list.rkt")
|
||||
(all-from-except "string.rkt"
|
||||
|
@ -43,4 +41,3 @@
|
|||
(rename -with-output-to-file with-output-to-file)
|
||||
call-with-input-file*
|
||||
call-with-output-file*))
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
(module sequence "pre-base.rkt"
|
||||
(require "list.rkt")
|
||||
(module stream "private/pre-base.rkt"
|
||||
(require "private/list.rkt")
|
||||
|
||||
(define empty-stream
|
||||
(make-do-sequence
|
|
@ -668,29 +668,34 @@ Like @scheme[assoc], but finds an element using the predicate
|
|||
@(interaction-eval #:eval list-eval
|
||||
(require racket/list (only-in racket/function negate)))
|
||||
|
||||
@defthing[empty null?]{The empty list.
|
||||
@defthing[empty null?]{
|
||||
The empty list.
|
||||
@mz-examples[#:eval list-eval
|
||||
empty
|
||||
(eq? empty null)
|
||||
]}
|
||||
|
||||
@defproc[(cons? [v any/c]) boolean?]{The same as @scheme[(pair? v)].
|
||||
@defproc[(cons? [v any/c]) boolean?]{
|
||||
The same as @scheme[(pair? v)].
|
||||
@mz-examples[#:eval list-eval
|
||||
(cons? '(1 2))
|
||||
]}
|
||||
|
||||
@defproc[(empty? [v any/c]) boolean?]{The same as @scheme[(null? v)].
|
||||
@defproc[(empty? [v any/c]) boolean?]{
|
||||
The same as @scheme[(null? v)].
|
||||
@mz-examples[#:eval list-eval
|
||||
(empty? '(1 2))
|
||||
(empty? '())
|
||||
]}
|
||||
|
||||
@defproc[(first [lst list?]) any/c]{The same as @scheme[(car lst)], but only for lists (that are not empty).
|
||||
@defproc[(first [lst list?]) any/c]{
|
||||
The same as @scheme[(car lst)], but only for lists (that are not empty).
|
||||
@mz-examples[#:eval list-eval
|
||||
(first '(1 2 3 4 5 6 7 8 9 10))
|
||||
]}
|
||||
|
||||
@defproc[(rest [lst list?]) list?]{The same as @scheme[(cdr lst)], but only for lists (that are not empty).
|
||||
@defproc[(rest [lst list?]) list?]{
|
||||
The same as @scheme[(cdr lst)], but only for lists (that are not empty).
|
||||
|
||||
@mz-examples[#:eval list-eval
|
||||
(rest '(1 2 3 4 5 6 7 8 9 10))
|
||||
|
|
|
@ -5,11 +5,6 @@
|
|||
(for-label racket/generator
|
||||
racket/mpair))
|
||||
|
||||
@(define generator-eval
|
||||
(let ([the-eval (make-base-eval)])
|
||||
(the-eval '(require racket/generator))
|
||||
the-eval))
|
||||
|
||||
@(define (info-on-seq where what)
|
||||
@margin-note{See @secref[where] for information on using @|what| as
|
||||
sequences.})
|
||||
|
@ -326,6 +321,8 @@ in the sequence.
|
|||
@; ----------------------------------------------------------------------
|
||||
@section{Additional Sequence Operations}
|
||||
|
||||
@note-lib[racket/stream]
|
||||
|
||||
@defthing[empty-stream sequence?]{
|
||||
A sequence with no elements.}
|
||||
|
||||
|
@ -441,6 +438,11 @@ in the sequence.
|
|||
@section{Iterator Generators}
|
||||
@defmodule[racket/generator]
|
||||
|
||||
@(define generator-eval
|
||||
(let ([the-eval (make-base-eval)])
|
||||
(the-eval '(require racket/generator))
|
||||
the-eval))
|
||||
|
||||
@defform[(generator () body ...)]{
|
||||
Creates a function that returns a value through @scheme[yield], each
|
||||
time it is invoked. When the generator runs out of values to yield,
|
||||
|
|
Loading…
Reference in New Issue
Block a user