From mb at bese.it Fri Jun 10 08:48:50 2005 From: mb at bese.it (Marco Baringer) Date: Fri, 10 Jun 2005 10:48:50 +0200 Subject: [Bese-devel] Re: LISP for web References: <1118215881.934625.125450@z14g2000cwz.googlegroups.com> <9GHpe.1604805$6l.960225@pd7tw2no> <1118338401.912767.87480@f14g2000cwb.googlegroups.com> Message-ID: The following message is a courtesy copy of an article that has been posted to comp.lang.lisp as well. "Peter Scott" writes: > Could you give more details about this interpreter? What problems is it > supposed to solve, and how does it solve them? Since I've written a > significant real-world application with UCW and I plan to use it more > in the future, I'm intensely interested in any upcoming major > improvements to it. by controlling the execution of the code (instead of just rewriting it and passing it to the underlying lisp) we can: 1) allow mutually recursive actions; allow actions which call actions to be defined in any order (currently an action must be defined before it can appear in the body of an action which calls it). (this particular limitation is the "straw which broke my back") 2) deal with lambdas in actions. for example you will be able to write: (setf effective-users (remove-if (lambda (user) (call 'option-dialog :message (format nil "Do you want to keep ~A?" (username user)) :options '(("Yes" . t) ("No" . nil)))) available-users)) 3) support catch/throw and progv (as long as they don't extend outside the current continuation's delimitiation). 4) support multiple-values (this is doable in the current implementation but i never got around to actually doing it). 5) greatly improve the debugging and error reporting (the current transformation destroys the original code and this makes it very hard (even for me) to debug actions). however we'll take a major speed hit (though in my test in time spent executing actions is ~0 compared to the time spent copying the html to the socket) and we'll (i'll) need to reimplement certain standard functions (such as remove-if) to deal with continuation enabled lambdas functions (this is where sacla comes in). this isn't really a 'major' feature, but it will be a big help and, hopefully, allow people to write/debug more complicated actions. p.s. - could we get more details on your real-world app? -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From mb at bese.it Fri Jun 10 14:43:34 2005 From: mb at bese.it (Marco Baringer) Date: Fri, 10 Jun 2005 16:43:34 +0200 Subject: [Bese-devel] SBCL and UCW References: <87oeaqm54i.fsf@gia.ist.utl.pt> <87d5qy39zq.fsf@flarge.here> Message-ID: Friedrich Dominicus writes: > Well I'm stuck a bit. I compiled UCW with SBCL 0.9.1.21 and that went > fine. did it complete without errors? maybe you've already done this, but: using slime's slime-repl-load-system (,l shortcut) you get a buffer with all the compilation notes/wornings and errors. > I modified start.lisp as suggested in the README but while accessing > http://127.0.0.1:8080/ucw/examples/index.ucw > > I get: > The value "ucw/examples/counter.tal" is not of type (OR FUNCTION SYMBOL). > [Condition of type TYPE-ERROR] > > Restarts: > 0: [SHOW-BACKTRACE] Send the client a backtrace page. > 1: [RETRY] Clearout the response and retry calling the action. > 2: [SERVER-ERROR] Send the client an internal server error page. > 3: [ABORT-RESPONSE] Abort this response and answer another request > 4: [ABORT] Exit debugger, returning to top level. > > Well I see that it's not a symbol or a function but what do I have to > change to make that work? that's on excellent question. the only place "ucw/examples/counter.tal" appears is as a default init arg to template name in counter.lisp. the question is: why in God's name is someone trying to funcall or apply "ucw/examples/counter.tal"? (i'm assuming this is the error due to the expected type in the backtrace). The first thing that comes to mind is that, somehow, the expansion of defcomponent went horribly. so, wolud you mind deleting all the fasls and recompiling? if the issue persists could i get a complete backtrace? p.s. - i'm often on #ucw at freenode.net if you want to do some remote debugging -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From svg at surnet.ru Wed Jun 8 22:43:47 2005 From: svg at surnet.ru (Vladimir Sekissov) Date: Thu, 09 Jun 2005 04:43:47 +0600 (YEKST) Subject: [Bese-devel] Status-bar-mixin Message-ID: <20050609.044347.248129273.svg@surnet.ru> Good day, I'm starting to use UCW. Here is small mixin component I've found helpful. May be you find it useful too. * Usage sample (defcomponent my-window (simple-window-component status-bar-mixin) ...) (defmethod render-on ((res response) (win my-window)) (show-status-bar res win) ...) ... somewhere in code ... (show-message "My info message" :severity :info) (show-message "My error message" :severity :error) ... * Code (in-package :it.bese.ucw) (defcomponent status-bar () ((messages :accessor messages :initarg messages :initform '())) (:documentation "Stateless status bar to display messages.")) (defmethod render-on ((res response) (sb status-bar)) (with-slots (messages) sb (<:div :id "status-bar" (iter (for (severity . msg) in messages) (<:p :class (strcat "status-bar-" (string-downcase (symbol-name severity))) (<:as-html msg)))) (setf messages '()))) (defgeneric add-message (status-bar msg &key &allow-other-keys) (:method ((sb status-bar) msg &key (severity :info)) (setf (messages sb) (acons severity msg (messages sb)))) (:documentation "Stateless status bar to display messages with severity.")) (defcomponent status-bar-mixin () ((status-bar :accessor status-bar :initarg status-bar :component (status-bar)))) (defmethod show-status-bar ((res response) (win status-bar-mixin)) (render-on res (status-bar win))) (defgeneric show-message (msg &key &allow-other-keys) (:method ((msg string) &key (severity :info) (context *context*)) (let* ((win (context.window-component context)) (win-class (class-of win))) (when (not (subtypep win-class (find-class 'status-bar-mixin))) (error "Type ~S of ~S is not a subclass of STATUS-BAR-MIXIN" win-class win)) (add-message (status-bar win) msg :severity severity)))) Best Regards, Vladimir Sekissov From sketerpot at gmail.com Fri Jun 10 23:10:17 2005 From: sketerpot at gmail.com (Peter Scott) Date: Fri, 10 Jun 2005 17:10:17 -0600 Subject: [Bese-devel] Minor problem with src/backends/httpd.lisp Message-ID: <7e267a9205061016101567d5af@mail.gmail.com> There's a typo in httpd.lisp in the latest version. Here's my fix for it: $ tla changes --diffs * looking for ucw-2004 at common-lisp.net/ucw--dev--0.3--patch-424 to compare with * comparing to ucw-2004 at common-lisp.net/ucw--dev--0.3--patch-424 M src/backend/httpd.lisp * modified files --- orig/src/backend/httpd.lisp +++ mod/src/backend/httpd.lisp @@ -55,7 +55,7 @@ (defmethod unregister-url-handler ((backend httpd-backend) url) (setf (handlers backend) - (remove url (handlers backend) :test #'string :key #'car))) + (remove url (handlers backend) :test #'string= :key #'car))) (defmethod handle-request ((backend httpd-backend) (request httpd-request) (response httpd-response)) (aif (assoc (query-path request) (handlers backend) :test #'string=) From mb at bese.it Sat Jun 11 09:11:43 2005 From: mb at bese.it (Marco Baringer) Date: Sat, 11 Jun 2005 11:11:43 +0200 Subject: [Bese-devel] Minor problem with src/backends/httpd.lisp In-Reply-To: <7e267a9205061016101567d5af@mail.gmail.com> (Peter Scott's message of "Fri, 10 Jun 2005 17:10:17 -0600") References: <7e267a9205061016101567d5af@mail.gmail.com> Message-ID: Peter Scott writes: > There's a typo in httpd.lisp in the latest version. Here's my fix for it: applied, thanks. (ucw--dev--0.3--patch-426) -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From mb at bese.it Sat Jun 11 09:28:55 2005 From: mb at bese.it (Marco Baringer) Date: Sat, 11 Jun 2005 11:28:55 +0200 Subject: [Bese-devel] cool javascript stuff Message-ID: this came up on lambda-the-ultimate and i thought it was pretty cool: demo: http://homepages.inf.ed.ac.uk/cgi/wadler/twodigits.links source code: http://homepages.inf.ed.ac.uk/wadler/linksdemos/twodigits.links -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From mb at bese.it Sat Jun 11 09:44:50 2005 From: mb at bese.it (Marco Baringer) Date: Sat, 11 Jun 2005 11:44:50 +0200 Subject: [Bese-devel] Re: LISP for web In-Reply-To: (Marco Baringer's message of "Fri, 10 Jun 2005 10:48:50 +0200") References: <1118215881.934625.125450@z14g2000cwz.googlegroups.com> <9GHpe.1604805$6l.960225@pd7tw2no> <1118338401.912767.87480@f14g2000cwb.googlegroups.com> Message-ID: The following message is a courtesy copy of an article that has been posted to comp.lang.lisp as well. "Marco Baringer" writes: > "Peter Scott" writes: > >> Could you give more details about this interpreter? What problems is it >> supposed to solve, and how does it solve them? Since I've written a >> significant real-world application with UCW and I plan to use it more >> in the future, I'm intensely interested in any upcoming major >> improvements to it. > > by controlling the execution of the code (instead of just rewriting it > and passing it to the underlying lisp) we can: (i really can't believe i forget to mention this) there is one other thing which will become much easier if we take over control of executing actions: serializing session state and, thanks to this, ucw session mobility. atm everything in a session is easily (fsvo easy) serializable except the anonymous closures which are generated by the cps transformation and stored in the components. if we stop using the lisp's functions object but create our own which consits of: code [another set of clos objects] and the environement [again a clos object] then sending the entire session over the wire becomes doable. currently if you need to run a ucw app on multiple machines your only option is to tie a session to a particular machine and map all subsequent requests to that machine. this kind of setup is easy to create and works fine, but it has the major defect that if the machine goes down it takes all of its sessions with it. i don't know what most people think about this but the only client i have who would like to run the site on multiple machines wants a hardware failure to be as transparent as possible. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From frido at q-software-solutions.de Sat Jun 11 15:32:01 2005 From: frido at q-software-solutions.de (Friedrich Dominicus) Date: Sat, 11 Jun 2005 17:32:01 +0200 Subject: [Bese-devel] SBCL and UCW In-Reply-To: (Marco Baringer's message of "Fri, 10 Jun 2005 16:43:34 +0200") References: <87oeaqm54i.fsf@gia.ist.utl.pt> <87d5qy39zq.fsf@flarge.here> Message-ID: <87hdg47vv2.fsf@flarge.here> "Marco Baringer" writes: > Friedrich Dominicus writes: > >> Well I'm stuck a bit. I compiled UCW with SBCL 0.9.1.21 and that went >> fine. > > did it complete without errors? maybe you've already done this, but: > using slime's slime-repl-load-system (,l shortcut) you get a buffer > with all the compilation notes/wornings and errors. Sorry I can not remember, if I had errors, but > so, wolud you mind deleting > all the fasls and recompiling? if the issue persists could i get a > complete backtrace? I will do that tomorrow and keep a list if the compilation won't run without bugs. Regards Friedrich From mb at bese.it Sun Jun 12 12:18:53 2005 From: mb at bese.it (Marco Baringer) Date: Sun, 12 Jun 2005 14:18:53 +0200 Subject: [Bese-devel] templating systems Message-ID: hi, this came up in a private discussion and i think it's worth repeating: ucw comes with out-of-the-box support for yaclml and, since i have written and activly use yaclml, you can always be sure that ucw and yaclml either work together or will work together very very soon. however this does not in any way mean that you _must_ use yaclml (or tal) if you don't like them (not everyone does). you just need to know about a few 'simple' forms: (compute-url COMPONENT :action-id (make-new-action (context.current-frame *context*) ACTION)) this returns a relative URL (see src/helpers.lisp) which, when requested, will cause the function ACTION to be called. You can use the result of (make-new-action ...) in forms by simply setting the parameter named +action-parameter-name+ (which is, and has always been, "a"). in forms you also need to set the +frame-parameter-name+ ("f") and +session-parameter-name+ ("s") +parameters. (make-new-action (context.current-frame *context*) CALLBACK) this returns a string which, when used as a GET or POST parameter, will cause CALLBACK to be called. CALLBACK will be passed the string corresponding to whatever the client sent for that parameter. hi, ucw is starting to get to the point where we have some user-contributed code (wow!!), unfortunetly nobody really knows it exists, and this hurts ucw. if you have any code you'd like to share i'd be more than happy to: 1) put it in a directory ucw/contribs/YOUR-CONTRIB in the official ucw tree or 2) mention it on ucw's web site and the README file. the criteria for getting your code in the contrib directory or on the web site are: 1) your code must include a README specifying what ucw setup you've tested the code on (ucw version, backend, lisp system and OS) and a description of what it does. 2) you must be subscribed to bese-devel at common-lisp.net (or read the list through gmane) and attempt to help people use/improve your code. 3) if you want me to include your code in ucw you must be willing to accept the fact that i may modify it without telling you (i'll try not to but don't pissed at me if i do). 4) you are NOT required to make sure you code is 100% bug free, runs on all platforms, has 5 star documentation or whatever. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From mb at bese.it Mon Jun 13 11:38:51 2005 From: mb at bese.it (Marco Baringer) Date: Mon, 13 Jun 2005 13:38:51 +0200 Subject: [Bese-devel] Re: LISP for web In-Reply-To: (Brad Anderson's message of "Sun, 12 Jun 2005 20:28:25 GMT") References: <1118215881.934625.125450@z14g2000cwz.googlegroups.com> <9GHpe.1604805$6l.960225@pd7tw2no> <1118338401.912767.87480@f14g2000cwb.googlegroups.com> Message-ID: The following message is a courtesy copy of an article that has been posted to comp.lang.lisp as well. Brad Anderson writes: > Ideas on how to store this information centrally for all of the app > servers? I would love to see either a RDBMS (Postgres) or Memcached > (http://www.danga.com/memcached/) option. > > [snip] > > This would allow me to use UCW not only in personal projects, but at > work as well. Any timeline? I can do some testing, although I'm a > bit of a newb. we're talking about two different things: 1) scalability. can you increase the performance of a ucw app by adding hardware? two options: a) manage sessions with cookies and use pound for load balancing (www.apsis.ch/pound/). this is by far the simplest solution and is doable today with the current ucw code base. you still run the risk of losing data and sessions if one of the machines goes down and, if you're unlucky, you could still end up with one machine serving lots of busy sessions and another sitting idly. if you can't use cookies then you'd need to change some of ucw's form handling code (to make sure session ids are always passed in the url), this is fairly easy but hasn't been done yet (and won't get done unless i need it or someone else contributes it). b) store the sessions in a memcache (thanks for the link btw) or an rdbms and use lvs (www.linuxvirtualserver.org) to balance the work on the machines. this has the advantage that you won't end up with one busy machine and one idle machine and lvs deals hot swapping of machines and dead nodes transparently. this has the major disadvantage that, as of now, you can't do it since there's no way to store a session in anything but local ram. once sessions are completly serializable then this requires modifying find-session, expire-session and adding a new :after method on service (to store the changed session back in the db). since each and every request will require first fetching the session object and then, just before sending back the html, puting the session object back into the store (it has changed in the mean time) we will need to make sure session serialization doesn't become a bootleneck. 2) high availablity. can you create a ucw app which is resistent to hardware failures? not currently. the load-balancing solution in (1.b) can deal with hardware failures an the app servers but this leaves the db as a spof. the only 'real' solutions to this is to use a db which supports replication and store sessions in the db. i think postrgesql can but i haven't checked in a while and i know berkeleydb does (though i've never actually used it)). as far as ucw is concerned the only thing missing is fast session serialization and this will happen as soon as I convince someone to pay me for it (hint hint hint :)). -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From chiljon at softwarelabs.nl Wed Jun 15 05:28:08 2005 From: chiljon at softwarelabs.nl (Chiljon Janssen) Date: Wed, 15 Jun 2005 07:28:08 +0200 (CEST) Subject: [Bese-devel] Problems with UCW and Portable AServe Message-ID: Hello, I've installed UCW on CMUCL/Linux and Lispworks/Win32, both with the Portable AServe backend. The examples are VERY slow on CMUCL, what's the reason for this? When I use Firefox as a browser I get socket errors on both installations? Any idea why this is happening? Chiljon From chiljon at softwarelabs.nl Wed Jun 15 08:45:20 2005 From: chiljon at softwarelabs.nl (Chiljon Janssen) Date: Wed, 15 Jun 2005 10:45:20 +0200 (CEST) Subject: [Bese-devel] Problems with UCW and Portable AServe In-Reply-To: <7c23adaa05061501286aea250d@mail.gmail.com> References: <7c23adaa05061501286aea250d@mail.gmail.com> Message-ID: On Wed, 15 Jun 2005, Ivan Toshkov wrote: > On 6/15/05, Chiljon Janssen wrote: >> Hello, >> >> I've installed UCW on CMUCL/Linux and Lispworks/Win32, both with the >> Portable AServe backend. The examples are VERY slow on CMUCL, what's the reason >> for this? When I use Firefox as a browser I get socket errors on both installations? >> Any idea why this is happening? >> >> Chiljon >> _______________________________________________ >> bese-devel mailing list >> bese-devel at common-lisp.net >> http://common-lisp.net/cgi-bin/mailman/listinfo/bese-devel >> > > Read the file README.cmucl in the Portablve AllegroServe distribution. > For me the following mantra works fine: > > #+(and cmu mp) (setf mp::*idle-process* mp::*initial-process*) > > HTH, > Ivan > -- > All languages are equal, > but Lisp is more equal than others. > Yep, thanks, this fixed all the problems with CMUCL. This was the first time I loaded Portable Aserve through asdf instead of loading it with INSTALL.lisp... Chiljon From frido at q-software-solutions.de Thu Jun 16 05:21:28 2005 From: frido at q-software-solutions.de (Friedrich Dominicus) Date: Thu, 16 Jun 2005 07:21:28 +0200 Subject: [Bese-devel] SBCL and UCW In-Reply-To: <87hdg47vv2.fsf@flarge.here> (Friedrich Dominicus's message of "Sat, 11 Jun 2005 17:32:01 +0200") References: <87oeaqm54i.fsf@gia.ist.utl.pt> <87d5qy39zq.fsf@flarge.here> <87hdg47vv2.fsf@flarge.here> Message-ID: <87aclqlvvr.fsf@flarge.here> Friedrich Dominicus writes: > "Marco Baringer" writes: > >> Friedrich Dominicus writes: >> >>> Well I'm stuck a bit. I compiled UCW with SBCL 0.9.1.21 and that went >>> fine. >> >> did it complete without errors? maybe you've already done this, but: >> using slime's slime-repl-load-system (,l shortcut) you get a buffer >> with all the compilation notes/wornings and errors. > Sorry I can not remember, if I had errors, but >> so, wolud you mind deleting >> all the fasls and recompiling? if the issue persists could i get a >> complete backtrace? I did the following things: -updated all the ucw stuff - update to SBCL 0.9.1.4x something - deleted every fasl file below the UCW Root dir - recompiled it (yes there were errors, I have posted my issues with asdf to the SBCL groups and was told what to do. The point is if asdf failes I often just have to restart it if that fails just load the lisp-file and compile it tell asdf everything is fine and go on. I know this is not the way it should be but I'm fed up with finding out what asdf and/or SBCL dislike about some files. It's however one thing that really gets on my nerves with a lot of Lisp libraries, you can not compile them out of the box and use them. If I have to recompile McCLIM e.g it needs a lot of retries, manual compiles and the like the same was true for cl-sdl and getting cl-xml run is always adventorous. Ok finally I now have ucw compiled and kind of running but: If I try to run the presentation example -> create a new person and click oin Adress (Create) I get a backtrace like this: There is no applicable method for the generic function # when called with arguments (# #). [Condition of type SIMPLE-ERROR] Restarts: 0: [SHOW-BACKTRACE] Send the client a backtrace page. 1: [RETRY] Clearout the response and retry calling the action. 2: [SERVER-ERROR] Send the client an internal server error page. 3: [ABORT-RESPONSE] Abort this response and answer another request 4: [ABORT] Exit debugger, returning to top level. Backtrace: 0: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-DEBUGGING-ENVIRONMENT (T)) # # #) 1: ((LAMBDA NIL)) --more-- Does anyone have an idea what this could mean? Friedrich From frido at q-software-solutions.de Thu Jun 16 05:37:18 2005 From: frido at q-software-solutions.de (Friedrich Dominicus) Date: Thu, 16 Jun 2005 07:37:18 +0200 Subject: [Bese-devel] Other issues with the presentation examples Message-ID: <871x72lv5d.fsf@flarge.here> In creating a new person. While not filling in any data just clicking on Add new object error message: The value NIL is not of type IT.BESE.UCW::WALL-TIME. [Condition of type TYPE-ERROR] Restarts: 0: [SHOW-BACKTRACE] Send the client a backtrace page. 1: [RETRY] Retry rendering the component. 2: [RETRY] Retry rendering the component. 3: [RETRY] Retry rendering the component. 4: [RETRY] Retry rendering the component. 5: [SERVER-ERROR] Send the client an internal server error page. 6: [ABORT-RESPONSE] Abort this response and answer another request 7: [ABORT] Exit debugger, returning to top level. Backtrace: 0: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-DEBUGGING-ENVIRONMENT (T)) # # #) 1: ((LAMBDA NIL)) Well nil is not of type wall-time. I think that's reasonable... Friedrich From brad at sankaty.com Fri Jun 17 04:02:17 2005 From: brad at sankaty.com (Brad Anderson) Date: Thu, 16 Jun 2005 23:02:17 -0500 Subject: [Bese-devel] UCW project and docs for newbies Message-ID: <42B24B49.7090101@sankaty.com> I'm starting a UCW project and will attempt to document the difficulties I came across during its development. Hopefully the other UCW developers just starting out can use parts of it as a reference. And hopefully those of you on the mailing list with some experience can lend some guidance, as I'm new to Lisp and UCW. Project Page: http://trac.dsource.org/projects/koth/ UCW page: http://trac.dsource.org/projects/koth/wiki/BeginningUcw I'll still post questions to the group here, but will be sure to clean up and document on this project's site as well. Answers to the questions I have on this page: http://trac.dsource.org/projects/koth/wiki/MultipleContainersSamePage would be greatly appreciated. You can track progress on the Timeline or Roadmap pages, and see the source code at any time. Cheers, Brad From mb at bese.it Fri Jun 17 08:05:36 2005 From: mb at bese.it (Marco Baringer) Date: Fri, 17 Jun 2005 10:05:36 +0200 Subject: [Bese-devel] UCW project and docs for newbies In-Reply-To: <42B24B49.7090101@sankaty.com> (Brad Anderson's message of "Thu, 16 Jun 2005 23:02:17 -0500") References: <42B24B49.7090101@sankaty.com> Message-ID: Brad Anderson writes: > Answers to the questions I have on this page: > http://trac.dsource.org/projects/koth/wiki/MultipleContainersSamePage > would be greatly appreciated. Q: Can I make the main page (home.lisp) a template? Do TAL templates allow for 'container' place-holders? I.e. I'd have a home.tal file that laid out all the mark-up and the two containers (header and league-home) had their place in the .tal file? Kind of like with JSP's you can include one inside another. A: yes. use the When rendering TAL pages the variable $component is bound to the current component, so assuming this is home-window's templote and you want to render the component in the header slot. look at the tabbed-pane component's tal page (ucw/wwwroot/ucw/tabbed-pane.tal). the other way to 'merge' tal pages is through the tal:include tag. there are some (very small) examples in yaclml/t/inc[123].tal. Q: Are there good TAL resources/docs out there? I'm looking at the ones involving PHP and hoping there's some consistency. I'll admit that I have more to read, but wanted to make sure I'm reading the right and/or recommended stuff. A: The Zope stuff is what i started with. the only thing i've added to the general TAL style is the possibility of embedding lisp code in attributes which allows you to do things like: source or ... the syntax for this is documented in yaclml/src/tal/compile.lisp Q: What's with the mark-up that comes out of UCW? Is that a Marco style thing? Why do the tags split to the next line at white-space? With variable-length attributes and the like, is this style best? dude, you're just smoking the wrong weed... just kidding, up until a few months ago tal/yaclml code was printed without any kind of whitespace or indentation. this had the advantage of making the pages significantly smaller, but near impossible to debug. intsead of trying to figure out which tags i could add/remove whitespace around without changing the visual rendering of the page i opted for something simplier: put the indentation whitespace inside the tags themselves. you can turn it off by setting *yaclml-indent* to NIL. this setting must be made when _compiling_ yaclml/tal code so you may need to wipe out the tal generator cache or remove some fasl files for it to have effect. if you have any more specific question i'll be more than happy to answer. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From mb at bese.it Fri Jun 17 08:09:52 2005 From: mb at bese.it (Marco Baringer) Date: Fri, 17 Jun 2005 10:09:52 +0200 Subject: [Bese-devel] SBCL and UCW In-Reply-To: <87aclqlvvr.fsf@flarge.here> (Friedrich Dominicus's message of "Thu, 16 Jun 2005 07:21:28 +0200") References: <87oeaqm54i.fsf@gia.ist.utl.pt> <87d5qy39zq.fsf@flarge.here> <87hdg47vv2.fsf@flarge.here> <87aclqlvvr.fsf@flarge.here> Message-ID: Friedrich Dominicus writes: > Ok finally I now have ucw compiled and kind of running but: > If I try to run the presentation example -> create a new person and > click oin Adress (Create) I get a backtrace like this: this is a bug (the presentation stuff changed and i didn't update the example). -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From mb at bese.it Fri Jun 17 08:11:20 2005 From: mb at bese.it (Marco Baringer) Date: Fri, 17 Jun 2005 10:11:20 +0200 Subject: [Bese-devel] Other issues with the presentation examples In-Reply-To: <871x72lv5d.fsf@flarge.here> (Friedrich Dominicus's message of "Thu, 16 Jun 2005 07:37:18 +0200") References: <871x72lv5d.fsf@flarge.here> Message-ID: Friedrich Dominicus writes: > Well nil is not of type wall-time. I think that's reasonable... this is another symptom of the same bug you got your other test. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From drewc at tech.coop Sat Jun 18 19:24:28 2005 From: drewc at tech.coop (Drew Crampsie) Date: Sat, 18 Jun 2005 12:24:28 -0700 Subject: [Bese-devel] m-v-b greenspunned in actions. Message-ID: <42B474EC.2020309@tech.coop> multiple-value-bind (actually m-v-call) doesn't work in actions. Not a big deal, but it came up twice in one day, so : (defun multiple-value-funcall->list (function &rest args) (multiple-value-call #'list (apply function args))) (defmacro multiple-value-bindf (vars form &body body) `(destructuring-bind ,vars (multiple-value-funcall->list #',(car form) ,@(cdr form)) , at body)) it works in an action, avoiding a direct call to m-v-c : > (multiple-value-bindf (a b c) (values 1 2 3) (list a b c)) => (1 2 3) works for me, drewc From frido at q-software-solutions.de Mon Jun 20 13:18:22 2005 From: frido at q-software-solutions.de (Friedrich Dominicus) Date: Mon, 20 Jun 2005 15:18:22 +0200 Subject: [Bese-devel] I'm simply not getting it: Message-ID: <87zmtltbdt.fsf@flarge.here> See the following code: (in-package :qss.web.ucw) ;; end of cut+paste code (defparameter *test-application* (make-instance 'cookie-session-application :url-prefix "/ucw/test/" :tal-generator (make-instance 'yaclml:file-system-generator :cachep t :root-directories (list *ucw-tal-root*)) :www-roots (list (merge-pathnames "./ucw/test/" *ucw-tal-root*)))) (defcomponent downloader-window (simple-window-component) ((body :component simple-container :accessor example-window.body)) (:default-initargs :title "UCW Examples" :stylesheet "stylesheet.css") (:documentation "The main window component for the example application.")) (defmethod render-on ((res response) (app downloader-window)) (<:h1 "Downloader Example") (render-on res (example-window.body app))) (defcomponent simple-address (form-component) ((name :accessor name :component (text-field)) (email :accessor email :component (text-field))) (:default-initargs :title "Downloader " :stylesheet "/css/qss.css")) (defaction psav ((adr simple-address)) (<:html (<:body "here we are"))) ;; "name = " (lisp-value (name adr)) ;; "email = " (lisp-value (email adr))))) (defmethod render-on ((res response) (adr simple-address)) ( (Friedrich Dominicus's message of "Mon, 20 Jun 2005 15:18:22 +0200") References: <87zmtltbdt.fsf@flarge.here> Message-ID: Friedrich Dominicus writes: > (in-package :qss.web.ucw) > > ;; end of cut+paste code > (defparameter *test-application* > (make-instance 'cookie-session-application > :url-prefix "/ucw/test/" > :tal-generator (make-instance 'yaclml:file-system-generator > :cachep t > :root-directories (list *ucw-tal-root*)) > :www-roots (list (merge-pathnames "./ucw/test/" *ucw-tal-root*)))) this is right (as long as you remeber to register the app when you startup the server). > (defcomponent downloader-window (simple-window-component) > ((body :component simple-container :accessor example-window.body)) > (:default-initargs > :title "UCW Examples" :stylesheet "stylesheet.css") > (:documentation "The main window component for the example application.")) > > (defmethod render-on ((res response) (app downloader-window)) > (<:h1 "Downloader Example") > (render-on res (example-window.body app))) > > (defcomponent simple-address (form-component) > ((name :accessor name > :component (text-field)) > (email :accessor email > :component (text-field))) > (:default-initargs :title "Downloader " :stylesheet "/css/qss.css")) this is all right. > (defaction psav ((adr simple-address)) > (<:html > (<:body > "here we are"))) > ;; "name = " (lisp-value (name adr)) > ;; "email = " (lisp-value (email adr))))) this is wrong. you can't emit html in actions. you need to call a component in an action, the component can then spit out the html: (defcomponent show-address (simple-window-component) ((address :accessor address :initarg :address))) (defmethod render-on ((res response) (s show-address)) (<:p "here we are!") (<:table (<:tr (<:td "Name:") (<:td (<:as-html (lisp-value (name (address s)))))) (<:tr (<:td "E-Mail:") (<:td (<:as-html (lisp-value (email (address s)))))))) > (defmethod render-on ((res response) (adr simple-address)) > ( (<:table > (<:tr > (<:td "You're name please") > (<:td ( :accessor (lisp-value (name adr)) > :size 30))) > (<:tr > (<:td "you're email: ") > (<:td ( :accessor (lisp-value (email adr)) > :size 30))) > (<:tr > (<:td (<:input :type "submit" :value "submit")) > (<:td))))) > > (defentry-point "index.ucw" (:application *test-application*) () > (call 'downloader-window)) > > (defmethod shared-initialize :after ((window downloader-window) slot-names &rest initargs) > "Initialize the components contained in (example.body APP)." > (declare (ignore slot-names initargs)) > (let ((container (example-window.body window))) > (flet ((add-component (type &optional (name type)) > (setf (find-component container name) (make-instance type)))) > (add-component 'simple-address) > (setf (container.current-component-name container) > 'simple-address)))) this can be simplified to: (defmethod shared-initialize :after ((window downloader-window) slot-names &rest initargs) (declare (ignore slot-names initargs)) (initialize-container ((example-window.body window)) (simple-address 'simple-address))) > Why do I see not output through psav? because during the execution of actions yaclml:*yaclml-stream* (which is where <:html, <:body and friends send their output) is bound to T. > I do not see any error I do not see any output. > What I want it simply put: > - Getting a form with two input text-fields > - after submitting that form I want to see what has been send how's this: (defentry-point "index.ucw" (:application *test-application*) () (call 'show-address :address (call 'get-address))) (defclass address () ((name :accessor name :initarg :name :initform "") (email :accessor email :initarg :email :initform ""))) (defcomponent address-manipulator-mixin () ((address :accessor address :initarg :address :backtrack t :initform (make-instance 'address)))) (defcomponent show-address (simple-window-component address-manipulator-mixin) ()) (defmethod render-on ((res response) (s show-address)) (<:p "Your address:") (<:table (<:tr (<:td "Name:") (<:td (<:as-html (name (address s))))) (<:tr (<:td "Email:") (<:td (<:as-html (email (address s))))))) (defcomponent get-address (simple-window-component address-manipulator-mixin) ((message :accessor message :initarg :message :initform nil))) (defmethod render-on ((res response) (g get-address)) (<:p "Please submit an address:") (when (message g) (<:p :style "color: #ff0000; font-weight: bold" (<:as-html (message g)))) ( Do I always need something like the downloader-window component? and > add some tother components to this window? no, you don't need it. it all depends on how you want to structure your app. hth. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From frido at q-software-solutions.de Wed Jun 22 06:24:52 2005 From: frido at q-software-solutions.de (Friedrich Dominicus) Date: Wed, 22 Jun 2005 08:24:52 +0200 Subject: [Bese-devel] I'm simply not getting it: In-Reply-To: (Marco Baringer's message of "Tue, 21 Jun 2005 16:42:35 +0200") References: <87zmtltbdt.fsf@flarge.here> Message-ID: <87wtom3o3v.fsf@flarge.here> Well that code looks much better then mine. I hope I can make good use of it. Thanks Friedrich From frido at q-software-solutions.de Wed Jun 22 13:56:23 2005 From: frido at q-software-solutions.de (Friedrich Dominicus) Date: Wed, 22 Jun 2005 15:56:23 +0200 Subject: [Bese-devel] I'm simply not getting it: In-Reply-To: (Marco Baringer's message of "Tue, 21 Jun 2005 16:42:35 +0200") References: <87zmtltbdt.fsf@flarge.here> Message-ID: <87psue1omw.fsf@flarge.here> Ok, if someone else might be interested I had to modify the send code too: (in-package :qss.web.ucw) ;; end of cut+paste code (defparameter *test-application* (make-instance 'cookie-session-application :url-prefix "/ucw/test/" :tal-generator (make-instance 'yaclml:file-system-generator :cachep t :root-directories (list *ucw-tal-root*)) :www-roots (list (merge-pathnames "./ucw/test/" *ucw-tal-root*)))) ;;;(defmethod shared-initialize :after ((window downloader-window) slot-names &rest initargs) ;;; (declare (ignore slot-names initargs)) ;;; (initialize-container ((example-window.body window)) ;;; (simple-address 'simple-address))) (defentry-point "index.ucw" (:application *test-application*) () (call 'show-address :address (call 'get-address))) (defclass address () ((name :accessor name :initarg :name :initform "") (email :accessor email :initarg :email :initform ""))) (defcomponent address-manipulator-mixin () ((address :accessor address :initarg :address :backtrack t :initform (make-instance 'address)))) (defcomponent show-address (simple-window-component address-manipulator-mixin) ()) (defmethod render-on ((res response) (s show-address)) (<:p "Your address:") (<:table (<:tr (<:td "Name:") (<:td (<:as-html (name (address s))))) (<:tr (<:td "Email:") (<:td (<:as-html (email (address s))))))) (defcomponent get-address (simple-window-component address-manipulator-mixin) ((message :accessor message :initarg :message :initform nil))) (defmethod render-on ((res response) (g get-address)) (<:p "Please submit an address:") (when (message g) (<:p :style "color: #ff0000; font-weight: bold" (<:as-html (message g)))) ( (Friedrich Dominicus's message of "Wed, 22 Jun 2005 15:56:23 +0200") References: <87zmtltbdt.fsf@flarge.here> <87psue1omw.fsf@flarge.here> Message-ID: Friedrich Dominicus writes: > (defaction print-info ((g get-address)) i don't think print-info is the best name for this action. the fact that it only gets used to 'print' the address doesn't mean this action actually prints the address. i'm going to call it OK, my logic being: the generic OK action is usually used whenever the component has done whatever it was supposed to do. for a component called get-address its job is to get (and therefor return) an address, which is exactly what that action does. though if that's my reasoning maybe this would be better: (defaction submit ((g get-address)) (if (and (name (address g)) (string/= "" (name (address g))) (email (address g)) (string/= "" (email (address g)))) (ok g) (setf (message g) "Sorry, you must supply both a name and an email."))) (defaction ok ((g get-address)) (answer (make-instance 'address :name (name (address g)) :email (email (address g))))) and call submit, and not ok, from the form. decisions, decisions, decisions. > IMHO this would be a good candidate to be included into the examples. ok. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From frido at q-software-solutions.de Wed Jun 22 15:28:31 2005 From: frido at q-software-solutions.de (Friedrich Dominicus) Date: Wed, 22 Jun 2005 17:28:31 +0200 Subject: [Bese-devel] I'm simply not getting it: In-Reply-To: (Marco Baringer's message of "Wed, 22 Jun 2005 16:50:19 +0200") References: <87zmtltbdt.fsf@flarge.here> <87psue1omw.fsf@flarge.here> Message-ID: <87acli1kdc.fsf@flarge.here> "Marco Baringer" writes: > Friedrich Dominicus writes: > >> (defaction print-info ((g get-address)) > > i don't think print-info is the best name for this action. the fact > that it only gets used to 'print' the address doesn't mean this action > actually prints the address. i'm going to call it OK, my logic >being: you're right I renamed it because I thought that there was a problem while changing ok. That was nonsense, because the point was that one has to use address to access the stuff. > > the generic OK action is usually used whenever the component has done > whatever it was supposed to do. for a component called get-address its > job is to get (and therefor return) an address, which is exactly what > that action does. agreed Regards Friedrich From brad at sankaty.com Wed Jun 22 16:01:40 2005 From: brad at sankaty.com (Brad Anderson) Date: Wed, 22 Jun 2005 11:01:40 -0500 Subject: [Bese-devel] I'm simply not getting it: In-Reply-To: References: <87zmtltbdt.fsf@flarge.here> Message-ID: <42B98B64.3080000@sankaty.com> Marco Baringer wrote: > > things worth noting: > > 2) the 'page flow' of the app (the way in which the user moves from > one page to the next) is entirely contained in the entry-point. Is this common practice in UCW? In the app I'm constructing, I have different tabs at the top of the page for the users: public: home, results, rules player: home, results, picks, user/team maint, rules admin : home, results, picks, user/team maint, rules, league/game maint, send email alerts. So I was planning on having an entry point for each tab. But I *could* have only one entry point and all of these tabs are components (maybe even w/in the tabbed component). > it all depends on how you want to structure > your app. Are there any reasons to do multiple entry points due to permissions and roles listed above? I.e. would I have public, player, and admin entry points? Or just do the entire site in one entry point based on the role stored in the session's user object? Just looking for some advice on architecture and/or best practices, understanding I'm probably fine either way. Cheers, BA From astor at pvv.ntnu.no Thu Jun 23 11:40:18 2005 From: astor at pvv.ntnu.no (astor at pvv.ntnu.no) Date: Thu, 23 Jun 2005 13:40:18 +0200 Subject: [Bese-devel] wall-time Message-ID: <20050623114018.GD98995@pvv.ntnu.no> Hello ucw-people! Great work Marco! But... wall-time is defined as a "supported" type by ucw. It uses the code from clsql to implement this datatype. clsql has wall-time as a supported type too, but since ucw has copied the code and put it in another package, these types are not interchangeable. Which means that I end up patching ucw and make it depend on clsql instead of using its own wall-time. What do you guys do? It seems you can't store a ucw::wall-time into a clsql view seamlessly. astor From smoof-ra at elder-gods.org Thu Jun 23 14:11:24 2005 From: smoof-ra at elder-gods.org (Larry D'Anna) Date: Thu, 23 Jun 2005 10:11:24 -0400 Subject: [Bese-devel] lambda and call/cc Message-ID: <20050623141123.GA6123@melkor.elder-gods.org> If I understand it correctly, the reason you can't have a call/cc inside a lambda is that then you have lambdas floating around that needed to be called with the call/cc convention rather then the usual one, and there's no way to tell them apart. If this is the case then it should be possible to add operators lambda/cc and funcall/cc that can be used to make and call cps lambdas. Am I on the right track here? --larry From aml at gia.ist.utl.pt Wed Jun 1 16:08:45 2005 From: aml at gia.ist.utl.pt (Antonio Menezes Leitao) Date: Wed, 01 Jun 2005 17:08:45 +0100 Subject: [Bese-devel] Logout in UCW Message-ID: <87oeaqm54i.fsf@gia.ist.utl.pt> Hi, I would like to know what is the best way to implement a logout action in UCW. My idea is that I should delete the current session and present the login component again but I'm unsure about the best way of doing it. Currently, I'm doing the following: (defaction logout ((w foo-window)) (delete-session (context.application *context*) (context.session *context*)) (call 'login)) Is this OK? Is there a better way (maybe choosing the login entry point for the application)? Best regards, Ant?nio Leit?o. From mb at bese.it Wed Jun 1 17:47:04 2005 From: mb at bese.it (Marco Baringer) Date: Wed, 01 Jun 2005 19:47:04 +0200 Subject: [Bese-devel] Logout in UCW In-Reply-To: <87oeaqm54i.fsf@gia.ist.utl.pt> (Antonio Menezes Leitao's message of "Wed, 01 Jun 2005 17:08:45 +0100") References: <87oeaqm54i.fsf@gia.ist.utl.pt> Message-ID: Antonio Menezes Leitao writes: > Hi, > > I would like to know what is the best way to implement a logout action > in UCW. My idea is that I should delete the current session and > present the login component again but I'm unsure about the best way of > doing it. Currently, I'm doing the following: > > (defaction logout ((w foo-window)) > (delete-session (context.application *context*) > (context.session *context*)) > (call 'login)) this is just fine (and very similar to what i've done occasionaly). > Is this OK? Is there a better way (maybe choosing the login entry > point for the application)? sorry, i don't understand "choosing the login entry point for the application" -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From pupeno at pupeno.com Wed Jun 1 23:19:43 2005 From: pupeno at pupeno.com (Pupeno) Date: Wed, 1 Jun 2005 20:19:43 -0300 Subject: [Bese-devel] Inspector feature Message-ID: <200506012019.45731.pupeno@pupeno.com> Hello, I have a little feature request for the inspector feature that it'd probably take 0.1 times to implement to some of you than for me to find where the source code is. Can the border arround the piece of the HTML the inspector is about, that box, be collored according to the name of the component (or some other component-specific value), it may be a hash or something. The idea is it'd make it easier to separate one component from another, where one ends and another beginigs (because the borders get confused when they are next to each other) ? Thanks. -- Pupeno (http://pupeno.com) Reading ? Science Fiction ? http://sfreaders.com.ar -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From aml at gia.ist.utl.pt Thu Jun 2 10:49:57 2005 From: aml at gia.ist.utl.pt (Antonio Menezes Leitao) Date: Thu, 02 Jun 2005 11:49:57 +0100 Subject: [Bese-devel] Logout in UCW In-Reply-To: (Marco Baringer's message of "Wed, 01 Jun 2005 19:47:04 +0200") References: <87oeaqm54i.fsf@gia.ist.utl.pt> Message-ID: <87acm9av8q.fsf@gia.ist.utl.pt> "Marco Baringer" writes: > Antonio Menezes Leitao writes: > >> Hi, >> >> I would like to know what is the best way to implement a logout action >> in UCW. My idea is that I should delete the current session and >> present the login component again but I'm unsure about the best way of >> doing it. Currently, I'm doing the following: >> >> (defaction logout ((w foo-window)) >> (delete-session (context.application *context*) >> (context.session *context*)) >> (call 'login)) > > this is just fine (and very similar to what i've done occasionaly). > >> Is this OK? Is there a better way (maybe choosing the login entry >> point for the application)? > > sorry, i don't understand "choosing the login entry point for the > application" What I meant was to somehow specify that after deleting the session, ucw should behave just like if the user had written in his browser the URL associated with the entry point of the application (where he is presented with the login screen). Thanks a lot, Ant?nio Leit?o. From mb at bese.it Thu Jun 2 11:26:56 2005 From: mb at bese.it (Marco Baringer) Date: Thu, 02 Jun 2005 13:26:56 +0200 Subject: [Bese-devel] Logout in UCW In-Reply-To: <87acm9av8q.fsf@gia.ist.utl.pt> (Antonio Menezes Leitao's message of "Thu, 02 Jun 2005 11:49:57 +0100") References: <87oeaqm54i.fsf@gia.ist.utl.pt> <87acm9av8q.fsf@gia.ist.utl.pt> Message-ID: Antonio Menezes Leitao writes: > What I meant was to somehow specify that after deleting the session, > ucw should behave just like if the user had written in his browser the > URL associated with the entry point of the application (where he is > presented with the login screen). atm entry-points are not callable as if they were regular actions (though is on one of my todo lists somewhere). in the mean time: (call 'redirect-component :target "/index.ucw") -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From pupeno at pupeno.com Thu Jun 2 15:45:44 2005 From: pupeno at pupeno.com (Pupeno) Date: Thu, 2 Jun 2005 12:45:44 -0300 Subject: [Bese-devel] reaching other objects Message-ID: <200506021245.47121.pupeno@pupeno.com> Ok, my problem is more or less like this. I have a component: (defcomponent products-presentation (window-component) ...) which has two slots, one called menu and one called content. The menu slot is initialized (thru :component) to a list-presentation (a subclass of it) that I made. This list presentation shows a list of a slot-presentation I've done, called product-name-slot-presentation which unlike string, instead of being plain, they are links to an action, view-product, which is defined like: (defaction view-product ((product product)) ) Now, view-product should tell the products-presentation object to show that product, how can I do that ? (In short, I don't see a way to get a reference to products-presentation from view-product). The same thing happens with edit-from-listing, it should show the editor on content of product-presentation and not inside menu. What can I do to achieve this ? Thank you. -- Pupeno (http://pupeno.com) Reading ? Science Fiction ? http://sfreaders.com.ar -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From pupeno at pupeno.com Fri Jun 3 00:39:13 2005 From: pupeno at pupeno.com (Pupeno) Date: Thu, 2 Jun 2005 21:39:13 -0300 Subject: [Bese-devel] reaching other objects In-Reply-To: <429F5CCB.6040208@tech.coop> References: <200506021245.47121.pupeno@pupeno.com> <429F5CCB.6040208@tech.coop> Message-ID: <200506022139.16394.pupeno@pupeno.com> On Thursday 02 June 2005 16:23, Drew Crampsie wrote: > What i do is keep the 'output component' in a slot of the 'menu' > component like > > (defcomponent output () > ()) > > (defcomponent menu () > ((output :initarg :output :accessor output)) > > (defaction view-from-menu ((menu menu) component-to-view) > (call-component (output menu) component-to-view)) Ok to that, but there are slithgt differences in my situation which makes the difference I believe. What you call here menu (in my case it's product-lister) is not a component directly, but a presentation, it is defined as: (defpresentation product-lister (list-presentation) ((product-name :label "Name" :slot-name 'name :editablep nil)) :editablep t :Deleteablep t) I've read the defpresentation macro, but I couldn't find how to put a slot there (the slot would point to the content component). The other problem, even when I solve that problem is view-from-menu, in my case called view-product is defined as follows (I don't know what to put on it yet): (defaction view-product ((product product)) ) while it is called by present-slot: (defmethod present-slot ((slot product-name-slot-presentation) instance) ( (http://pupeno.com) Reading ? Science Fiction ? http://sfreaders.com.ar -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From frido at q-software-solutions.de Tue Jun 7 07:24:25 2005 From: frido at q-software-solutions.de (Friedrich Dominicus) Date: Tue, 07 Jun 2005 09:24:25 +0200 Subject: [Bese-devel] SBCL and UCW In-Reply-To: <87oeaqm54i.fsf@gia.ist.utl.pt> (Antonio Menezes Leitao's message of "Wed, 01 Jun 2005 17:08:45 +0100") References: <87oeaqm54i.fsf@gia.ist.utl.pt> Message-ID: <87d5qy39zq.fsf@flarge.here> Well I'm stuck a bit. I compiled UCW with SBCL 0.9.1.21 and that went fine. I modified start.lisp as suggested in the README but while accessing http://127.0.0.1:8080/ucw/examples/index.ucw I get: The value "ucw/examples/counter.tal" is not of type (OR FUNCTION SYMBOL). [Condition of type TYPE-ERROR] Restarts: 0: [SHOW-BACKTRACE] Send the client a backtrace page. 1: [RETRY] Clearout the response and retry calling the action. 2: [SERVER-ERROR] Send the client an internal server error page. 3: [ABORT-RESPONSE] Abort this response and answer another request 4: [ABORT] Exit debugger, returning to top level. Well I see that it's not a symbol or a function but what do I have to change to make that work? Regards Friedrich From frido at q-software-solutions.de Tue Jun 7 07:30:35 2005 From: frido at q-software-solutions.de (Friedrich Dominicus) Date: Tue, 07 Jun 2005 09:30:35 +0200 Subject: [Bese-devel] another question about sbcl and ucw Message-ID: <878y1m39pg.fsf@flarge.here> If I try to shutdown the server I got: (it.bese.ucw:shutdown-server it.bese.ucw:*default-server*) There is no applicable method for the generic function # when called with arguments (# "OJScjimxtrgWDIFILBfZwYrclZPiJnmBpnzUkBDD" T). [Condition of type SIMPLE-ERROR] Restarts: 0: [ABORT] Abort handling SLIME request. 1: [ABORT] Exit debugger, returning to top level. Backtrace: 0: ((SB-PCL::FAST-METHOD NO-APPLICABLE-METHOD (T)) # # # (# "OJScjimxtrgWDIFILBfZwYrclZPiJnmBpnzUkBDD" T)) 1: ((SB-PCL::FAST-METHOD NO-APPLICABLE-METHOD (T)) # # # (# "OJScjimxtrgWDIFILBfZwYrclZPiJnmBpnzUkBDD" T)) 2: ((LAMBDA (SB-PCL::.ARG0. &REST #1="#<...>" . #1#)) # #) so it seems my system is messed up in many ways.. FYI I have run tla replay in the ucw subdirectory and that just tells me: tla replay * tree is already up to date so it seems I'M using the most actual version. My system is a AMD64/Debian/unstable Regards Friedrich From smoof-ra at elder-gods.org Fri Jun 24 21:09:44 2005 From: smoof-ra at elder-gods.org (Larry D'Anna) Date: Fri, 24 Jun 2005 17:09:44 -0400 Subject: [Bese-devel] some documentation Message-ID: <20050624210944.GA171@melkor.elder-gods.org> I think it would be nice to have some documentation as to how arnesi-style continuations differ from the ones most people are likely to be familiar with. I wrote up an explanation. I think it's correct. If it is then it'd be nice to put it in the docs directory for people to read. --larry -------------- next part -------------- (in-package #:it.bese.arnesi) ;; I'll explain this below (eval-when (:compile-toplevel :load-toplevel :execute) (setq *call/cc-returns* t)) ;; Arnesi continuations are not quite identical to scheme ;; continuations. Since only part of the program is translated into ;; cps it is not really possible for a continuation to represent the ;; entire future of the computation. Instead it represents the future ;; of the computation, up to the point that we most recently entered ;; cps-transformed code. (or called a continuation from inside cps ;; code) Therefore the result of calling a continuation (or entering ;; cps-transformed code via with-call/cc or by calling a cps style ;; function or method) is not to abort our current computation and ;; switch to a different one like it is in scheme, but to initiate a ;; cps computation and return it's result to our current one. thus ;; the following snippet will print (foo bar) as well as (foo baz) ;; whereas in scheme it would only print (foo bar) because in arnesi ;; the call to the continuation returns, whereas in scheme it never ;; does. (with-call/cc (print (list 'foo (let/cc k (k 'bar) 'baz)))) ;; Also note that the entire form returns (foo baz) and the ;; discarded return value of (k 'bar) is (foo bar). ;; Now to explain the stuff at the top: In scheme if you run (call/cc ;; x) and x returns a value then (call/cc x) simply returns that same ;; value. This is not the default behavior or arnesi, although ;; setting *call/cc-returns* to t will provide it. The default ;; behavior is abort to the most recent "cps entry-point" and return ;; the value from there. This is useful for implementing coroutines ;; because if calling a continuation doesn't abort a computation then ;; you pretty much have no other way of doing so. With ;; *call/cc-returns* set to nil the above computation will only print ;; out (foo bar) and it will return baz (eval-when (:compile-toplevel :load-toplevel :execute) (setq *call/cc-returns* nil)) (with-call/cc (print (list 'foo (let/cc k (k 'bar) 'baz)))) ;; Here is an example of how to use this construct to implement coroutines ;; It should print out the first 10 pyramid numbers. (defmacro coro (&body body) (with-unique-names (coro) `(let (,coro) (with-call/cc (flet ((yield (x) (let/cc k (setq ,coro k) x))) (yield :ok) , at body)) #'(lambda (x) (funcall ,coro x))))) (let* ((tri-cr (coro (loop with num = 0 for i = 1 then (1+ i) do (yield (incf num i))))) (pyr-cr (coro (loop with num = 0 do (yield (incf num (funcall tri-cr nil))))))) (loop for i from 1 to 10 collect (funcall pyr-cr nil))) From mb at bese.it Sat Jun 25 11:04:35 2005 From: mb at bese.it (Marco Baringer) Date: Sat, 25 Jun 2005 13:04:35 +0200 Subject: [Bese-devel] some documentation In-Reply-To: <20050624210944.GA171@melkor.elder-gods.org> (Larry D'Anna's message of "Fri, 24 Jun 2005 17:09:44 -0400") References: <20050624210944.GA171@melkor.elder-gods.org> Message-ID: Larry D'Anna writes: > I think it would be nice to have some documentation as to how > arnesi-style continuations differ from the ones most people > are likely to be familiar with. I wrote up an explanation. > I think it's correct. If it is then it'd be nice to put it > in the docs directory for people to read. thanks, a lot. i'm going to perform some minor edits and add it the docs directory. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From mb at bese.it Sat Jun 25 13:21:34 2005 From: mb at bese.it (Marco Baringer) Date: Sat, 25 Jun 2005 15:21:34 +0200 Subject: [Bese-devel] wall-time In-Reply-To: <20050623114018.GD98995@pvv.ntnu.no> (astor@pvv.ntnu.no's message of "Thu, 23 Jun 2005 13:40:18 +0200") References: <20050623114018.GD98995@pvv.ntnu.no> Message-ID: astor at pvv.ntnu.no writes: > Which means that I end up patching ucw and make it depend on clsql > instead of using its own wall-time. What do you guys do? It seems > you can't store a ucw::wall-time into a clsql view seamlessly. yeah, that's a bit of ugliness i should probably work around. what i wanted to avoid was adding a dependency on clsql just for its wall-time implementation. on the other hand i have no intention of implementing my own time implmentation, nor using universal-time. i'm open to suggestions. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From mb at bese.it Sat Jun 25 13:24:01 2005 From: mb at bese.it (Marco Baringer) Date: Sat, 25 Jun 2005 15:24:01 +0200 Subject: [Bese-devel] lambda and call/cc In-Reply-To: <20050623141123.GA6123@melkor.elder-gods.org> (Larry D'Anna's message of "Thu, 23 Jun 2005 10:11:24 -0400") References: <20050623141123.GA6123@melkor.elder-gods.org> Message-ID: Larry D'Anna writes: > If I understand it correctly, the reason you can't have a call/cc > inside a lambda is that then you have lambdas floating around that > needed to be called with the call/cc convention rather then the usual > one, and there's no way to tell them apart. If this is the case then > it should be possible to add operators lambda/cc and funcall/cc that > can be used to make and call cps lambdas. Am I on the right track > here? yes you are. however implmenenting funcall/cc correctly (or the more general apply/cc) will require you to, almost, reimplente lisp's execution semantics. this i a route i'm currently studying but have gotten stalled by the more immediate need to have a UCW which 80% works instead of a broken 95% implemetaton. :( -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From smoof-ra at elder-gods.org Sun Jun 26 06:13:27 2005 From: smoof-ra at elder-gods.org (Larry D'Anna) Date: Sun, 26 Jun 2005 02:13:27 -0400 Subject: [Bese-devel] values of k are getting re-cps-transformed Message-ID: <20050626061327.GA7117@melkor.elder-gods.org> There's a bug where continuations expressions that represent continuations are getting cps-transformed. You can see it if you try this: (defvar *x* 'foo) (defvar *y) (defun/cc erg () (print *x*)) (with-call/cc (progn (call/cc (lambda (k) (setq *y* k) :ok)) (erg))) It it tries to cps-transform a continuation that contains a (throw 'done #) because erg is a defun/cc. My patch is in smoof-ra at elder-gods.org--stuff/arnesi--mine--1.4 which is in the archive http://elder-gods.org/~larry/tlastuff If that doesn't work I can just send a diff to the list. --larry From smoof-ra at elder-gods.org Sun Jun 26 19:18:31 2005 From: smoof-ra at elder-gods.org (Larry D'Anna) Date: Sun, 26 Jun 2005 15:18:31 -0400 Subject: [Bese-devel] parens Message-ID: <20050626191831.GA10062@melkor.elder-gods.org> Somehow I messed up the parens on the patch I sent to the list last night, so if you tried it and it didn't work that's why. It's fixed now. --larry From mb at bese.it Sun Jun 26 20:04:25 2005 From: mb at bese.it (Marco Baringer) Date: Sun, 26 Jun 2005 22:04:25 +0200 Subject: [Bese-devel] parens In-Reply-To: <20050626191831.GA10062@melkor.elder-gods.org> (Larry D'Anna's message of "Sun, 26 Jun 2005 15:18:31 -0400") References: <20050626191831.GA10062@melkor.elder-gods.org> Message-ID: Larry D'Anna writes: > Somehow I messed up the parens on the patch I sent to the list last > night, so if you tried it and it didn't work that's why. It's fixed > now. ah, ok. i only had time to take a very quick look at it. i'll try again. p.s. - your archive is missing the listing directory, which means i have to resort to curl to get the patches. mind doing "echo it sure does > /path/to/archive/=meta-info/http-blows; tla archive-fixup" ? -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From mb at bese.it Sun Jun 26 20:16:13 2005 From: mb at bese.it (Marco Baringer) Date: Sun, 26 Jun 2005 22:16:13 +0200 Subject: [Bese-devel] parens In-Reply-To: <20050626191831.GA10062@melkor.elder-gods.org> (Larry D'Anna's message of "Sun, 26 Jun 2005 15:18:31 -0400") References: <20050626191831.GA10062@melkor.elder-gods.org> Message-ID: Larry D'Anna writes: > Somehow I messed up the parens on the patch I sent to the list last > night, so if you tried it and it didn't work that's why. It's fixed > now. colud i ask you another big favor? bind submitting a few test cases which trigger this use case? From smoof-ra at elder-gods.org Sun Jun 26 21:21:39 2005 From: smoof-ra at elder-gods.org (Larry D'Anna) Date: Sun, 26 Jun 2005 17:21:39 -0400 Subject: [Bese-devel] parens In-Reply-To: References: <20050626191831.GA10062@melkor.elder-gods.org> Message-ID: <20050626212139.GB10570@melkor.elder-gods.org> * Marco Baringer (mb at bese.it) [050626 16:06]: > > i'm currntly working an implementing a lisp interpreter with support > for continuations, it currently handles most special opertaros and > (funcall lambda) [but not call/cc yet until i figure a good > representation for continuations (good meaning "easily" > serializable)]. have a look at the arnesi--cps-interpreter--1.4 branch > of arnesi. A continuation can hold arbitrary pointers to lisp data though. How could you serialize one in a way that would be meaningful outside of the lisp image it originated from? Or is that not a requirement? --larry From smoof-ra at elder-gods.org Sun Jun 26 21:33:42 2005 From: smoof-ra at elder-gods.org (Larry D'Anna) Date: Sun, 26 Jun 2005 17:33:42 -0400 Subject: [Bese-devel] parens In-Reply-To: References: <20050626191831.GA10062@melkor.elder-gods.org> Message-ID: <20050626213342.GC10570@melkor.elder-gods.org> * Marco Baringer (mb at bese.it) [050626 16:16]: > Larry D'Anna writes: > > > Somehow I messed up the parens on the patch I sent to the list last > > night, so if you tried it and it didn't work that's why. It's fixed > > now. > > colud i ask you another big favor? bind submitting a few test cases > which trigger this use case? Do you mean like a web example that uses ucw? Any time you have a call to a defun/cc occur after a call/cc in the same function the bug will manifest. It's because you have a (throw 'done #) in your k, and the call/cc transformer passes k into cps-transform. --larry From smoof-ra at elder-gods.org Tue Jun 28 17:35:54 2005 From: smoof-ra at elder-gods.org (Larry D'Anna) Date: Tue, 28 Jun 2005 13:35:54 -0400 Subject: [Bese-devel] lambda and call/cc In-Reply-To: References: <20050623141123.GA6123@melkor.elder-gods.org> Message-ID: <20050628173554.GA27858@melkor.elder-gods.org> * Marco Baringer (mb at bese.it) [050625 09:24]: > Larry D'Anna writes: > > > If I understand it correctly, the reason you can't have a call/cc > > inside a lambda is that then you have lambdas floating around that > > needed to be called with the call/cc convention rather then the usual > > one, and there's no way to tell them apart. If this is the case then > > it should be possible to add operators lambda/cc and funcall/cc that > > can be used to make and call cps lambdas. Am I on the right track > > here? > > yes you are. however implmenenting funcall/cc correctly (or the more > general apply/cc) will require you to, almost, reimplente lisp's > execution semantics. Are you sure? It seems to me that as long as you insist that the user remember whether his functions are plain lambdas or lambda/cc's then it's easy. I wrote it up and it seems to work. It's in the latest revision (patch-3) of my local branch. smoof-ra at elder-gods.org--stuff/arnesi--mine--1.4 at http://elder-gods.org/~larry/tlastuff I've added funcall/cc, apply/cc, and lambda/cc which are described above. Also there's call/cc$ which expects a lambda/cc and behaves as if *call/cc-returns* is true. In that same revision is jump/cc which calls a user-visible continuation (ie one make with make-call/cc-k) with scheme-like semantics; it never returns. I haven't tested all this stuff extremely throughly, but it's nifty and seems to work. For example: (with-call/cc (print (let/cc$ k (print 'a) (jump/cc k 'b) (print 'c) 'd))) will print a and b, and return b. --larry From mb at bese.it Wed Jun 29 10:04:00 2005 From: mb at bese.it (Marco Baringer) Date: Wed, 29 Jun 2005 12:04:00 +0200 Subject: [Bese-devel] lambda and call/cc In-Reply-To: <20050628173554.GA27858@melkor.elder-gods.org> (Larry D'Anna's message of "Tue, 28 Jun 2005 13:35:54 -0400") References: <20050623141123.GA6123@melkor.elder-gods.org> <20050628173554.GA27858@melkor.elder-gods.org> Message-ID: Larry D'Anna writes: > I haven't tested all this stuff extremely throughly, but it's nifty > and seems to work. For example: > > (with-call/cc > (print (let/cc$ k > (print 'a) > (jump/cc k 'b) > (print 'c) > 'd))) > > will print a and b, and return b. applied. i tested it on the few apps i'm working on today and it looks good. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From mb at bese.it Wed Jun 29 10:10:23 2005 From: mb at bese.it (Marco Baringer) Date: Wed, 29 Jun 2005 12:10:23 +0200 Subject: [Bese-devel] lambda and call/cc In-Reply-To: (Marco Baringer's message of "Wed, 29 Jun 2005 12:04:00 +0200") References: <20050623141123.GA6123@melkor.elder-gods.org> <20050628173554.GA27858@melkor.elder-gods.org> Message-ID: "Marco Baringer" writes: > applied. i tested it on the few apps i'm working on today and it looks > good. since archzoom is back here's the url for this patch: http://common-lisp.net/cgi-bin/archzoom.cgi/bese-2004 at common-lisp.net/arnesi--dev--1.4--patch-13?log p.s. - i added your archive to cl.net's revision library (so that your single patches can be viewed), if you have a problem with this tell me and i'll remove it. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From lavigne.eric at gmail.com Tue Jun 28 23:53:13 2005 From: lavigne.eric at gmail.com (Eric Lavigne) Date: Tue, 28 Jun 2005 23:53:13 +0000 Subject: [Bese-devel] broken links on arnesi page Message-ID: <51e1bc3005062816534cd73cb9@mail.gmail.com> The download links at the bottom of the arnesi page are broken. The page is here: http://common-lisp.net/project/bese/arnesi.html Each link in the "releases" section are broken. They can be fixed by removing "arnesi/" from each of them. Eric Lavigne