chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] loading tinyclos class definition into an executable - h


From: Matthew Welland
Subject: [Chicken-users] loading tinyclos class definition into an executable - howto?
Date: Sat, 11 Aug 2007 12:42:28 -0700
User-agent: KMail/1.9.6

Why can't I use (load "bar.scm"), where bar.scm contains class definitions, 
in a compiled block? I'm writing a cgi based web app (a chicken based, 
primitive RoR) and I'd like to be able to compile most of my app but keep 
parts of it definable on the fly. I.e. the views and controllers and models 
are loaded on the fly but the bulk of the app is compiled. Is there a 
better way to do this?

% cat test.scm
(require-extension tinyclos)
(define-class <foo> ()
  (a))
(define-method (f1 (self <foo>))
  (slot-set! self 'a 1))
(load "bar.scm")
;;===========

% cat bar.scm
(define-class <bar> ()
  (d))
(define-method (b1 (self <bar>))
  (slot-set! self 'd 2))
(define b (make <bar>))
(b1 b)
;;===========

% csc test.scm
% ./test
Error: illegal non-atomic object: ()

        Call history:

        ##sys#require
        test.scm: 3    make
        test.scm: 6    ##tinyclos#add-global-method
        test.scm: 9    load
        <syntax>                (define-class <bar> () (d))     <--

-- 
http://www.kiatoa.com, fight for a better world.




reply via email to

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