chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: Questions about modules


From: Jack Trades
Subject: [Chicken-users] Re: Questions about modules
Date: Wed, 17 Jun 2009 20:26:25 -0400

A few more questions.  First I can't seem to get a 'list' macro to work when imported into the interpreter.

This is a small sample of my 'list' macro, if you'd like to see the rest let me know.


;; This works
(module test (list)
(import (prefix scheme s.))
(s.require-extension srfi-42)

(define-syntax list
  (syntax-rules (for in if from)
    ((list from sequence)
      (list-ec (: ii sequence) ii))))
)
(import (prefix test t.))
(t.list from "abc")
;;===> (#\a #\b #\c)


;; This fails, it seems that it doesn't override the original list function.
(import test)
(list from "abc")
;;===> Error: unbound variable: from



Also I found that condition-case seems to have the same type of errors as define-values and 'and'.  Are these bugs or am I doing something wrong?

;; This works
(module test (a)
(import scheme chicken)

(define (a x y)
  (condition-case (+ x y) ((exn) "not numbers")))
)

;; This fails
(module test (a)
(import scheme (prefix chicken c.))

(define (a x y)
  (c.condition-case (+ x y) ((c.exn) "not numbers")))
)

Warning: reference to possibly unbound identifier: exvar

Warning: reference to possibly unbound identifier: handle-exceptions

Error: module unresolved: test

        Call history:

        <syntax>                [a] (##sys#signal exvar25)
        <syntax>                [a] (and27 (##sys#structure? exvar25 (quote condition)) (##sys#slot exvar25 1))
        <syntax>                [a] (if46 (##sys#structure? exvar25 (quote condition)) (and47 (##sys#slot exvar25 1)) #f)
        <syntax>                [a] (##sys#structure? exvar25 (quote condition))
        <syntax>                [a] (quote condition)
        <syntax>                [a] (and47 (##sys#slot exvar25 1))
        <syntax>                [a] (##sys#slot exvar25 1)
        <syntax>                [a] (+ x y)     <--


Jack Trades

reply via email to

[Prev in Thread] Current Thread [Next in Thread]