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
08d8ca63
Commit
08d8ca63
authored
22 years ago
by
gerd
Browse files
Options
Downloads
Patches
Plain Diff
Generalized function names.
* code/macros.lisp (evaluate-declaration-context): Use valid-function-name-p.
parent
b570be8a
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
+41
-42
41 additions, 42 deletions
code/macros.lisp
with
41 additions
and
42 deletions
code/macros.lisp
+
41
−
42
View file @
08d8ca63
...
...
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.8
6
2003/02/0
5
11:
08:43
gerd Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.8
7
2003/02/0
8
11:
33:39
gerd Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -1646,48 +1646,47 @@
;;; matches the specified context.
;;;
(
defun
evaluate-declaration-context
(
context
name
parent
)
(
let*
((
base
(
if
(
and
(
consp
name
)
(
consp
(
cdr
name
)))
(
cadr
name
)
name
))
(
package
(
and
(
symbolp
base
)
(
symbol-package
base
))))
(
if
(
atom
context
)
(
multiple-value-bind
(
ignore
how
)
(
if
package
(
find-symbol
(
symbol-name
base
)
package
)
(
values
nil
nil
))
(
declare
(
ignore
ignore
))
(
case
context
(
:internal
(
eq
how
:internal
))
(
:external
(
eq
how
:external
))
(
:uninterned
(
and
(
symbolp
base
)
(
not
package
)))
(
:anonymous
(
not
name
))
(
:macro
(
eq
parent
'defmacro
))
(
:function
(
member
parent
'
(
defun
labels
flet
function
)))
(
:global
(
member
parent
'
(
defun
defmacro
function
)))
(
:local
(
member
parent
'
(
labels
flet
)))
(
t
(
error
"Unknown declaration context: ~S."
context
))))
(
case
(
first
context
)
(
:or
(
loop
for
x
in
(
rest
context
)
thereis
(
evaluate-declaration-context
x
name
parent
)))
(
:and
(
loop
for
x
in
(
rest
context
)
always
(
evaluate-declaration-context
x
name
parent
)))
(
:not
(
evaluate-declaration-context
(
second
context
)
name
parent
))
(
:member
(
member
name
(
rest
context
)
:test
#'
equal
))
(
:match
(
let
((
name
(
concatenate
'string
"$"
(
string
base
)
"$"
)))
(
multiple-value-bind
(
valid
base
)
(
valid-function-name-p
name
)
(
let
((
package
(
and
valid
(
symbolp
base
)
(
symbol-package
base
))))
(
if
(
atom
context
)
(
multiple-value-bind
(
ignore
how
)
(
if
package
(
find-symbol
(
symbol-name
base
)
package
)
(
values
nil
nil
))
(
declare
(
ignore
ignore
))
(
case
context
(
:internal
(
eq
how
:internal
))
(
:external
(
eq
how
:external
))
(
:uninterned
(
and
(
symbolp
base
)
(
not
package
)))
(
:anonymous
(
not
name
))
(
:macro
(
eq
parent
'defmacro
))
(
:function
(
member
parent
'
(
defun
labels
flet
function
)))
(
:global
(
member
parent
'
(
defun
defmacro
function
)))
(
:local
(
member
parent
'
(
labels
flet
)))
(
t
(
error
"Unknown declaration context: ~S."
context
))))
(
case
(
first
context
)
(
:or
(
loop
for
x
in
(
rest
context
)
thereis
(
search
(
string
x
)
name
))))
(
:package
(
and
package
(
loop
for
x
in
(
rest
context
)
thereis
(
eq
(
find-package
(
string
x
))
package
))))
(
t
(
error
"Unknown declaration context: ~S."
context
))))))
thereis
(
evaluate-declaration-context
x
name
parent
)))
(
:and
(
loop
for
x
in
(
rest
context
)
always
(
evaluate-declaration-context
x
name
parent
)))
(
:not
(
evaluate-declaration-context
(
second
context
)
name
parent
))
(
:member
(
member
name
(
rest
context
)
:test
#'
equal
))
(
:match
(
let
((
name
(
concatenate
'string
"$"
(
string
base
)
"$"
)))
(
loop
for
x
in
(
rest
context
)
thereis
(
search
(
string
x
)
name
))))
(
:package
(
and
package
(
loop
for
x
in
(
rest
context
)
thereis
(
eq
(
find-package
(
string
x
))
package
))))
(
t
(
error
"Unknown declaration context: ~S."
context
)))))))
;;; PROCESS-CONTEXT-DECLARATIONS -- Internal
...
...
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