From abad08e58fe242170c1dac389e64d994d410d988 Mon Sep 17 00:00:00 2001 From: jimb Date: Thu, 20 Jan 2005 22:57:10 +0000 Subject: [PATCH] * utils.scm (concat): New function. * insn.scm (-sub-insn-make!): Use concat instead of string-map. * rtl.scm (rtx-dump): Same. * semantics.scm (semantic-compile): Same. --- cgen/ChangeLog | 7 +++++++ cgen/insn.scm | 8 ++++---- cgen/rtl.scm | 10 +++++----- cgen/semantics.scm | 10 +++++----- cgen/utils.scm | 6 ++++++ 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/cgen/ChangeLog b/cgen/ChangeLog index 93e6bfb7fe..cefc38014d 100644 --- a/cgen/ChangeLog +++ b/cgen/ChangeLog @@ -1,3 +1,10 @@ +2005-01-20 Jim Blandy + + * utils.scm (concat): New function. + * insn.scm (-sub-insn-make!): Use concat instead of string-map. + * rtl.scm (rtx-dump): Same. + * semantics.scm (semantic-compile): Same. + 2004-12-16 Jim Blandy * utils-cgen.scm (parse-name): Don't assume that string-map can be diff --git a/cgen/insn.scm b/cgen/insn.scm index 4241f774a6..1cdf9191c3 100644 --- a/cgen/insn.scm +++ b/cgen/insn.scm @@ -271,10 +271,10 @@ (obj:name insn) ":" (string-map (lambda (op newval) - (string-append " " - (obj:name op) - "=" - (obj:name newval))) + (concat " " + (obj:name op) + "=" + (obj:name newval))) anyof-operands new-values) " ...\n") diff --git a/cgen/rtl.scm b/cgen/rtl.scm index 9b7d4d1cf8..77e95911ca 100644 --- a/cgen/rtl.scm +++ b/cgen/rtl.scm @@ -786,11 +786,11 @@ (define (rtx-dump rtx) (cond ((list? rtx) (map rtx-dump rtx)) - ((object? rtx) (string-append "#")) + ((object? rtx) (concat "#")) (else rtx)) ) diff --git a/cgen/semantics.scm b/cgen/semantics.scm index 4cca5fb324..784b4eabe4 100644 --- a/cgen/semantics.scm +++ b/cgen/semantics.scm @@ -798,11 +798,11 @@ sorted-outs out-op-nums) (let ((dump (lambda (op) - (string-append " " - (obj:name op) - " " - (number->string (op:num op)) - "\n")))) + (concat " " + (obj:name op) + " " + (number->string (op:num op)) + "\n")))) (logit 4 "Input operands:\n" (map dump sorted-ins) diff --git a/cgen/utils.scm b/cgen/utils.scm index 43988e6fd0..25a0f7d29c 100644 --- a/cgen/utils.scm +++ b/cgen/utils.scm @@ -85,6 +85,12 @@ (write (spaces n) port)) ) +; Concatenate all the arguments and make a string. Symbols are +; converted to strings. +(define (concat . sequences) + (define (sequence->string o) (if (symbol? o) (symbol->string o) o)) + (apply string-append (map sequence->string sequences))) + ; Often used idiom. (define (string-map fn . args) (apply string-append (apply map (cons fn args)))) -- 2.11.0