slib-discuss
[Top][All Lists]
Advanced

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

Re: [Slib-discuss] Windows XP + PLT Scheme 4.1 + SLIB 3b1: Loading mzsch


From: Aubrey Jaffer
Subject: Re: [Slib-discuss] Windows XP + PLT Scheme 4.1 + SLIB 3b1: Loading mzscheme.init fails.
Date: Sat, 4 Oct 2008 14:44:47 -0400 (EDT)

 | Date: Fri, 3 Oct 2008 09:37:05 +0000
 | From: "Elena Garrulo" <address@hidden>
 | 
 | loading SLIB inizialization file for PLT Scheme (mzscheme.init)
 | fails with error:
 | 
 | > mzscheme.init:302:3: compile: unbound variable in module in: slib:require
 | 
 | The offending sexp:
 | 
 | > (define (defmacro:expand* x)
 | >  (slib:require 'defmacroexpand) (apply defmacro:expand* x '()))
 | 
 | Here are the steps I've followed:
 | 
 | 1) Downloaded and run slib-3b1-1.exe.
 | 
 | 2) According to installation instructions, you should customize 
mzscheme.init:
 | - setting environment variables SCHEME_LIBRARY_PATH,
 |   MZSCHEME_IMPLEMENTATION_PATH;
 | - checking software-type, scheme-implementation-version,
 |   implementation-vicinity, and library-vicinity.
 |   ...
 | 
 | 3) I've added this lines on top of mzscheme.init to fix compilation errors
 | ("if without else" and "unbound variable in module in: find-seconds":
 | 
 | > #lang mzscheme
 | > (require scheme/date)
 | 
 | What I'm missing?
 | Thanks

"slib/mzscheme.init" was developed for mzscheme 2 and 3.  I downloaded
and compiled mzscheme-4.1 and was able to get a modified
"mzscheme.init" to load without error (patch appended); but the
resulting SLIB is not functional:

  bash-3.2$ mzscheme
  Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc.
  > (load "mzscheme.init")
  > (require 'random)
  require: unknown module: 'random
   === context ===
  /usr/local/collects/scheme/private/misc.ss:68:7

mzscheme-4 doesn't seem to be Scheme anymore.  Even though "provided?"
is defined in "require.scm" which is loaded by "mzscheme.init",
mzscheme-4 complains:

  ... compile: unbound variable in module in: provided?

The release notes describe lots of other incompatibilities
"http://docs.plt-scheme.org/release-notes/mzscheme/MzScheme_4.txt";.

"#lang r5rs" looks promising; but how does one get access to "getenv",
"system", and similar stuff without "require"?

                               -=-=-=-

*** mzscheme.init       23 Dec 2007 23:46:19 -0500      1.29
--- mzscheme.init       04 Oct 2008 14:07:04 -0400      
***************
*** 1,6 ****
--- 1,8 ----
  ;;;"mzscheme.init" Initialization for SLIB for mzscheme       -*-scheme-*-
  ;;; This code is in the public domain.
  
+ #lang mzscheme
+ 
  ;;@ (software-type) should be set to the generic operating system type.
  ;;; unix, vms, macos, amiga and ms-dos are supported.
  (define (software-type)
***************
*** 154,160 ****
        char-ready?
        macro                           ;has R4RS high level macros
        syntax-case                     ;has syntax-case macros
!       defmacro                        ;has Common Lisp DEFMACRO
        eval                            ;SLIB:EVAL is single argument eval
  ;;;   record                          ;has user defined data structures
        values                          ;proposed multiple values
--- 156,162 ----
        char-ready?
        macro                           ;has R4RS high level macros
        syntax-case                     ;has syntax-case macros
! ;;;   defmacro                        ;has Common Lisp DEFMACRO
        eval                            ;SLIB:EVAL is single argument eval
  ;;;   record                          ;has user defined data structures
        values                          ;proposed multiple values
***************
*** 190,197 ****
--- 192,201 ----
        (vector->list (current-command-line-arguments))))
  
  (require (lib "pretty.ss"))
+ (require (lib "process.ss"))          ; for "system"
  (unless (memq (system-type) '(unix beos))
    (namespace-require '(lib "date.ss")))
+ (require scheme/date)
  ;@
  (define current-time
    ;; Gives time since 1/1/1970 ...
***************
*** 260,289 ****
  ;;@ SLIB:EVAL is single argument eval using the top-level (user) environment.
  (define slib:eval eval)
  
- (define *defmacros*
-   (list (cons 'defmacro
-             (lambda (name parms . body)
-               `(set! *defmacros* (cons (cons ',name (lambda ,parms ,@body))
-                                        *defmacros*))))))
- ;@
- (define (defmacro? m) (and (assq m *defmacros*) #t))
- ;@
- (define (macroexpand-1 e)
-   (if (pair? e)
-       (let ((a (car e)))
-       (cond ((symbol? a) (set! a (assq a *defmacros*))
-              (if a (apply (cdr a) (cdr e)) e))
-             (else e)))
-       e))
- ;@
- (define (macroexpand e)
-   (if (pair? e)
-       (let ((a (car e)))
-       (cond ((symbol? a)
-              (set! a (assq a *defmacros*))
-              (if a (macroexpand (apply (cdr a) (cdr e))) e))
-             (else e)))
-       e))
  ;@
  (define gentemp
    (let ((*gensym-counter* -1))
--- 264,269 ----
***************
*** 292,310 ****
        (string->symbol
         (string-append "slib:G" (number->string *gensym-counter*))))))
  
- (define base:eval slib:eval)
- ;@
- (define (defmacro:eval x) (base:eval (defmacro:expand* x)))
- (define (defmacro:expand* x)
-   (slib:require 'defmacroexpand) (apply defmacro:expand* x '()))
- ;@
- (define (defmacro:load <pathname>)
-   (slib:eval-load <pathname> defmacro:eval))
  ;@
  (define slib:warn
    (lambda args
      (let ((cep (current-error-port)))
!       (if (provided? 'trace) (print-call-stack cep))
        (display "Warn: " cep)
        (for-each (lambda (x) (display #\space cep) (write x cep)) args)
        (newline cep))))
--- 272,282 ----
        (string->symbol
         (string-append "slib:G" (number->string *gensym-counter*))))))
  
  ;@
  (define slib:warn
    (lambda args
      (let ((cep (current-error-port)))
!       ;;(if (provided? 'trace) (print-call-stack cep))
        (display "Warn: " cep)
        (for-each (lambda (x) (display #\space cep) (write x cep)) args)
        (newline cep))))
***************
*** 314,320 ****
    (let ((error error))
      (lambda args
        (let ((cep (current-error-port)))
!       (if (provided? 'trace) (print-call-stack cep))
        (apply error "Error:" args)))))
  ;@
  (define (make-exchanger obj)
--- 286,292 ----
    (let ((error error))
      (lambda args
        (let ((cep (current-error-port)))
!       ;;(if (provided? 'trace) (print-call-stack cep))
        (apply error "Error:" args)))))
  ;@
  (define (make-exchanger obj)
***************
*** 422,431 ****
       (if (eq? 'top-level (syntax-local-context))
         #'(mz:require req ...)
         #'(slib:require req ...))]))
- 
- ;;; Previously loaded "/usr/local/lib/plt/collects/slibinit/init.ss"
- (cond ((string<? (version) "200")
-        (require-library "init.ss" "slibinit"))
-       (else
-        ;;(load (build-path (collection-path "slibinit") "init.ss"))
-        (eval '(require (lib "defmacro.ss")))))
--- 394,396 ----




reply via email to

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