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

[plt-scheme] scheme unit/sig (fwd)





---------- Forwarded message ----------
Date: Mon, 13 May 2002 12:23:18 -0400
From: "dskippy@ccs.neu.edu" <dskippy@ccs.neu.edu>
Newsgroups: ccs.courses.com1205
Subject: scheme unit/sig


  i'm using the plt-scheme web-server and as has been discussed, i'm
having a few difficulties with the scoping of send/suspend and still
holding true to a strict MVC pattern. my partner sugested we create a
signature that includes the servlet^ signature and then import that into
the main program's unit to act as the web-server servlet. i'm not sure if
this is possible but it seems like a very elegant solution. can anyone
help me figure out how to do it?

-mike

;view-unit.ss
(require
  (lib "unitsig.ss")
  (lib "servlet.ss" "web-server"))
(define-signature view^ (login% add-room% ...))
(define curator-servlet@
  (unit
    (import servlet^)
    (export login% add-room% ...)
    (define login%
      (class* curator-view% (curator-view<%>)
        ... send/suspend ...))
    ... ))
--------------------------------------
;main-servlet.ss
(require
  (lib "unitsig.ss")
  "view-unit.ss"
  "controller.ss")
(unit/sig view@
  (import view^)
  (instantiate controller% ())) ; the problem with this line is
                                ; that the view sub classes are not
                                ; inscope inside the controller so
                                ; he cannot (instantiate login% ())