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