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
b065fe95
Commit
b065fe95
authored
33 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Added DEFINE-COMPILER-MACRO.
parent
3532551c
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/macros.lisp
+35
-2
35 additions, 2 deletions
code/macros.lisp
with
35 additions
and
2 deletions
code/macros.lisp
+
35
−
2
View file @
b065fe95
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
;;;
(
ext:file-comment
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.3
2
1992/04/0
2
0
2:48:54
wlott Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.3
3
1992/04/0
4
0
1:03:36
wlott Exp $"
)
;;;
;;;
;;; **********************************************************************
;;; **********************************************************************
;;;
;;;
...
@@ -25,7 +25,8 @@
...
@@ -25,7 +25,8 @@
locally
etypecase
ctypecase
ecase
ccase
locally
etypecase
ctypecase
ecase
ccase
get-setf-method
get-setf-method-multiple-value
get-setf-method
get-setf-method-multiple-value
define-modify-macro
destructuring-bind
nth-value
define-modify-macro
destructuring-bind
nth-value
otherwise
))
; Sacred to CASE and related macros.
otherwise
; Sacred to CASE and related macros.
define-compiler-macro
))
(
in-package
"EXTENSIONS"
)
(
in-package
"EXTENSIONS"
)
(
export
'
(
do-anonymous
collect
iterate
))
(
export
'
(
do-anonymous
collect
iterate
))
...
@@ -111,6 +112,38 @@
...
@@ -111,6 +112,38 @@
(
setf
(
documentation
name
'function
)
doc
)
(
setf
(
documentation
name
'function
)
doc
)
name
)
name
)
;;;; DEFINE-COMPILER-MACRO
(
defmacro
define-compiler-macro
(
name
lambda-list
&body
body
)
"Define a compiler-macro for NAME."
(
let
((
whole
(
gensym
"WHOLE-"
))
(
environment
(
gensym
"ENV-"
)))
(
multiple-value-bind
(
body
local-decs
doc
)
(
parse-defmacro
lambda-list
whole
body
name
'define-compiler-macro
:environment
environment
)
(
let
((
def
`
(
lambda
(
,
whole
,
environment
)
,@
local-decs
(
block
,
name
,
body
))))
`
(
c::%define-compiler-macro
',name
#'
,
def
',lambda-list
,
doc
)))))
(
defun
c::%define-compiler-macro
(
name
definition
lambda-list
doc
)
(
assert
(
eval:interpreted-function-p
definition
))
(
setf
(
eval:interpreted-function-name
definition
)
(
let
((
*print-case*
:upcase
))
(
format
nil
"DEFINE-COMPILER-MACRO ~S"
name
)))
(
setf
(
eval:interpreted-function-arglist
definition
)
lambda-list
)
(
c::%%define-compiler-macro
name
definition
doc
))
;;;
(
defun
c::%%define-compiler-macro
(
name
definition
doc
)
(
setf
(
compiler-macro-function
name
)
definition
)
(
setf
(
documentation
name
'compiler-macro
)
doc
)
name
)
;;; DEFTYPE is a lot like DEFMACRO.
;;; DEFTYPE is a lot like DEFMACRO.
...
...
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