I have installed weblocks and I'm stuck

106 views
Skip to first unread message

Jacek Podkanski

unread,
Oct 1, 2012, 7:50:13 PM10/1/12
to webl...@googlegroups.com

I have created new application
(wop:make-app :webtrial "/home/jacek/quicklisp/local-projects/")

registered it with ASDF
(ql:register-local-projects)
 
started the web app
(ql:quickload 'webtrial)

and started the app
(webtrial:start-webtrial :port 3000)

First problem:
file init-session.lisp contains:
    (with-html
          (:strong "Happy Hacking!") )

When I edit the text nothing changes unless I restart emacs and slime. Is there any better way to do it?

Second Problem:
What code goes where?
In rails you are told edit file X, edit file Y, but here I have no clue if I need to edit some file or use REPL

Third:
I like the idea of Weblocks, but I wonder if the project has been abandoned. No new development or documentation in last two years.
I am trying Weblocks because I had no success with similar Rails equivalents, which also were abandoned. In Weblocks I can at least get to demo page. Doing this kind of Ajax stuff by hand is a pain and I was wondering if if there's a better way. I wonder if Weblocks is my last hope or there are other similar projects.


Scott L. Burson

unread,
Oct 1, 2012, 8:30:13 PM10/1/12
to webl...@googlegroups.com
On Mon, Oct 1, 2012 at 4:50 PM, Jacek Podkanski <ruby....@googlemail.com> wrote:

When I edit the text nothing changes unless I restart emacs and slime. Is there any better way to do it?

INIT-USER-SESSION is called only when the session is created.  When Weblocks first receives a request from a particular browser, it creates a session and calls INIT-USER-SESSION to create the initial widget tree.

Do (reset-sessions) in the REPL to discard all current sessions, so that the next browser request will get a new session.

BTW, using a function directly as a widget, as the example version of INIT-USER-SESSION does, is a bad idea.  The function should be passed to MAKE-WIDGET, whose result should then be made a child of the root widget.  We should fix the example.
 
Second Problem:
What code goes where?
In rails you are told edit file X, edit file Y, but here I have no clue if I need to edit some file or use REPL

Weblocks pays no attention to file names; you can organize your code into files however you like.
 
Third:
I like the idea of Weblocks, but I wonder if the project has been abandoned. No new development or documentation in last two years.
I am trying Weblocks because I had no success with similar Rails equivalents, which also were abandoned. In Weblocks I can at least get to demo page. Doing this kind of Ajax stuff by hand is a pain and I was wondering if if there's a better way. I wonder if Weblocks is my last hope or there are other similar projects.

I am using Weblocks for a substantial web app.  I agree, the lack of documentation is a significant barrier.  But the code actually works pretty well, once you learn how to use it.

For a new project, you might want to take a look at my Weblocks fork, which has a fair number of bug fixes and new features.  (No new documentation, though.)  You can find it at

  http://github.com/slburson/weblocks

-- Scott

Jacek Podkanski

unread,
Oct 1, 2012, 8:57:54 PM10/1/12
to webl...@googlegroups.com
Hi,

I have forked your project. Thank you for the prompt answer. It's getting late now. I'll have at it tomorrow.

Paulo Geyer

unread,
Oct 2, 2012, 7:04:04 AM10/2/12
to webl...@googlegroups.com
cool, just starred the repository, it is the weblocks installed by quicklisp?

I have this problem too (I need more documentation), I'm new to emacs and common lisp, and want to try weblocks, currently I'm trying to get better with emacs and learn more about slime

--
You received this message because you are subscribed to the Google Groups "weblocks" group.
To view this discussion on the web visit https://groups.google.com/d/msg/weblocks/-/7hADOkcCoMwJ.

To post to this group, send email to webl...@googlegroups.com.
To unsubscribe from this group, send email to weblocks+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/weblocks?hl=en.

Jacek Podkanski

unread,
Oct 2, 2012, 9:42:08 AM10/2/12
to webl...@googlegroups.com
Yes, Weblocks can be installed by Quicklisp. I'm afraid you have to document your steps as you go and then share them with others. I think only this way you can create newbie friendly documentation.

Scott L. Burson

unread,
Oct 2, 2012, 3:13:34 PM10/2/12
to webl...@googlegroups.com
Oh dear.  I don't know if I can recommend Weblocks as a way to learn Common Lisp.  You'll need to read the Weblocks code to understand how to use it, and that may not be so easy.  Well, give it a try if you want, but be aware you're jumping in to the deep water.

My fork is not the one installed by Quicklisp.  You'll need to clone it locally and get Quicklisp to load it instead.  There are a couple of ways to do this; I still use the old way:

% create an "asdf" directory e.g. /path/to/asdf
% in that directory, make a symlink to weblocks.asd (the one in the tree you cloned)
> (push #p"/path/to/asdf" asdf:*central-registry*)
> (ql:quickload "weblocks")

-- Scott

Jacek Podkanski

unread,
Oct 2, 2012, 4:59:23 PM10/2/12
to webl...@googlegroups.com
I guess I know enough Lisp to understand the code. https://github.com/bigos/Pyrulis/blob/master/Lisp/hyperspec-decorator.user.js

The problem is with the bigger picture. with some frameworks if you start with some kind of kind of main file then you can work your way around and learn the stuff even with poor documentation. Going through the files I have managed to work out what many functions are supposed to do. Still the framework is so different from anything I saw so far, it is going to be hard to understand unless I find something something about the bigger picture in the sparse documentation.

Robert Taylor

unread,
Oct 2, 2012, 6:14:15 PM10/2/12
to webl...@googlegroups.com
On Tue, Oct 2, 2012 at 12:13 PM, Scott L. Burson <Sc...@ergy.com> wrote:
> Oh dear. I don't know if I can recommend Weblocks as a way to learn Common
> Lisp. You'll need to read the Weblocks code to understand how to use it,
> and that may not be so easy. Well, give it a try if you want, but be aware
> you're jumping in to the deep water.
>

Funny you say that. As a newb I thought I could kinda figure it out.
I was totally wrong. The amount of Lisp knowledge required is way
above someone just noodling around can pick up on weekends.

I finally gave up and had to move to another framework that has a much
lower barrier to entry.


R.

Scott L. Burson

unread,
Oct 2, 2012, 6:41:46 PM10/2/12
to webl...@googlegroups.com

Yes.  I was actually quite impressed, while reading the code, how many advanced CL techniques and idioms Slava learned and applied -- and applied them correctly and appropriately, at that.  Macros, multimethods, daemon methods, method combination, metaclasses and the meta-object protocol, lambda expressions everywhere, ... Don't get me wrong; I think the code is actually remarkably clean for an open-source project, and I don't think these features are abused at all.  I enjoy working on it.  But it's not a good codebase for a Lisp beginner.

-- Scott

Message has been deleted

nunb

unread,
Oct 21, 2012, 11:37:53 AM10/21/12
to webl...@googlegroups.com

Yes.  I was actually quite impressed, while reading the code, how many advanced CL techniques and idioms Slava learned and applied -- and applied them correctly and appropriately, at that. 

I agree, and for this reason I think it could serve as a good introduction to CL in all its glory. Siebel's PCL book is a good adjunct as well.
 
Macros, multimethods, daemon methods, method combination, metaclasses and the meta-object protocol, lambda expressions everywhere, 

The macros are the only things that get hairy, don't recall metaclasses (in views?) though. Tracing through the method combinations of data-grid is a bit trying, but also ultimately enlightening. Not sure what you mean by daemon methods (:before/:after?), but the code-base (and implementing your widgets in the same style) serves as a good, clean introduction to multimethods & MOPishness.

I particularly like that for an imperative programmer, it demonstrates a 'cleaner' approach within the imperative approach (localization of state, separation of concerns with method combinations etc).

Scott L. Burson

unread,
Oct 21, 2012, 1:11:41 PM10/21/12
to webl...@googlegroups.com
On Sun, Oct 21, 2012 at 8:37 AM, nunb <nandan....@gmail.com> wrote:

Yes.  I was actually quite impressed, while reading the code, how many advanced CL techniques and idioms Slava learned and applied -- and applied them correctly and appropriately, at that. 

I agree, and for this reason I think it could serve as a good introduction to CL in all its glory. Siebel's PCL book is a good adjunct as well.

Heh, I don't know if I would start someone out on CL by showing them Weblocks.  But it might be a good subject for an advanced course.
 
 
Macros, multimethods, daemon methods, method combination, metaclasses and the meta-object protocol, lambda expressions everywhere, 

The macros are the only things that get hairy, don't recall metaclasses (in views?) though.

There's a WIDGET-CLASS metaclass that's used to automatically mark widgets dirty when any of their slots are modified.
 
Tracing through the method combinations of data-grid is a bit trying, but also ultimately enlightening. Not sure what you mean by daemon methods (:before/:after?)

Yes, :before, :after, and :around methods are sometimes collectively called daemon methods.
 
, but the code-base (and implementing your widgets in the same style) serves as a good, clean introduction to multimethods & MOPishness.

I particularly like that for an imperative programmer, it demonstrates a 'cleaner' approach within the imperative approach (localization of state, separation of concerns with method combinations etc).

Agreed.

-- Scott
 
Reply all
Reply to author
Forward
0 new messages