Fan looks like a great language and I really like the direction it's taking. As a web developer (meaning this is my current job) I checked the Hello World example and got straight to the web version. Unfortunately, I cannot get it running.
First thing is a typo in the code on the HelloWorld page:
new make()
{
req = (WebReq)Thread.locals["web.req"]
res = (WebRes)Thread.locals["web.res"]
}
req and res are declared:
**
** The WebReq instance for this request.
**
@transient readonly WebReq req
**
** The WebRes instance for this request.
**
@transient readonly WebRes res
And thus non-nullable. It looks like res is set to null hence the stacktrace.
Still, I haven't read the full manual so maybe I've made a mistake somewhere. I've been browsing the forum and documentation but couldn't find anything to fix that.
Could somemone have a look at it?
Thanks a lot,
Julien
PS: Maybe it's time to open a second forum where lambda users can post that kind of requests. After reading the topics, I don't feel this should be posted here but I haven't found any other place.
brianSun 18 Jan 2009
Julien,
I am very sorry about that. I noticed there was a bug in the example right after I did the last build. I pushed a fix to Mercurial for the next build.
In the meantime, there is a simple fix to the "examples/web/hello.fan" script
override Void setup()
{
// change from Hello() ctor to Hello# type literal
Sys.ns.create(`/homePage`, Hello#)
}
I just verified that and it should work, if not let me know.
Good catch on the docs also, I will push a fix for that.
julien Sun 18 Jan 2009
Hi all,
Fan looks like a great language and I really like the direction it's taking. As a web developer (meaning this is my current job) I checked the Hello World example and got straight to the web version. Unfortunately, I cannot get it running.
First thing is a typo in the code on the HelloWorld page:
The doGet() should be changed as onGet().
Second thing is a stacktrace:
The Weblet default constructor reads:
req and res are declared:
And thus non-nullable. It looks like res is set to null hence the stacktrace.
Still, I haven't read the full manual so maybe I've made a mistake somewhere. I've been browsing the forum and documentation but couldn't find anything to fix that.
Could somemone have a look at it?
Thanks a lot,
Julien
PS: Maybe it's time to open a second forum where lambda users can post that kind of requests. After reading the topics, I don't feel this should be posted here but I haven't found any other place.
brian Sun 18 Jan 2009
Julien,
I am very sorry about that. I noticed there was a bug in the example right after I did the last build. I pushed a fix to Mercurial for the next build.
In the meantime, there is a simple fix to the "examples/web/hello.fan" script
I just verified that and it should work, if not let me know.
Good catch on the docs also, I will push a fix for that.
Brian
julien Sun 18 Jan 2009
Brian,
It's working fine. Thank you!