more pmatchification
authorAndy Wingo <wingo@pobox.com>
Sat, 3 May 2008 17:39:41 +0000 (19:39 +0200)
committerAndy Wingo <wingo@pobox.com>
Sat, 3 May 2008 17:39:41 +0000 (19:39 +0200)
* module/system/il/ghil.scm: No need for a match

* module/system/repl/command.scm: Pmatchify

* module/system/vm/disasm.scm: Pmatchify.

module/system/il/ghil.scm
module/system/repl/command.scm
module/system/vm/disasm.scm

index 84814bd..f287f8a 100644 (file)
@@ -21,7 +21,6 @@
 
 (define-module (system il ghil)
   :use-syntax (system base syntax)
-  :use-module (ice-9 match)
   :use-module (ice-9 regex)
   :export
   (
index c0f05b4..5e9ae1d 100644 (file)
@@ -21,6 +21,7 @@
 
 (define-module (system repl command)
   :use-syntax (system base syntax)
+  :use-module (system base pmatch)
   :use-module (system base compile)
   :use-module (system repl common)
   :use-module (system vm core)
@@ -126,7 +127,7 @@ List available meta commands.
 A command group name can be given as an optional argument.
 Without any argument, a list of help commands and command groups
 are displayed, as you have already seen ;)"
-  (match args
+  (pmatch args
     (()
      (display-group (lookup-group 'help))
      (display "Command Groups:\n\n")
@@ -140,9 +141,9 @@ are displayed, as you have already seen ;)"
      (newline)
      (display "Type `,COMMAND -h' to show documentation of each command.")
      (newline))
-    (('all)
+    ((all)
      (for-each display-group *command-table*))
-    ((? lookup-group group)
+    ((,group) (guard (lookup-group group))
      (display-group (lookup-group group)))
     (else
      (user-error "Unknown command group: ~A" (car args)))))
@@ -162,15 +163,15 @@ Show description/documentation."
 (define (option repl . args)
   "option [KEY VALUE]
 List/show/set options."
-  (match args
+  (pmatch args
     (()
      (for-each (lambda (key+val)
                 (format #t "~A\t~A\n" (car key+val) (cdr key+val)))
               repl.options))
-    ((key)
+    ((,key)
      (display (repl-option-ref repl key))
      (newline))
-    ((key val)
+    ((,key ,val)
      (repl-option-set! repl key val)
      (case key
        ((trace)
@@ -191,7 +192,7 @@ Quit this session."
 (define (module repl . args)
   "module [MODULE]
 Change modules / Show current module."
-  (match args
+  (pmatch args
     (() (puts (binding repl.env.module)))))
 
 (define (use repl . args)
index 3993008..60f2d25 100644 (file)
 ;;; Code:
 
 (define-module (system vm disasm)
+  :use-module (system base pmatch)
   :use-module (system vm core)
   :use-module (system vm conv)
   :use-module (ice-9 regex)
-  :use-module (ice-9 match)
   :use-module (ice-9 format)
   :use-module (ice-9 receive)
   :export (disassemble-objcode disassemble-program disassemble-bytecode))
@@ -71,8 +71,8 @@
     (do ((addr+code (decode) (decode)))
        ((not addr+code) (newline))
       (receive (addr code) addr+code
-       (match code
-         (('load-program x)
+       (pmatch code
+         ((load-program ,x)
           (let ((sym (gensym "")))
             (set! programs (acons sym x programs))
             (print-info addr (format #f "(load-program #~A)" sym) #f)))