Not that Im a huge generator expresions fan, but does this mean that g.e.s are going to be in the next Jython release?  Or is this targeted for jython 2.3? :)  I wonder how IronPython is going to number itself, it says its going for 2.4 compatibility but their on .9N at this juncture. :D

leouser

Frank Wierzbicki <fwierzbicki@gmail.com> wrote:
Fabio Zadrozny has worked on adding 2.4 features to his "branch" of
jython for this project:

http://pydev.sourceforge.net/

He has probably solved some of these problems already.

-Frank

On 11/27/05, Jiwon Seo wrote:
> Hello,
>
> I'm trying to implement generator expressions to Jython, but I'm not
> sure if I'm doing it right so I'm sending this email.
> As first step, I'm trying to add the grammar of generator expressions
> to Jython, so instead of calling SmartTestList() in atom(), I made it
> call SmartTestListGexp() like following,
>
> void atom() #void: {}
> {
> LOOKAHEAD(2) ( ) #tuple
> //| ( [SmartTestList()] )
> | ( [SmartTestListGexp()] )
> | ( [listmaker()] ) #list
> ...
>
> //SmartTestListGexp : test ( gen_for | (',' test)* [','] )
> void SmartTestListGexp() #void: {}
> { test() ( (gen_for())+ | (LOOKAHEAD(2) test())* [Comma()] #tuple(>1)) }
>
> //gen_iter: [gen_for | gen_if]
> //void gen_iter() #void: {}
> //{ [ (gen_for() | gen_if()) ] }
>
> //gen_for: 'for' exprlist 'in' testlist gen_iter
> void gen_for(): {}
> { exprlist() SmartTestList() (gen_if())* }
>
> And, I made genexpr mimic listcomp to see if the modified grammar
> works. But I'm getting ClassCastException; for instance when jython
> processes "(ab for ab in range(10))" processes, it gives me that
> ClassCastException when it processes first "ab" part. Any clue?
> Does the idea of "first implementing genexpr same as listcomp except
> for the grammar and make it lazy evaluated" not apply here?
>
> Thanks,
> -Jiwon
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> _______________________________________________
> Jython-dev mailing list
> Jython-dev@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-dev
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Jython-dev mailing list
Jython-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-dev


Yahoo! Music Unlimited - Access over 1 million songs. Try it free.