I am no R6RS expert (so I might have missed something),
but I believe there are two issues:

    - there is no repl specified in r6rs (only top level programs)
      (implementation can of course provide a repl, but they don't have to)

    - the function  sort  is supposed to be unbound
      (the sorting functions in r6rs are called list-sort, vector-sort,
and, vector-sort!)

Since your program works in the other implementations, I am guessing that
they offer  sort   as an alias for list-sort.

/Jens Axel



2016-04-02 8:29 GMT+02:00 Damien Mattei <damien.mat...@gmail.com>:

> 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.
>



-- 
-- 
Jens Axel Søgaard

-- 
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.

Reply via email to