[Laszlo-dev] For Review: Change 20090413-hqm-a Summary: generate a better name for anonymous subclass of canvas

P T Withington ptw at laszlosystems.com
Tue Apr 14 05:24:31 PDT 2009


Yeah, I think it's really that I just implemented the path computer's  
recursion incorrectly.  The canvas is supposed to have a path of '/',  
since it is the (unique) root.  Let me see if I can fix the computation.

Whether you want a prettier name for the class is perhaps another  
matter.  My point in using the path was simply that it would be unique  
and short.  Better than a gensym, which we can't guarantee unique in  
the face of imports, and shorter than a UUID, which we would have to  
use otherwise.  (The path computer creates a UUID as the root of each  
import, in order to keep import paths from colliding with canvas  
paths, but at least that is only one UUID per library, rather than one  
per each anonymous class.)

On 2009-04-13, at 23:59EDT, Henry Minsky wrote:

> My patch here feels like it is kind of at the wrong level of  
> abstraction,
> but we don't havea good way of explicitly telling the NodeModel   
> what you
> want the classname to be when
> it finally gets emitted (because it might or might not be a  
> gensym'ed name
> if there are methods
> on the NodeModel...)
>
>
>
> On Mon, Apr 13, 2009 at 11:29 PM, Henry Minsky  
> <henry.minsky at gmail.com>wrote:
>
>> Change 20090413-hqm-a by hqm at badtzmaru.home on 2009-04-13 22:57:58  
>> EDT
>>   in /Users/hqm/openlaszlo/trunk5
>>   for http://svn.openlaszlo.org/openlaszlo/trunk
>>
>> Summary: generate  a better name for anonymous subclass of canvas
>>
>> New Features:
>>
>> Bugs Fixed: LPP-7993
>>
>> Technical Reviewer: ptw
>> QA Reviewer: andre.bargull
>> Doc Reviewer: (pending)
>>
>> Documentation:
>>
>> Release Notes:
>>
>> Details:
>>
>> + Use the name "/canvas" as the 'pathname' for a class model whose
>> NodeModel has an empty path (down  the child containment
>> hierarchy from canvas)
>>
>> The only NodeModel with an empty node path will be an anonymous  
>> subclass of
>> the
>> canvas class, every other node will be a child of the canvas, right?
>>
>>
>> Tests:
>>
>> compile this with --script
>>
>> <canvas >
>> <handler name="oninit">
>>   Debug.write('foo');
>> </handler>
>> </canvas>
>>
>> See that the output .lzs file declares a named subclass of LzCanvas
>>
>>         dynamic class $lzc$class_$2Fcanvas extends LzCanvas {
>>
>> Files:
>> M      WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
>>
>>
>> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090413-hqm-a.tar
>>
>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com



More information about the Laszlo-dev mailing list