Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
alexandria
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Momchil Ivanov
alexandria
Commits
e22dcde8
Commit
e22dcde8
authored
Jan 26, 2013
by
Nikodemus Siivola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FORMAT-SYMBOL now uses WITH-STANDARD-IO-SYNTAX
parent
7fc0d5c0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
symbols.lisp
symbols.lisp
+10
-6
tests.lisp
tests.lisp
+18
-0
No files found.
symbols.lisp
View file @
e22dcde8
...
...
@@ -21,12 +21,16 @@ Example:
(
declaim
(
inline
format-symbol
))
(
defun
format-symbol
(
package
control
&rest
arguments
)
"Constructs a string by applying ARGUMENTS to string designator
CONTROL as if by FORMAT, and then creates a symbol named by that
string. If PACKAGE is NIL, returns an uninterned symbol, if package is
T, returns a symbol interned in the current package, and otherwise
returns a symbol interned in the package designated by PACKAGE."
(
maybe-intern
(
apply
#'
format
nil
(
string
control
)
arguments
)
package
))
"Constructs a string by applying ARGUMENTS to string designator CONTROL as
if by FORMAT within WITH-STANDARD-IO-SYNTAX, and then creates a symbol named
by that string.
If PACKAGE is NIL, returns an uninterned symbol, if package is T, returns a
symbol interned in the current package, and otherwise returns a symbol
interned in the package designated by PACKAGE."
(
maybe-intern
(
with-standard-io-syntax
(
apply
#'
format
nil
(
string
control
)
arguments
))
package
))
(
defun
make-keyword
(
name
)
"Interns the string designated by NAME in the KEYWORD package."
...
...
tests.lisp
View file @
e22dcde8
...
...
@@ -1862,3 +1862,21 @@
(
starts-with-subseq
"foo"
"xfoop"
:start2
1
)
t
nil
)
(
deftest
format-symbol.print-case-bound
(
let
((
upper
(
intern
"FOO-BAR"
))
(
lower
(
intern
"foo-bar"
))
(
*print-escape*
nil
))
(
values
(
let
((
*print-case*
:downcase
))
(
and
(
eq
upper
(
format-symbol
t
"~A"
upper
))
(
eq
lower
(
format-symbol
t
"~A"
lower
))))
(
let
((
*print-case*
:upcase
))
(
and
(
eq
upper
(
format-symbol
t
"~A"
upper
))
(
eq
lower
(
format-symbol
t
"~A"
lower
))))
(
let
((
*print-case*
:capitalize
))
(
and
(
eq
upper
(
format-symbol
t
"~A"
upper
))
(
eq
lower
(
format-symbol
t
"~A"
lower
))))))
t
t
t
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment