This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
PATCH: let .upcase and .downcase pmacros handle symbols
- From: Jim Blandy <jimb at redhat dot com>
- To: cgen at sources dot redhat dot com
- Date: 13 Jun 2005 17:27:27 -0500
- Subject: PATCH: let .upcase and .downcase pmacros handle symbols
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