Hopbot log for 2009-10-27 - Helma IRC channel: #helma on irc.freenode.net

2009-10-27:

[9:19] <triotex> Hi all! I have a short definition question: "functions called on an object are called methods." --> are global functions also methods?
[9:20] <triotex> I'm reading the helma docs and it might be good to define a unique name for this purpose.
[9:23] <triotex> and you can also use global.someglobfunct to invoke it. so is every function call a "method call"?
[9:28] <simono> triotex, hi
[9:30] <simono> you can think of methods that way but in a way it's not possible do invoke a function no on an object, since at the very least its the global obj ;)
[9:30] <triotex> btw triotex = botic = philipp :)
[9:30] <simono> oh hi wtf why do we talk in IRC
[9:30] <triotex> maybe some other guys have an idea how to use the term method ;-)
[9:40] <simono> this link is broken and i can't find the page via wikisearch http://helma.org/docs/howtos/mod_jk/
[9:45] <triotex> btw. here are 3 screencasts for my fellow students: http://www.youtube.com/view_play_list?p=203482D29EED96DC
[9:46] <triotex> all in german and not very well done, but maybe a help for helma newbs
[13:04] <simono> hm, what am i doing wrong with ng file write:
[13:04] <simono> file = require('file'); file.write('/home/simon/test.json', 'a test', 'w');
[13:04] <simono> creates an empty file :(
[13:17] <simono> aha close() doesn't flush(), got it
[14:25] <simono> my first NG app that does something ;) http://github.com/oberhamsi/jsclitter
[15:40] <hannesw> simono_: nice!
[16:04] <simono_> thanks, i actually use it as twitter client ;)
[16:06] <simono_> who
[16:06] * simono_ is struggling with new client, sorry
[17:30] <simono> hannesw_, is it itentional that TextStream.close() doesn't implicitly flush() ?
[18:18] <hannesw_> simono: close() usually implies flush()
[18:18] <hannesw_> if i close a java outputstream, it is always flushed
[18:27] <simono> maybe i'm using it wrong, this line leaves an empty file:
[18:27] <simono> file = require('file'); file.write('/home/simon/test.json', 'a test', 'w');
[18:34] <simono> hannesw_, i see it doesnt make sense but putting a stream.flush() right before the stream.close() line fixes it for me
[18:34] <simono> then this works: require('file').write('/home/simon/test2.json', 'foo bar');
[18:35] <hannesw_> hm, and it doesn't work without the flush()?
[18:35] <simono> withouth flush it just creates an empty file
[18:35] * hannesw_ investigates
[18:35] <simono> :)
[18:39] <hannesw_> ok, obviously java's Filter- and BufferedOutputStream flushes before closing, but that's not general outputstream behaviour
[18:40] <hannesw_> I thought it was
[18:40] <hannesw_> wondering if we should always use buffered streams... No.
[18:41] <simono> especially when using the require('file').write() shortcut.. probably not :)
[18:43] <hannesw_> yep, makes not much sense for file streams i think
[18:43] <hannesw_> ok, just pushed the fix
[18:44] <simono> thx
[22:12] <hannesw__> earl: http://groups.google.com/group/narwhaljs/browse_frm/thread/a7227c18d489c428
[22:13] <hannesw__> i think this is more or less what you were trying to do with jsdoc
[22:13] <hannesw__> except it's very hard with jsdoc, but easy with a string or array or whatever embedded in the function
[22:26] <earl> hannesw__: yes, that's like what i wanted to do
[22:26] <hannesw__> in python the docstring is within the function too, right?
[22:26] <earl> yes
[22:28] <earl> but i guess JS would need some multi-line string syntax for that to be feasible
[22:29] <earl> if you have a look at the "example.js" in http://gist.github.com/219927
[22:29] <hannesw__> <doc>asdfasdfasdfasdfasdf</doc>
[22:29] <hannesw__> a use case for e4x, maybe :)
[22:30] <earl> hm, nice idea :)
[22:30] <earl> that would certainly make for a very nice hack :)
[22:30] <hannesw__> and it's easy to parse via regex
[22:31] <hannesw__> only restriction is nested html must be well-formed :)
[22:31] <earl> mhm
[22:32] <earl> would be somewhat easy to hack into the parser as well, i guess
[22:33] <hannesw__> yes, but would that be necessary if you can just do toString/toSource?
[22:33] <earl> no, not necessary
[22:34] <earl> function foo() { <doc> This is a test! </doc>; return 42;
[22:34] <earl> }
[22:34] <earl> looks strange :)
[22:34] <earl> but, well
[22:46] <earl> mhm, works nicely
[22:48] <earl> http://helma.pastebin.com/m7c2e0258
[22:48] <hannesw__> nice!
[22:48] <hannesw__> where's doc.js?
[22:49] <earl> js hacked the narwhal thing into submission
[22:50] <earl> just*
[22:51] <earl> http://helma.pastebin.com/m58060200
[22:54] <hannesw__> very cool!
[22:57] <hannesw__> earl: are you on the narwhaljs group?
[22:59] <hannesw__> I think you might ping them with your version (not that they're going to switch, narwhal is least common denominator JS so no E4X I guess...
[22:59] <hannesw__> )
[23:00] <earl> nope, i'm not on narwhaljs
[23:01] <earl> e4x seems to also allow empty tags
[23:01] <earl> so <> </> might be another option
[23:02] <hannesw__> yes, but I like some minimal self-explanatoriness of what this is
[23:03] <earl> i'd still prefer having jsdocs attached to funcs, somehow
[23:03] <earl> how big a hassle is it to get from a function to the source filename it came from?
[23:04] <hannesw__> well, it will never be foolproof to map jsdocs to functions
[23:04] <earl> hm
[23:04] <earl> so you'd be open to pervasively adapt something like <doc/> within helma?
[23:05] <earl> (hng, that is)
[23:06] <earl> i'm not sure i like the looks of it, but with the help of some syntax hilighting i guess i could get used to it :)
[23:10] <hannesw__> yes, although duplicate docs would be strange (jsdoc + nested)
[23:11] <hannesw__> btw, <>...</> looks ok, too (just tried it)
[23:12] <hannesw__> i'd be willing to switch to nested docs
[23:12] <hannesw__> problem is you can only document functions...
[23:12] <earl> <doc>...</doc> at the top of a module should work as well
[23:13] <earl> (syntactically, not that the code above would parse it)

 

 

In the channel now:

Logs by date: