chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] newbie to chicken - Error: unbound variable: export


From: Basile STARYNKEVITCH
Subject: [Chicken-users] newbie to chicken - Error: unbound variable: export
Date: Tue, 09 Dec 2008 08:32:51 +0100
User-agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018)

Hello All,

I am a newbie to Chicken (but I do know a bit Ocaml & Scheme & Linux; I am not very familiar with Chicken's unit system), and I want to play with metaprogramming a sort of web application. So I want to make a program which at run time is able to generate Chicken code and load it. This part is covered by http://lists.gnu.org/archive/html/chicken-users/2008-11/msg00082.html
I am coding on a Debian/Sid/AMD64 machine. Chicken is
Version 3.2.7 - linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables applyhook hostpcre ]
compiled 2008-08-21 on debian (Linux)

I ggogled on "chicken Error: unbound variable: export"
but http://www.mail-archive.com/address@hidden/msg03567.html did not help enough.

So far I just coded

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; file chickbark.scm

(use chicken utils data-structures
    args
    scgi
    http-client
    http-utils
    http-server
    html-form
    srfi-38                            ;facility for shared value I/O
    )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; compile a Scheme file and load it
;;; from http://lists.gnu.org/archive/html/chicken-users/2008-11/msg00082.html
(define compile-file
 ;; (let* ((binpath
 ;;         (or (and-let* ((p (getenv "CHICKEN_PREFIX")))
 ;;                    (make-pathname p "bin") )
 ;;             (foreign-value "C_INSTALL_BIN_HOME" c-string) ) )
 ;;                                    ; ugly, we need another way
 ;;        (csc (make-pathname binpath "csc")))
 (lambda (filename . opts)
   (let ((tmp (create-temporary-file "so")))
     (system*
      "csc -s '~a' -o '~a' ~a"
      filename tmp
      (string-intersperse opts " "))
     (on-exit
      (lambda ()
        (system (sprintf "rm -f '~a'" tmp))))
     (load tmp) ) ) )
; )

(export compile-file)

(define nbjobs 2)

;;; our program options
(define progopts
 (list
  ;; -j 2 for number of jobs
  (args:make-option
   (j jobs)
   #:required
   "number of concurrent threads [>=2 & <8]"
   (let ( (n (string->number arg)) )
     (set! nbjobs (if (< n 2) 2 (if (> n 8) 8 n))))
   )
  ;; -h for the help
  (args:make-option
   (h help)
   #:none
   "Display this text"
   (usage)
   )
  )
)

(define (usage)
(with-output-to-port (current-error-port)
  (lambda ()
    (print "Usage: " (car (argv)) " [options...] [files...]")
    (newline)
    (print (args:usage opts))
    (print "Report bugs to address@hidden")))
(exit 1))

;; eof $Id: chickbark.scm 44 2008-12-09 07:25:54Z basile018 $

;;;;;;;;;;;


I am compiling with


csc  -d1 -O1 -C -O2 -C -g -L -rdynamic -v chickbark.scm -o chickbark

but at run time I'm getting
% ./chickbark
Error: unbound variable: export

What I am doing wrong?

Regards.

--
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***





reply via email to

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