NPEs in Tubes

2 views
Skip to first unread message

Michael Harrison (goodmike)

unread,
Apr 21, 2009, 2:23:48 PM4/21/09
to Clojure Study Group Washington DC
I recall we talked about this a bit at the meeting, so please forgive
me if I'm forgetting something critical...

I've cloned Luke's code, and I've added the path to tubes-demo/src,
and I can happily use and load files...

But when I try running the code in test.tube, I get a super unhelpful
error message and stack trace for a NullPointerException. The closest
the trace seems to come to non-framework code is something like
5. user$eval__1533.invoke(NO_SOURCE_FILE:1)

Luke (or anyone), what was it that threw NPEs during the demo on
Sunday? Maybe it's the same thing getting me.

Cheers,
Michael

Michael Harrison (goodmike)

unread,
Apr 21, 2009, 3:16:31 PM4/21/09
to Clojure Study Group Washington DC
OK, I can use load-pipe and then execute the function that evaluates
to. So, sorry to complain. I just hate that feeling that comes when
you're getting an error and it feels familiar....

One twitter builder component coming up.

mh

On Apr 21, 2:23 pm, "Michael Harrison (goodmike)"

Serge Wroclawski

unread,
Apr 21, 2009, 4:36:33 PM4/21/09
to clojure-...@googlegroups.com
I haven't tried to get it running yet, but if it's unintuitive, maybe
someone can write a quick INSTALL document?


- Serge

Luke VanderHart

unread,
Apr 21, 2009, 7:38:51 PM4/21/09
to Clojure Study Group Washington DC
Yeah... what happens is that the code in the *.tube files expects to
be run within a specific context - that is, when a particular var
(*pipe*) is set. I use the Clojure Var feature (thread local, stack-
based reference type) to ensure that it is available when parsing a
*.tube file. You can see this at line 13 of engine.clj - the actual
*.tube file is loaded on line 16, within the binding.

I should probably go through and put in catches that re-throw
meaningful exceptions that will help say whether exceptions happened
in the parsing, the engine, or in which component.

Thanks,
-Luke

On Apr 21, 2:23 pm, "Michael Harrison (goodmike)"
<goodmike...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages