Skip to content

Commit a7a0ba0

Browse files
committed
Rename qq-and-or.rkt to core-syntax.rkt; add section headers
This rename makes twofold sense. First, `qq-and-or.rkt` is already more than just what it says on the tin-- it also defines `let`, `let*`, and `letrec`. Second, as part of the effort to reduce startup time, we plan on merging more core macros into the same file; for more info about the overall effort, see racket#5406 Testing: manually reviewed `git grep qq-and-or` in this repo; the only hits are #%requires which this commit adjusts. Searched all `*.rkt` and `*.ss` files in my copy of the package archive; the hits are `stxparse-info` which appears to include a copy of a decent chunk of racket/base's implementation and is broken anyway, and one hit in TR which will need a coordinated change. Note that this requires a coordinated (backwards-compatible) change in Typed Racket which should be merged at least a couple hours before this change is merged. That's racket/typed-racket#1499
1 parent 8ec5fdf commit a7a0ba0

44 files changed

Lines changed: 130 additions & 62 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

racket/collects/racket/phase+space.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(module phase+space '#%kernel
2-
(#%require "private/qq-and-or.rkt")
2+
(#%require "private/core-syntax.rkt")
33

44
(#%provide phase?
55
space?

racket/collects/racket/private/case.rkt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
;; [http://scheme2006.cs.uchicago.edu/07-clinger.pdf]
44

55
(module case '#%kernel
6-
(#%require '#%paramz '#%unsafe "qq-and-or.rkt" "cond.rkt" "define.rkt" "fixnum.rkt"
7-
(for-syntax '#%kernel "define-et-al.rkt" "qq-and-or.rkt" "cond.rkt"
6+
(#%require '#%paramz '#%unsafe "core-syntax.rkt" "cond.rkt" "define.rkt" "fixnum.rkt"
7+
(for-syntax '#%kernel "define-et-al.rkt" "core-syntax.rkt" "cond.rkt"
88
"stxcase-scheme.rkt"
99
"qqstx.rkt" "define.rkt" "sort.rkt" "fixnum.rkt"
1010
"stx.rkt"))

racket/collects/racket/private/collect.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(module collect '#%kernel
2-
(#%require "qq-and-or.rkt"
2+
(#%require "core-syntax.rkt"
33
"path.rkt"
44
"kw.rkt"
55
(prefix k: '#%kernel))

racket/collects/racket/private/cond.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; cond
44

55
(module cond '#%kernel
6-
(#%require (for-syntax '#%kernel "stx.rkt" "qq-and-or.rkt"))
6+
(#%require (for-syntax '#%kernel "stx.rkt" "core-syntax.rkt"))
77

88
(define-syntaxes (=>)
99
(lambda (stx)

racket/collects/racket/private/config.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(module config '#%kernel
22
(#%require '#%paramz ; for cache-configuration
33
"cond.rkt"
4-
"qq-and-or.rkt"
4+
"core-syntax.rkt"
55
"executable-path.rkt")
66

77
(#%provide find-main-collects

racket/collects/racket/private/qq-and-or.rkt renamed to racket/collects/racket/private/core-syntax.rkt

Lines changed: 74 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,39 @@
1+
(module core-syntax '#%kernel
12

2-
;;----------------------------------------------------------------------
3-
;; quasiquote, and, or
3+
; ======================================================================
4+
; Many of the base syntactic forms of Racket-- things like `and`, `let`,
5+
; and `cond`. These are written together in a single module for startup
6+
; time reasons, and this module forms a nice base for defining the rest
7+
; of `#lang racket/base`.
8+
; ======================================================================
9+
;
410

5-
(module qq-and-or '#%kernel
611
(#%require (for-syntax "stx.rkt" '#%kernel))
12+
13+
(#%provide let*-values
14+
let let* letrec
15+
quasiquote
16+
and or)
17+
18+
; --------------------------------------------------
19+
;
20+
;
21+
; ;;; ;;;;
22+
; ; ; ;
23+
; ; ; ;
24+
; ; ;;; ; ; ;; ; ;;; ; ;; ;; ;;;;
25+
; ; ; ; ;;;;;; ;;;;;; ; ; ;; ; ;; ;; ; ; ;
26+
; ; ; ; ; ; ; ; ; ; ; ; ; ;
27+
; ; ;;;;;; ; ; ; ; ; ; ; ; ;;
28+
; ; ; ; ; ; ; ; ; ; ; ;;
29+
; ; ; ; ; ; ; ; ; ; ; ;
30+
; ; ; ; ; ; ; ; ; ; ; ; ;
31+
; ;;; ;;;; ;;; ; ;; ; ; ; ; ;;;;
32+
;
33+
;
34+
; let, let*, letrec, let-values, let-syntax, ...
35+
;
36+
737

838
(define-syntaxes (let*-values let let* letrec)
939
(let-values ([(lambda-stx) (quote-syntax lambda-stx)]
@@ -194,6 +224,25 @@
194224
(lambda (stx) (go stx #f #t (quote-syntax let*-values)))
195225
(lambda (stx) (go stx #f #f (quote-syntax letrec-values)))))))
196226

227+
; --------------------------------------------------
228+
;
229+
;
230+
; ;;;; ;;;;
231+
; ; ; ; ;
232+
; ; ; ; ;
233+
; ; ; ; ;
234+
; ; ; ; ;
235+
; ; ; ; ;
236+
; ; ;; ; ;;
237+
; ;;; ; ;;; ;
238+
; ; ;
239+
; ; ;
240+
; ; ;
241+
;
242+
;
243+
; quasiquote
244+
;
245+
197246
(define-values (qq-append)
198247
(lambda (a b)
199248
(if (list? a)
@@ -439,6 +488,25 @@
439488
form)
440489
in-form)))))
441490

491+
; --------------------------------------------------
492+
;
493+
;
494+
; ; ;
495+
; ; ;
496+
; ; ;
497+
; ;;;; ; ;;; ;;;; ; ;; ; ;;;
498+
; ; ; ;; ; ; ; ; ; ; ;; ;
499+
; ; ; ; ; ; ; ; ; ; ; ;
500+
; ; ; ; ; ; ; ; ; ; ;
501+
; ; ; ; ; ; ; ; ; ; ;
502+
; ; ; ; ; ; ; ; ; ; ;
503+
; ; ;; ; ; ; ;; ; ; ; ;
504+
; ;;; ; ; ; ;;; ; ; ;; ;
505+
;
506+
;
507+
; `and` and `or`
508+
;
509+
442510
(define-syntaxes (and)
443511
(let-values ([(here) (quote-syntax here)])
444512
(lambda (x)
@@ -501,6 +569,6 @@
501569
"bad syntax"
502570
x))))))))
503571

504-
(#%provide let*-values
505-
let let* letrec
506-
quasiquote and or))
572+
;
573+
; --------------------------------------------------
574+
)

racket/collects/racket/private/define-et-al.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; -define, when, unless, let/ec, define-struct
44

55
(module define-et-al '#%kernel
6-
(#%require (for-syntax '#%kernel "stx.rkt" "qq-and-or.rkt"
6+
(#%require (for-syntax '#%kernel "stx.rkt" "core-syntax.rkt"
77
"cond.rkt"))
88

99
(#%provide -define -define-syntax

racket/collects/racket/private/define-struct.rkt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
;; (planet "struct.ss" ("ryanc" "macros.plt" 1 0)))
33

44
(module define-struct '#%kernel
5-
(#%require "define-et-al.rkt" "qq-and-or.rkt" "define.rkt" "../stxparam.rkt"
5+
(#%require "define-et-al.rkt" "core-syntax.rkt" "define.rkt" "../stxparam.rkt"
66
"generic-methods.rkt"
77
(for-syntax '#%kernel "define.rkt"
88
"procedure-alias.rkt"
9-
"stx.rkt" "stxcase-scheme.rkt" "qq-and-or.rkt" "cond.rkt"
9+
"stx.rkt" "stxcase-scheme.rkt" "core-syntax.rkt" "cond.rkt"
1010
"define-et-al.rkt"
1111
"stxloc.rkt" "qqstx.rkt"
1212
"struct-info.rkt"

racket/collects/racket/private/executable-path.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(module path-list '#%kernel
2-
(#%require "qq-and-or.rkt"
2+
(#%require "core-syntax.rkt"
33
"cond.rkt"
44
"define-et-al.rkt"
55
"path.rkt"

racket/collects/racket/private/for.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"qqstx.rkt"
1515
"define.rkt"
1616
"fixnum.rkt"
17-
"define-et-al.rkt" "qq-and-or.rkt" "cond.rkt"
17+
"define-et-al.rkt" "core-syntax.rkt" "cond.rkt"
1818
"stxcase-scheme.rkt"
1919
"more-scheme.rkt"))
2020

0 commit comments

Comments
 (0)