Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
e1d9e6c0
Commit
e1d9e6c0
authored
32 years ago
by
ram
Browse files
Options
Downloads
Patches
Plain Diff
Fixed dispatch macro characters to be case-insensitive, and to disallow digits
as sub-characters.
parent
7cf17727
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/reader.lisp
+20
-15
20 additions, 15 deletions
code/reader.lisp
with
20 additions
and
15 deletions
code/reader.lisp
+
20
−
15
View file @
e1d9e6c0
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/reader.lisp,v 1.1
5
1992/0
5/15 17:51:49 wlott
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/reader.lisp,v 1.1
6
1992/0
6/04 17:03:51 ram
Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -1266,14 +1266,17 @@
(
push
(
cons
char
(
make-char-dispatch-table
))
dalist
))))))
(
defun
set-dispatch-macro-character
(
disp-char
sub-char
function
&optional
(
rt
*readtable*
))
(
disp-char
sub-char
function
&optional
(
rt
*readtable*
))
"Causes function to be called whenever the reader reads
disp-char followed by sub-char. Set-dispatch-macro-character
returns T."
;;get the dispatch char for macro (error if not there), diddle
;;entry for sub-char.
(
let
((
dpair
(
find
disp-char
(
dispatch-tables
rt
)
:test
#'
char=
:key
#'
car
)))
(
when
(
digit-char-p
sub-char
)
(
error
"Sub-Char must not be a decibal digit: ~S"
sub-char
))
(
let*
((
sub-char
(
char-upcase
sub-char
))
(
dpair
(
find
disp-char
(
dispatch-tables
rt
)
:test
#'
char=
:key
#'
car
)))
(
if
dpair
(
setf
(
elt
(
the
simple-vector
(
cdr
dpair
))
(
char-code
sub-char
))
...
...
@@ -1282,14 +1285,16 @@
(
defun
get-dispatch-macro-character
(
disp-char
sub-char
&optional
rt
)
"Returns the macro character function for sub-char under disp-char
or nil if there is no associated function."
(
let*
((
rt
(
or
rt
*readtable*
))
(
dpair
(
find
disp-char
(
dispatch-tables
rt
)
:test
#'
char=
:key
#'
car
)))
(
if
dpair
(
elt
(
the
simple-vector
(
cdr
dpair
))
(
char-code
sub-char
))
(
error
"~S is not a dispatch char."
disp-char
))))
or nil if there is no associated function."
(
unless
(
digit-char-p
sub-char
)
(
let*
((
sub-char
(
char-upcase
sub-char
))
(
rt
(
or
rt
*readtable*
))
(
dpair
(
find
disp-char
(
dispatch-tables
rt
)
:test
#'
char=
:key
#'
car
)))
(
if
dpair
(
elt
(
the
simple-vector
(
cdr
dpair
))
(
char-code
sub-char
))
(
error
"~S is not a dispatch char."
disp-char
)))))
(
defun
read-dispatch-char
(
stream
char
)
;;read some digits
...
...
@@ -1304,9 +1309,9 @@
;;take care of the extra char.
(
if
(
eofp
ch
)
(
reader-eof-error
stream
"inside dispatch character"
)
(
setq
sub-char
ch
)))
(
setq
numargp
t
)
(
setq
numarg
(
+
(
*
numarg
10
)
dig
)))
(
setq
sub-char
(
ch
ar-upcase
ch
)
)))
(
setq
numargp
t
)
(
setq
numarg
(
+
(
*
numarg
10
)
dig
)))
;;look up the function and call it.
(
let
((
dpair
(
find
char
(
dispatch-tables
*readtable*
)
:test
#'
char=
:key
#'
car
)))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment