Hi, i have a code that works well in #lang racket and also with other scheme compilers with minor changes,Bigloo,MIT scheme, but it does not work with #!r6rs i do not know why,here it is (some extract):
#!r6rs (import (rnrs)) ... ;; sort operands in a logic expression ;; (sort-arguments-in-operation '(or Ci a b)) -> '(or a b Ci) ;; (sort-arguments-in-operation '(or Ci (not a) b)) -> '(or (not a) b Ci) ;; (sort-arguments-in-operation '(or Ci (not a) b (or c d))) -> '(or (not a) b (or c d) Ci) (define (sort-arguments-in-operation expr) (if (isOR-AND? expr) (let* ((args-list (args expr)) ;;'(or Ci a b) -> '(Ci a b) (expression->string (lambda (expr2) (cond ((symbol? expr2) (symbol->string expr2)) ;; #t -> "T", #f -> "F" ((boolean? expr2) (if expr2 "T" "F")) (else (error "sort-arguments-in-operation: do not know how to handle this expression" expr2))))) (lower-litteral-symbol (lambda (s) (string-downcase (expression->string (get-first-litteral s))))) ;; 'Ci -> "ci", '(not A) -> "a" (expression<? (lambda (x y) (string<? (lower-litteral-symbol x) (lower-litteral-symbol y)))) ;;(sorted-args (sort args-list #:key lower-litteral-symbol string<?)) ;; symbol<?)) ;; '(Ci a b) -> '(a b Ci) (sorted-args (sort args-list expression<?)) (oper (operator expr))) ;; define operator : (or Ci a b) -> or (cons oper sorted-args)) expr)) ;; we have not a binary operator but a litteral or negation of litteral ... Bienvenue dans DrRacket, version 6.1.1 [3m]. Langage: r6rs [personnalisé]; memory limit: 256 MB. . sort: unbound identifier in module in: sort Interactions disabled: r6rs does not support a REPL (no #%top-interaction) sort seems unbound, also eval !!! and i suppose a lot more making the basis of scheme language.... problem is not with the code,i know it works but question is "what is the good way to use r6rs compatibility with DrRacket?" regards, damien -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.