[Laszlo-dev] org.openlaszlo.sc.CompilerError: class names only differ by upper/lower case: "Top" versus "top"
Donald Anderson
dda at ddanderson.com
Wed Aug 6 12:10:28 PDT 2008
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080806/1560f3a4/attachment-0001.html
More information about the Laszlo-dev
mailing list