[Laszlo-dev] org.openlaszlo.sc.CompilerError: class names only differ by upper/lower case: "Top" versus "top"
P T Withington
ptw at pobox.com
Wed Aug 6 13:22:13 PDT 2008
You'll need some more encoding, as Chuq points out -- where will
`class BAr` and `class BaR` and &c. go? Or do you just plan to create
subdirectories as needed each time you get a conflict?
On 2008-08-06, at 16:04EDT, Donald Anderson wrote:
> Yeah, probably the same bonehead that mandated that backslash be the
> DOS file separator.
>
> But remember - any subdirectory names we choose are only known to
> us, and put in the $TEMPDIR/lzswf9/lzgenXXX dir.
> And if we wanted to be a little cute, we could allocate file names
> on a first-seen first-serve in the top directory with 'overflow'
> into numbered directories.
> class foo - put into ./foo.as
> class bar - put into ./bar.as
> var Foo - put into ./0/Foo.as
> class Bar - put into ./1/Bar.as
>
> That would normally have the effect of having everything in the top
> directory and occasional entries in unique subdirectories.
>
> I just tried an experiment building an lfc by hand with variable
> 'lime' and 'Lime' using this technique, and it appears to work.
>
>
> On Aug 6, 2008, at 3:36 PM, P T Withington wrote:
>
>> <flame>
>> Wow.
>>
>> Is the bonehead who decided your file name must match your class
>> any relation to the bonehead who decided that line breaks had to be
>> represented by CR _and_ LF?
>> </flame>
>>
>> <sigh />
>>
>> On 2008-08-06, at 15:10EDT, Donald Anderson wrote:
>>
>>> I don't think AS3 is the problem, the HFS+ file system is.
>>> And even if you take global vars out of the picture,
>>> you have the issue of someone that wants
>>> both class foo and class Foo in the same program.
>>> If you want to allow that (and I think AS3 probably does),
>>> we need a way to do that. Putting the global vars into their
>>> own subdirectory just splits the namespace into two. Admittedly
>>> a bandaid, but maybe good enough.
>>>
>>> I tried creating a java program creating names files with names
>>> "\u0041" and "\u0061".
>>> The second failed, since this is exactly equivalent to creating
>>> "A" and "a".
>>>
>>> http://forums.macosxhints.com/showthread.php?t=14607
>>>
>>> is one of many places that confirms that HFS+
>>> is case preserving, but it does not distinguish between upper and
>>> lower case.
>>>
>>> My recollection is that Windows FAT32 has some similar
>>> properties. So I think we are stuck
>>> with subdirectories as a solution, and it's our choice how
>>> sophisticated we want to be with that.
>>>
>>> - Don
>>>
>>> On Aug 6, 2008, at 1:39 PM, P T Withington wrote:
>>>
>>>> Surely in AS3 you can have a global and a class that only differ
>>>> in case. In which case, we need a different strategy for how we
>>>> implement global vars.
>>>>
>>>> On 2008-08-06, at 13:15EDT, Henry Minsky wrote:
>>>>
>>>>> I think the flex compiler, like Java, requires that the file
>>>>> name be
>>>>> the same as the top level definition which
>>>>> it publishes, so there's not any choice of file name for a given
>>>>> global declaration.
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Aug 6, 2008 at 12:13 PM, P T Withington <ptw at pobox.com>
>>>>> wrote:
>>>>>> Maybe we just need to come up with an encoding for the names to
>>>>>> indicate
>>>>>> case. Is the filesystem case-insensitive if you use a utf8
>>>>>> filename?
>>>>>>
>>>>>> On 2008-08-06, at 09:36EDT, Donald Anderson wrote:
>>>>>>
>>>>>>> Well, I think both 'var top' and 'class Top' are competing for
>>>>>>> file name top.as vs. Top.as.
>>>>>>>
>>>>>>> We can always use subdirectories to distinguish names (I
>>>>>>> think!).
>>>>>>> Your idiom seems natural to me, and makes it seem like we
>>>>>>> should try it. For example, all globals are pushed to their
>>>>>>> own directory:
>>>>>>> global/top.as
>>>>>>>
>>>>>>> You still wouldn't be able to have classes or globals that
>>>>>>> aren't distinguished within their own set. If we wanted full
>>>>>>> distinguishing, we'd have to do something like:
>>>>>>>
>>>>>>> 0/ClassName.as
>>>>>>> 1/AnotherClassName.as
>>>>>>>
>>>>>>> yuck.
>>>>>>>
>>>>>>> - Don
>>>>>>>
>>>>>>> On Aug 6, 2008, at 8:51 AM, P T Withington wrote:
>>>>>>>
>>>>>>>> I should have included my example code:
>>>>>>>>
>>>>>>>>> <canvas debug="true" >
>>>>>>>>> <script when="immediate">
>>>>>>>>> var free = 'outer';
>>>>>>>>>
>>>>>>>>> class Top {
>>>>>>>>> function test () { return free; }
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> class Sub extends Top {
>>>>>>>>> var free = 'inner';
>>>>>>>>>
>>>>>>>>> function test () { return free; }
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> var top = new Top;
>>>>>>>>> var sub = new Sub;
>>>>>>>>> Debug.info("top.test() => %s", top.test());
>>>>>>>>> Debug.info("sub.test() => %s", sub.test());
>>>>>>>>> </script>
>>>>>>>>> </canvas>
>>>>>>>>
>>>>>>>> There is only one class Top. Is the check overly conservative?
>>>>>>>>
>>>>>>>> On 2008-08-06, at 08:39EDT, Donald Anderson wrote:
>>>>>>>>
>>>>>>>>> That check is in because classes must be named to files.
>>>>>>>>> Class Glorp must be in file Glorp.as. But some file systems
>>>>>>>>> including MacOS, do not have complete distinguishing between
>>>>>>>>> case:
>>>>>>>>>
>>>>>>>>> $ echo foo >> glorp.as
>>>>>>>>> $ echo bar >> Glorp.as
>>>>>>>>> $ cat glorp.as
>>>>>>>>> foo
>>>>>>>>> bar
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Aug 6, 2008, at 8:06 AM, P T Withington wrote:
>>>>>>>>>
>>>>>>>>>> Why am I getting this error when compiling to swf9?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>>
>>>>>>>>> Don Anderson
>>>>>>>>> Java/C/C++, Berkeley DB, systems consultant
>>>>>>>>>
>>>>>>>>> voice: 617-547-7881
>>>>>>>>> email: dda at ddanderson.com
>>>>>>>>> www: http://www.ddanderson.com
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> Don Anderson
>>>>>>> Java/C/C++, Berkeley DB, systems consultant
>>>>>>>
>>>>>>> voice: 617-547-7881
>>>>>>> email: dda at ddanderson.com
>>>>>>> www: http://www.ddanderson.com
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Henry Minsky
>>>>> Software Architect
>>>>> hminsky at laszlosystems.com
>>>>
>>>
>>>
>>> --
>>>
>>> Don Anderson
>>> Java/C/C++, Berkeley DB, systems consultant
>>>
>>> voice: 617-547-7881
>>> email: dda at ddanderson.com
>>> www: http://www.ddanderson.com
>>>
>>>
>>>
>>
>
>
> --
>
> Don Anderson
> Java/C/C++, Berkeley DB, systems consultant
>
> voice: 617-547-7881
> email: dda at ddanderson.com
> www: http://www.ddanderson.com
>
>
>
More information about the Laszlo-dev
mailing list