move most of the 'scheme' collection to the 'racket' collection
original commit: c95a39875453e7f057395a7bf626e5d2ed732e7e
This commit is contained in:
parent
b2b3c44aa4
commit
7b544af2a5
|
@ -1,3 +1,3 @@
|
|||
(module class mzscheme
|
||||
(require scheme/private/class-internal)
|
||||
(require racket/private/class-internal)
|
||||
(provide-public-names))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
|
@ -25,37 +25,37 @@
|
|||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; provide everything from the scheme/ implementation
|
||||
;; provide everything from the racket/ implementation
|
||||
;; except the arrow contracts
|
||||
;;
|
||||
|
||||
(require scheme/contract/private/base
|
||||
scheme/contract/private/misc
|
||||
scheme/contract/private/provide
|
||||
scheme/contract/private/guts
|
||||
scheme/contract/private/ds
|
||||
scheme/contract/private/opt
|
||||
scheme/contract/private/basic-opters)
|
||||
(require racket/contract/private/base
|
||||
racket/contract/private/misc
|
||||
racket/contract/private/provide
|
||||
racket/contract/private/guts
|
||||
racket/contract/private/ds
|
||||
racket/contract/private/opt
|
||||
racket/contract/private/basic-opters)
|
||||
|
||||
(provide
|
||||
opt/c define-opt/c ;(all-from "private/contract-opt.ss")
|
||||
(except-out (all-from-out scheme/contract/private/ds)
|
||||
(except-out (all-from-out racket/contract/private/ds)
|
||||
lazy-depth-to-look)
|
||||
|
||||
(all-from-out scheme/contract/private/base)
|
||||
(all-from-out scheme/contract/private/provide)
|
||||
(except-out (all-from-out scheme/contract/private/misc)
|
||||
(all-from-out racket/contract/private/base)
|
||||
(all-from-out racket/contract/private/provide)
|
||||
(except-out (all-from-out racket/contract/private/misc)
|
||||
check-between/c
|
||||
string-len/c
|
||||
check-unary-between/c)
|
||||
(rename-out [or/c union])
|
||||
(rename-out [string-len/c string/len])
|
||||
(except-out (all-from-out scheme/contract/private/guts)
|
||||
(except-out (all-from-out racket/contract/private/guts)
|
||||
check-flat-contract
|
||||
check-flat-named-contract))
|
||||
|
||||
|
||||
;; copied here because not provided by scheme/contract anymore
|
||||
;; copied here because not provided by racket/contract anymore
|
||||
(define (flat-contract/predicate? pred)
|
||||
(or (flat-contract? pred)
|
||||
(and (procedure? pred)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#lang mzscheme
|
||||
|
||||
(require setup/main-collects
|
||||
scheme/local
|
||||
scheme/bool
|
||||
racket/local
|
||||
racket/bool
|
||||
(only scheme/base
|
||||
build-string
|
||||
build-list
|
||||
|
|
|
@ -1,31 +1,13 @@
|
|||
#lang mzscheme
|
||||
#lang racket/base
|
||||
|
||||
;; The `first', etc. operations in this library
|
||||
;; work on pairs, not lists.
|
||||
|
||||
(require (only scheme/base
|
||||
foldl
|
||||
foldr
|
||||
|
||||
remv
|
||||
remq
|
||||
remove
|
||||
remv*
|
||||
remq*
|
||||
remove*
|
||||
|
||||
findf
|
||||
memf
|
||||
assf
|
||||
|
||||
filter
|
||||
|
||||
sort)
|
||||
(only scheme/list
|
||||
cons?
|
||||
empty?
|
||||
empty
|
||||
last-pair))
|
||||
(require (only-in scheme/list
|
||||
cons?
|
||||
empty?
|
||||
empty
|
||||
last-pair))
|
||||
|
||||
(provide first
|
||||
second
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
|
||||
(require scheme/match/legacy-match)
|
||||
(provide (all-from-out scheme/match/legacy-match))
|
||||
(require racket/match/legacy-match)
|
||||
(provide (all-from-out racket/match/legacy-match))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang scheme/base
|
||||
|
||||
(require scheme/match/match)
|
||||
(provide (all-from-out scheme/match/match))
|
||||
(require racket/match/match)
|
||||
(provide (all-from-out racket/match/match))
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
|
||||
(require (for-syntax scheme/base)
|
||||
mzlib/etc
|
||||
scheme/contract/base
|
||||
(require (for-syntax racket/base)
|
||||
racket/contract/base
|
||||
mzlib/list
|
||||
"private/port.ss")
|
||||
|
||||
|
@ -118,13 +117,13 @@
|
|||
;; 0 always (which implies that the `read' proc must not return
|
||||
;; a pipe input port).
|
||||
(define make-input-port/read-to-peek
|
||||
(opt-lambda (name read fast-peek close
|
||||
[location-proc #f]
|
||||
[count-lines!-proc void]
|
||||
[init-position 1]
|
||||
[buffer-mode-proc #f]
|
||||
[buffering? #f]
|
||||
[on-consumed #f])
|
||||
(lambda (name read fast-peek close
|
||||
[location-proc #f]
|
||||
[count-lines!-proc void]
|
||||
[init-position 1]
|
||||
[buffer-mode-proc #f]
|
||||
[buffering? #f]
|
||||
[on-consumed #f])
|
||||
(define lock-semaphore (make-semaphore 1))
|
||||
(define commit-semaphore (make-semaphore 1))
|
||||
(define-values (peeked-r peeked-w) (make-pipe))
|
||||
|
@ -440,7 +439,7 @@
|
|||
(buffer-mode-proc mode)])))))
|
||||
|
||||
(define peeking-input-port
|
||||
(opt-lambda (orig-in [name (object-name orig-in)] [delta 0])
|
||||
(lambda (orig-in [name (object-name orig-in)] [delta 0])
|
||||
(make-input-port/read-to-peek
|
||||
name
|
||||
(lambda (s)
|
||||
|
@ -452,11 +451,11 @@
|
|||
void)))
|
||||
|
||||
(define relocate-input-port
|
||||
(opt-lambda (p line col pos [close? #t])
|
||||
(lambda (p line col pos [close? #t])
|
||||
(transplant-to-relocate transplant-input-port p line col pos close?)))
|
||||
|
||||
(define transplant-input-port
|
||||
(opt-lambda (p location-proc pos [close? #t] [count-lines!-proc void])
|
||||
(lambda (p location-proc pos [close? #t] [count-lines!-proc void])
|
||||
(make-input-port
|
||||
(object-name p)
|
||||
(lambda (s)
|
||||
|
@ -486,7 +485,7 @@
|
|||
;; thread when write evts are active; otherwise, we use a lock semaphore.
|
||||
;; (Actually, the lock semaphore has to be used all the time, to guard
|
||||
;; the flag indicating whether the manager thread is running.)
|
||||
(opt-lambda ([limit (expt 2 64)] [in-name 'pipe] [out-name 'pipe])
|
||||
(lambda ([limit (expt 2 64)] [in-name 'pipe] [out-name 'pipe])
|
||||
(let-values ([(r w) (make-pipe limit)]
|
||||
[(more) null]
|
||||
[(more-last) #f]
|
||||
|
@ -724,7 +723,7 @@
|
|||
(values in out))))
|
||||
|
||||
(define input-port-append
|
||||
(opt-lambda (close-orig? . ports)
|
||||
(lambda (close-orig? . ports)
|
||||
(make-input-port
|
||||
(map object-name ports)
|
||||
(lambda (str)
|
||||
|
@ -815,7 +814,7 @@
|
|||
(loop half skip)))))))
|
||||
|
||||
(define make-limited-input-port
|
||||
(opt-lambda (port limit [close-orig? #t])
|
||||
(lambda (port limit [close-orig? #t])
|
||||
(let ([got 0])
|
||||
(make-input-port
|
||||
(object-name port)
|
||||
|
@ -1208,13 +1207,13 @@
|
|||
(loop (add1 i) (add1 j))]))))]))
|
||||
|
||||
(define reencode-input-port
|
||||
(opt-lambda (port encoding [error-bytes #f] [close? #f]
|
||||
[name (object-name port)]
|
||||
[newline-convert? #f]
|
||||
[decode-error (lambda (msg port)
|
||||
(error 'reencode-input-port
|
||||
(format "~a: ~e" msg)
|
||||
port))])
|
||||
(lambda (port encoding [error-bytes #f] [close? #f]
|
||||
[name (object-name port)]
|
||||
[newline-convert? #f]
|
||||
[decode-error (lambda (msg port)
|
||||
(error 'reencode-input-port
|
||||
(format "~a: ~e" msg)
|
||||
port))])
|
||||
(let ([c (let ([c (bytes-open-converter encoding "UTF-8")])
|
||||
(if newline-convert? (mcons c #f) c))]
|
||||
[ready-bytes (make-bytes 1024)]
|
||||
|
@ -1345,13 +1344,13 @@
|
|||
;; --------------------------------------------------
|
||||
|
||||
(define reencode-output-port
|
||||
(opt-lambda (port encoding [error-bytes #f] [close? #f]
|
||||
[name (object-name port)]
|
||||
[convert-newlines-to #f]
|
||||
[decode-error (lambda (msg port)
|
||||
(error 'reencode-input-port
|
||||
(format "~a: ~e" msg)
|
||||
port))])
|
||||
(lambda (port encoding [error-bytes #f] [close? #f]
|
||||
[name (object-name port)]
|
||||
[convert-newlines-to #f]
|
||||
[decode-error (lambda (msg port)
|
||||
(error 'reencode-input-port
|
||||
(format "~a: ~e" msg)
|
||||
port))])
|
||||
(let ([c (bytes-open-converter "UTF-8" encoding)]
|
||||
[ready-bytes (make-bytes 1024)]
|
||||
[ready-start 0]
|
||||
|
@ -1664,7 +1663,7 @@
|
|||
;; ----------------------------------------
|
||||
|
||||
(define dup-output-port
|
||||
(opt-lambda (p [close? #f])
|
||||
(lambda (p [close? #f])
|
||||
(let ([new (transplant-output-port
|
||||
p
|
||||
(lambda () (port-next-location p))
|
||||
|
@ -1677,7 +1676,7 @@
|
|||
new)))
|
||||
|
||||
(define dup-input-port
|
||||
(opt-lambda (p [close? #f])
|
||||
(lambda (p [close? #f])
|
||||
(let ([new (transplant-input-port
|
||||
p
|
||||
(lambda () (port-next-location p))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
|
||||
(provide (all-defined-out))
|
||||
(require scheme/contract/private/guts)
|
||||
(require racket/contract/private/guts)
|
||||
|
||||
(define empty-case-lambda/c
|
||||
(flat-named-contract '(case->)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
(require (for-syntax scheme/base))
|
||||
(require (for-template scheme/base)
|
||||
(for-template scheme/contract/private/guts)
|
||||
(for-template racket/contract/private/guts)
|
||||
(for-template "contract-arr-checks.ss"))
|
||||
|
||||
(provide make-/proc ->/h ->*/h ->d/h ->d*/h ->r/h
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
|
||||
(require scheme/contract/private/guts
|
||||
scheme/contract/private/opt
|
||||
(require racket/contract/private/guts
|
||||
racket/contract/private/opt
|
||||
"contract-arr-checks.ss")
|
||||
(require (for-syntax scheme/base)
|
||||
(for-syntax scheme/contract/private/opt-guts)
|
||||
(for-syntax scheme/contract/private/helpers)
|
||||
(require (for-syntax racket/base)
|
||||
(for-syntax racket/contract/private/opt-guts)
|
||||
(for-syntax racket/contract/private/helpers)
|
||||
(for-syntax "contract-arr-obj-helpers.ss")
|
||||
(for-syntax syntax/stx)
|
||||
(for-syntax syntax/name))
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
|
||||
(provide define/contract)
|
||||
|
||||
(require (for-syntax scheme/base
|
||||
(require (for-syntax racket/base
|
||||
unstable/srcloc
|
||||
(prefix-in a: scheme/contract/private/helpers))
|
||||
(only-in scheme/contract/private/base contract))
|
||||
(prefix-in a: racket/contract/private/helpers))
|
||||
(only-in racket/contract/private/base contract))
|
||||
|
||||
;; First, we have the old define/contract implementation, which
|
||||
;; is still used in mzlib/contract.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
(require "contract-arrow.ss"
|
||||
scheme/contract/private/guts
|
||||
scheme/private/class-internal
|
||||
racket/contract/private/guts
|
||||
racket/private/class-internal
|
||||
"contract-arr-checks.ss")
|
||||
|
||||
(require (for-syntax scheme/base
|
||||
scheme/contract/private/helpers
|
||||
(require (for-syntax racket/base
|
||||
racket/contract/private/helpers
|
||||
"contract-arr-obj-helpers.ss"))
|
||||
|
||||
(provide mixin-contract
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
mzlib/etc
|
||||
mzlib/list
|
||||
;; core [de]serializer:
|
||||
scheme/private/serialize)
|
||||
racket/private/serialize)
|
||||
|
||||
(provide define-serializable-struct
|
||||
define-serializable-struct/versions
|
||||
|
||||
;; core [de]serializer:
|
||||
(all-from scheme/private/serialize))
|
||||
(all-from racket/private/serialize))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; define-serializable-struct
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"private/unit-syntax.ss"))
|
||||
|
||||
(require mzlib/etc
|
||||
scheme/contract/base
|
||||
racket/contract/base
|
||||
scheme/stxparam
|
||||
unstable/location
|
||||
"private/unit-contract.ss"
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
(module old-procs '#%kernel
|
||||
(#%require "small-scheme.ss"
|
||||
"more-scheme.ss"
|
||||
"misc.ss"
|
||||
"stxmz-body.ss"
|
||||
"define.ss")
|
||||
(#%require "small-scheme.rkt"
|
||||
"more-scheme.rkt"
|
||||
"misc.rkt"
|
||||
"stxmz-body.rkt"
|
||||
"define.rkt")
|
||||
|
||||
(#%provide make-namespace
|
||||
free-identifier=?*
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
(module old-rp '#%kernel
|
||||
(#%require (for-syntax '#%kernel "stx.ss" "small-scheme.ss" "stxcase-scheme.ss"))
|
||||
(#%require (for-syntax '#%kernel "stx.rkt" "small-scheme.rkt" "stxcase-scheme.rkt"))
|
||||
|
||||
(#%provide require require-for-syntax require-for-template require-for-label
|
||||
provide provide-for-syntax provide-for-label)
|
|
@ -2,8 +2,8 @@
|
|||
;; mzscheme's `#%module-begin'
|
||||
|
||||
(module stxmz-body '#%kernel
|
||||
(#%require "stxcase-scheme.ss" "define.ss"
|
||||
(for-syntax '#%kernel "stx.ss"))
|
||||
(#%require "stxcase-scheme.rkt" "define.rkt"
|
||||
(for-syntax '#%kernel "stx.rkt"))
|
||||
|
||||
;; So that expansions print the way the MzScheme programmer expects:
|
||||
(#%require (rename '#%kernel #%plain-module-begin #%module-begin))
|
2
collects/scheme/mpair.rkt
Normal file
2
collects/scheme/mpair.rkt
Normal file
|
@ -0,0 +1,2 @@
|
|||
#lang scheme/private/provider
|
||||
racket/mpair
|
2
collects/scheme/package.rkt
Normal file
2
collects/scheme/package.rkt
Normal file
|
@ -0,0 +1,2 @@
|
|||
#lang scheme/private/provider
|
||||
racket/package
|
Loading…
Reference in New Issue
Block a user