------ art_24118_26617923.1175689857136 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 4/3/07, Charles Oliver Nutter <charles.nutter / sun.com> wrote: > > Is there a historical reason why I can't do something like these: > > x tring > class x; end > > or > > def x; String; end > class x(); end > or any other combination of an arbitrary syntactic construct that might > produce a class? Was it done to simplify parsing or evaluation of classes? > > The reason I ask is for something in JRuby. In JRuby we can refer to > Java classes using a long-hand syntax: > > java.lang.System > > which basically calls methods java and lang to get "Package" objects, > and a System method to get a proxy class for the Java type. But with > this, we can't do: > > class java.lang.System; end > > to re-open the proxy class and add utility methods. i also had to programmatically define classes and came to the same idea. would be a cool feature. i went with class_eval and string evaluation to accomplish my task. -- henon - Charlie > > ------ art_24118_26617923.1175689857136 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 4/3/07, <b class mail_sendername">Charles Oliver Nutter</b> <<a href ailto:charles.nutter / sun.com">charles.nutter / sun.com</a>> wrote:<div><span class mail_quote"></span><blockquote class mail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Is there a historical reason why I can't do something like these:<br><br>x tring<br>class x; end<br><br>or<br><br>def x; String; end<br>class x(); end <br></blockquote><blockquote class mail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> or any other combination of an arbitrary syntactic construct that might<br></blockquote><blockquote class mail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">produce a class? Was it done to simplify parsing or evaluation of classes? <br><br>The reason I ask is for something in JRuby. In JRuby we can refer to<br>Java classes using a long-hand syntax:<br><br>java.lang.System<br><br>which basically calls methods java and lang to get "Package" objects, <br>and a System method to get a proxy class for the Java type. But with<br>this, we can't do:<br><br>class java.lang.System; end<br><br>to re-open the proxy class and add utility methods.</blockquote><div><br>i also had to programmatically define classes and came to the same idea. would be a cool feature. <br> i went with class_eval and string evaluation to accomplish my task.<br> -- henon<br></div><br><blockquote class mail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">- Charlie<br><br></blockquote></div><br> ------ art_24118_26617923.1175689857136--