Changeset 14362 for trunk/source/level-1


Ignore:
Timestamp:
Oct 13, 2010, 11:47:19 PM (9 years ago)
Author:
gb
Message:

Define standard I/O variables with DEF-STANDARD-INITIAL-BINDING; remove
redundant DEF-STANDARD-INITIAL-BINDING forms for these variables from
ccl:level-1;l1-boot.lisp. (Move some reader var definitions from l1-init.lisp
to l1-reader.lisp.) The effect of this change is that these variables
will be bound per-thread to integer/boolean constants, not to shared values
(that may or may not have preserved their initial values as of the time that
a thread is created.)

Define a macro - WITH-STANDARD-INITIAL-BINDINGS - and use it to ensure
that the initial thread runs the housekeeping loop (in the TTY lisp) and
the Cocoa event loop (in the IDE) with dynamic bindings in effect.

Location:
trunk/source/level-1
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-application.lisp

    r13067 r14362  
    298298             :class 'tty-listener
    299299             :process initial-listener-process))))
    300   (%set-toplevel #'housekeeping-loop)
     300  (%set-toplevel (lambda ()
     301                   (with-standard-initial-bindings
     302                       (housekeeping-loop))))
    301303  (toplevel))
    302304
  • trunk/source/level-1/l1-boot-2.lisp

    r14288 r14362  
    176176
    177177;;; Things bound by WITH-STANDARD-IO-SYNTAX (and not otherwise thread-local)
    178 (def-standard-initial-binding *print-array*)
    179 (def-standard-initial-binding *print-base*)
    180 (def-standard-initial-binding *print-case*)
    181 (def-standard-initial-binding *print-circle*)
    182 (def-standard-initial-binding *print-escape*)
    183 (def-standard-initial-binding *print-gensym*)
    184 (def-standard-initial-binding *print-length*)
    185 (def-standard-initial-binding *print-level*)
    186 (def-standard-initial-binding *print-lines*)
    187 (def-standard-initial-binding *print-miser-width*)
    188 (def-standard-initial-binding *print-pprint-dispatch*)
    189 (def-standard-initial-binding *print-pretty*)
    190 (def-standard-initial-binding *print-radix*)
    191 (def-standard-initial-binding *print-readably*)
    192 (def-standard-initial-binding *print-right-margin*)
    193178(def-standard-initial-binding *read-base*)
    194179(def-standard-initial-binding *read-default-float-format*)
    195180(def-standard-initial-binding *read-eval*)
    196181(def-standard-initial-binding *read-suppress*)
    197 ;;; ccl extensions (see l1-io.lisp)
    198 (def-standard-initial-binding *print-abbreviate-quote*)
    199 (def-standard-initial-binding *print-structure*)
    200 (def-standard-initial-binding *print-simple-vector*)
    201 (def-standard-initial-binding *print-simple-bit-vector*)
    202 (def-standard-initial-binding *print-string-length*)
     182
    203183
    204184
  • trunk/source/level-1/l1-init.lisp

    r13529 r14362  
    174174(defparameter %toplevel-catch% ':toplevel)
    175175
    176 (defvar *read-default-float-format* 'single-float)
    177 
    178 (defvar *read-suppress* nil
    179   "Suppress most interpreting in the reader when T.")
    180 
    181 (defvar *read-base* 10.
    182   "the radix that Lisp reads numbers in")
    183176
    184177
  • trunk/source/level-1/l1-io.lisp

    r14119 r14362  
    144144
    145145;; coral extensions
    146 (defvar *print-abbreviate-quote* t
     146(def-standard-initial-binding *print-abbreviate-quote* t
    147147  "Non-NIL means that the normal lisp printer --
    148148not just the pretty-printer -- should print
     
    150150This variable is not part of standard Common Lisp.")
    151151
    152 (defvar *print-structure* t
     152(def-standard-initial-binding *print-structure* t
    153153  "Non-NIL means that lisp structures should be printed using
    154154\"#S(...)\" syntax.  if nil, structures are printed using \"#<...>\".
     
    156156
    157157;; things Richard Mlynarik likes.
    158 (defvar *print-simple-vector* nil
     158(def-standard-initial-binding *print-simple-vector* nil
    159159  "Non-NIL means that simple-vectors whose length is less than
    160160the value of this variable are printed even if *PRINT-ARRAY* is false.
    161161this variable is not part of standard Common Lisp.")
    162162
    163 (defvar *print-simple-bit-vector* nil
     163(def-standard-initial-binding *print-simple-bit-vector* nil
    164164  "Non-NIL means that simple-bit-vectors whose length is less than
    165165the value of this variable are printed even if *PRINT-ARRAY* is false.
    166166This variable is not part of standard Common Lisp.")
    167167
    168 (defvar *print-string-length* nil
     168(def-standard-initial-binding *print-string-length* nil
    169169  "Non-NIL means that strings longer than this are printed
    170170using abbreviated #<string ...> syntax.
    171171This variable is not part of standard Common Lisp.")
    172172
    173 (defvar *print-escape* t
     173(def-standard-initial-binding *print-escape* t
    174174  "Non-NIL means that the lisp printer should -attempt- to output
    175175expressions `readably.'  When NIL the attempts to produce output
     
    177177are represented by the characters of their namestring.)")
    178178
    179 (defvar *print-pretty* nil
     179(def-standard-initial-binding *print-pretty* nil
    180180  "Non-NIL means that the lisp printer should insert extra
    181181indentation and newlines to make output more readable and `prettier.'")
    182182
    183 (defvar *print-base* 10.
     183(def-standard-initial-binding *print-base* 10.
    184184  "The output base for integers and rationals.
    185185Must be an integer between 2 and 36.")
    186186
    187 (defvar *print-radix* nil
     187(def-standard-initial-binding *print-radix* nil
    188188  "Non-NIL means that the lisp printer will explicitly indicate
    189189the output radix (see *PRINT-BASE*) which is used to print
    190190integers and rational numbers.")
    191191
    192 (defvar *print-level* nil
     192(def-standard-initial-binding *print-level* nil
    193193  "Specifies the depth at which printing of lisp expressions
    194194should be truncated.  NIL means that no such truncation should occur.
     
    197197See also *PRINT-LENGTH*")
    198198
    199 (defvar *print-length* nil
     199(def-standard-initial-binding *print-length* nil
    200200  "Specifies the length at which printing of lisp expressions
    201201should be truncated.  NIL means that no such truncation should occur.
     
    204204See also *PRINT-LEVEL*")
    205205
    206 (defvar *print-circle* nil
     206(def-standard-initial-binding *print-circle* nil
    207207  "Non-NIL means that the lisp printer should attempt to detect
    208208circular structures, indicating them by using \"#n=\" and \"#n#\" syntax.
     
    210210output circular structure may cause unbounded output.")
    211211
    212 (defvar *print-case* ':upcase
     212(def-standard-initial-binding *print-case* ':upcase
    213213  "Specifies the alphabetic case in which symbols should
    214214be printed.  Possible values include :UPCASE, :DOWNCASE and :CAPITALIZE") ; and :StuDLy
    215215
    216 (defvar *print-array* t
     216(def-standard-initial-binding *print-array* t
    217217  "Non-NIL means that arrays should be printed using \"#(...)\" or
    218218\"=#nA(...)\" syntax to show their contents.
     
    221221and *PRINT-SIMPLE-BIT-VECTOR*")
    222222
    223 (defvar *print-gensym* t
     223(def-standard-initial-binding *print-gensym* t
    224224  "Non-NIL means that symbols with no home package should be
    225225printed using \"#:\" syntax.  NIL means no prefix is printed.")
    226226
    227 (defvar *print-readably* nil
     227(def-standard-initial-binding *print-readably* nil
    228228  "Non-NIL means that attempts to print unreadable objects
    229229   signal PRINT-NOT-READABLE errors.  NIL doesn't.")
    230230
    231 (defvar *PRINT-RIGHT-MARGIN* nil
     231(def-standard-initial-binding *PRINT-RIGHT-MARGIN* nil
    232232  "+#/NIL the right margin for pretty printing")
    233233
    234 (defvar *PRINT-MISER-WIDTH* 40.
     234(def-standard-initial-binding *PRINT-MISER-WIDTH* 40.
    235235  "+#/NIL miser format starts when there is less than this width left")
    236236
    237 (defvar *PRINT-LINES* nil
     237(def-standard-initial-binding *PRINT-LINES* nil
    238238  "+#/NIL truncates printing after # lines")
    239239
    240 (defvar *DEFAULT-RIGHT-MARGIN* 70
     240(def-standard-initial-binding *DEFAULT-RIGHT-MARGIN* 70
    241241  "Controls default line length;  Must be a non-negative integer")
    242242
    243 (defvar *PRINT-PPRINT-DISPATCH* nil) ; We have to support this.
     243(def-standard-initial-binding *PRINT-PPRINT-DISPATCH* nil) ; We have to support this.
    244244
    245245(defvar *xp-current-object* nil)  ; from xp
  • trunk/source/level-1/l1-processes.lisp

    r14154 r14362  
    371371          (let* ((*current-process* process))
    372372            (add-to-all-processes process)
    373             (multiple-value-bind (syms values)
    374                 (initial-bindings (process-initial-bindings process))
    375               (progv syms values
    376                 (setq *whostate* "Active")
    377                 (run-process-initial-form process initial-form)))))
     373            (with-initial-bindings (process-initial-bindings process)
     374              (setq *whostate* "Active")
     375              (run-process-initial-form process initial-form))))
    378376      process
    379377      initial-form)
  • trunk/source/level-1/l1-reader.lisp

    r13978 r14362  
    21832183;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    21842184
    2185 (defvar *read-eval* t "When nil, #. signals an error.")
     2185(def-standard-initial-binding *read-eval* t "When nil, #. signals an error.")
     2186(def-standard-initial-binding *read-default-float-format* 'single-float)
     2187
     2188(def-standard-initial-binding *read-suppress* nil
     2189  "Suppress most interpreting in the reader when T.")
     2190
     2191(def-standard-initial-binding *read-base* 10.
     2192  "the radix that Lisp reads numbers in")
     2193
    21862194(defvar %read-objects% nil)
    21872195(defvar %keep-whitespace% nil)
Note: See TracChangeset for help on using the changeset viewer.