2007-09-09:
[0:42] <rjb> e4x has a slight problem when you want to access an attribute called 'class'[0:43] <rjb> say, div.@class = 'foo'[0:43] <rjb> because class is a reserved word in ecmascript, it ain't legal[0:47] <rjb> which is highly unfortunate, because 'class' is an attribute you'd often want to set[13:09] <Lonnie> One good thing about building markup via an object model is that it provides a layer that can be used for resolving such conflicts. The DOM uses className for class. Perhaps, there needs to be a thin layer between E4X and ECMAscript for resolving keyword conflicts.[13:18] <rjb> well unless i've overlooked something, it's like this[13:19] <rjb> with e4x, one can access/set/modify attribute values like[13:20] <rjb> this:[13:20] <rjb> <x attr="val"/>.@attr == 'val';[13:21] <rjb> if in place of attr you have an ecmascript reserved word, the parser barfs[13:22] <rjb> (on its occurrence following the .@, where an identifier token is expected)[13:25] <Lonnie> I suspect that (behind the scenes) closures are creating identifiers with the exact same name at the literals you specify.[13:25] <Lonnie> (as)[13:25] <Lonnie> (not at)[13:26] <rjb> the parser would prevent you likewise from setting a 'class' property on o plain js object, if you tried the syntax[13:26] <rjb> o.class = 'foo';[13:27] <rjb> but there, you have the alternative of indexing on string literals rather than identifiers, like so:[13:27] <rjb> o['class[13:27] <rjb> sorry[13:27] <rjb> o['class'] = 'foo'; //this does work[13:28] <rjb> e4x seems to fail to provide something like that[13:28] <Lonnie> I'm surprised that works.[13:29] <Lonnie> I thought they were equivalent.[13:31] <Lonnie> The latter method is often used when you are generating code (during your script) that is later executed (during that same script).[13:33] <rjb> right, because it allows you to use a string variable instead of a literal identifier[13:34] <rjb> in e4x you can in fact write[13:34] <rjb> var x = <div class="foo"/>;[13:35] <rjb> but i can't see any way to access or modify the value of the class attribute afterwards[13:36] <rjb> i really hope i did overlook something, otherwise this is a serious bug in the spec[13:39] <Lonnie> Yeah, I'm reading a little about e4x. I was surprised that an interpreter would understand " = <element >." I wouldn't know how to extend ecmascript to understand such syntax; E4x must be written at a lower level than ecmascript. I don't think you can extend ecmascript to understand such things at the scripting level.[13:41] <Lonnie> I'm surprised you don't have to use quotes, but I see and desire the convenience of not using quotes.[13:43] <Lonnie> Have you tried className instead of class?[13:44] <Lonnie> It could be that they followed the DOM's convention for this. That seems tacky though.[14:22] <Lonnie> .@["class"][14:24] <Lonnie> http://life.neophi.com/danielr/2006/04/flex_2_beta_2_actionscript_3_a.html[14:26] <Lonnie> xml.component.(@\u0063lass == "package1.MyButton");[14:26] <Lonnie> using Unicode value for the letter c (0063)[14:27] <Lonnie> A comment was made that said this would work to:[14:27] <Lonnie> xml.component.(attributes("class") == "package1.MyButton");[14:29] <rjb> hey, thanks[14:29] <rjb> i thought i'd tried that already and it didn't work - but it does[14:29] <Lonnie> You're welcome.[14:29] <rjb> i must have made some other mistake[14:31] <rjb> & yes .attributes() works for fetching the value, but not for assingment[14:31] <rjb> assignment*[14:31] <rjb> .@['class'] does do everything i want though[14:41] <rjb> http://www.partlyhuman.com/blog/roger/as3-e4x-rundown seems pretty good[14:41] <rjb> funny my google searches didn't bring it up[14:42] <rjb> ok, i had forgotten that actionscript could be a relevant term here[14:43] <Lonnie> my search was: e4x class attribute[14:44] <Lonnie> Yeah, those actionscript folks aren't learning in vane.[14:46] <Lonnie> I've always avoided flash because it is proprietary, but they've been fooling with *serious* ECMAscript for longer than most other developer groups.[20:27] <ebthelp> hello all[20:27] <ebthelp> does anyone here have experience with helma/lucene search?[20:29] <ebthelp> ill be here if anyone can help, im looking to hire a contractor$ to help me[20:30] <zumbrunn> there is the helma.Search module written by Robert Gaggl that could help[20:30] <zumbrunn> http://helma.zumbrunn.net/reference/helma/Search.html[20:30] <zumbrunn> and the jala IndexManager[20:31] <zumbrunn> http://helma.zumbrunn.net/reference/jala/IndexManager.html[20:31] <ebthelp> awesome thanks! any idea how i could reach Robert Gaggl ?[20:31] <zumbrunn> he is on the helma mailing list[20:32] <ebthelp> k[20:33] <ebthelp> hmm do i wantt to post something on the board to reach him ??[20:34] <ebthelp> http://www.nabble.com/Helma-f2589.html[20:34] <zumbrunn> sure, you might find others that can help as well[20:34] <ebthelp> k thanks[20:35] <zumbrunn> http://helma.org/development/mailinglists/[20:37] <zumbrunn> there also is a search extension that Robert wrote for the gobi app[20:37] <zumbrunn> http://adele.helma.org/source/viewcvs.cgi/gobi/extensions/search/?cvsroot=apps[20:38] <zumbrunn> but I assume it's GPL, in case that matters[20:38] <zumbrunn> (gobi is GPL)[20:38] <ebthelp> k thanks
In the channel now:
Logs by date: