public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: cgen@sources.redhat.com
Subject: PATCH: let .upcase and .downcase pmacros handle symbols
Date: Mon, 13 Jun 2005 22:29:00 -0000	[thread overview]
Message-ID: <vt2ll5devu8.fsf@zenia.home> (raw)


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

                 reply	other threads:[~2005-06-13 22:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vt2ll5devu8.fsf@zenia.home \
    --to=jimb@redhat.com \
    --cc=cgen@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).