* PATCH: let .upcase and .downcase pmacros handle symbols
@ 2005-06-13 22:29 Jim Blandy
0 siblings, 0 replies; only message in thread
From: Jim Blandy @ 2005-06-13 22:29 UTC (permalink / raw)
To: cgen
This fixes another problem caused by tighter typechecking in modern
versions of Guile. I've committed it.
2005-06-13 Jim Blandy <jimb@redhat.com>
* pmacros.scm (-pmacro-upcase, -pmacro-downcase): Handle symbols
as well as strings.
Index: cgen/pmacros.scm
===================================================================
RCS file: /cvs/src/src/cgen/pmacros.scm,v
retrieving revision 1.4
diff -c -p -r1.4 pmacros.scm
*** cgen/pmacros.scm 14 Feb 2005 17:48:25 -0000 1.4
--- cgen/pmacros.scm 13 Jun 2005 22:26:06 -0000
***************
*** 424,436 ****
; .upcase - convert a string to uppercase
(define (-pmacro-upcase str)
! (string-upcase str)
)
; .downcase - convert a string to lowercase
(define (-pmacro-downcase str)
! (string-downcase str)
)
; .substring - get part of a string
--- 424,442 ----
; .upcase - convert a string to uppercase
(define (-pmacro-upcase str)
! (cond
! ((string? str) (string-upcase str))
! ((symbol? str) (string->symbol (string-upcase (symbol->string str))))
! (else (-pmacro-error "invalid argument to .upcase" str)))
)
; .downcase - convert a string to lowercase
(define (-pmacro-downcase str)
! (cond
! ((string? str) (string-downcase str))
! ((symbol? str) (string->symbol (string-downcase (symbol->string str))))
! (else (-pmacro-error "invalid argument to .downcase" str)))
)
; .substring - get part of a string
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-06-13 22:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-13 22:29 PATCH: let .upcase and .downcase pmacros handle symbols Jim Blandy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).