[Laszlo-dev] case sensitivity in Laszlo
Chris Lyman
clyman at apprenticeis.com
Wed Jan 19 06:37:46 PST 2005
For what it's worth, there is/was a similar situation with
ColdFusion. With the advent of version 6, the runtime was ported to
Java; Java is case sensitive while CFML is not. Nine time out of ten
this isn't a problem, but when you need to either use JSP code or make a
SOAP call that utilizes Axis it becomes a problem. It causes a lot of
problems with newer developers who become used to lax case sensitivity
and then are 'jarred' into having to trace down variable name
mis-matches over a relatively obscure SOAP call.
I would suggest that option three will be the least problematic
over the long term, that is if Laszlo were able to weather out the
broken apps that will be certain to pop up when LPS moves to Flash 7. I
also have a feeling that option three will lend itself better to
importing outside SWFs, RPC calls, as well as yet unknown runtime
engines.
Best Regards,
Chris
-----Original Message-----
From: laszlo-dev-bounces at openlaszlo.org
[mailto:laszlo-dev-bounces at openlaszlo.org] On Behalf Of P T Withington
Sent: Tuesday, January 18, 2005 10:22 PM
To: OpenLaszlo platform development and bug reporting
Subject: [Laszlo-dev] case sensitivity in Laszlo
The Laszlo language is based on XML and ECMAScript, which are both
case-sensitive languages. However, until recently, the Laszlo language
has been compiled to Flash 5 or 6 byte codes, and the Flash runtime
does not enforce case sensitivity for versions before 7 (Flash binaries
have a target version embedded in them, and the Flash runtime enforces
case sensitivity according to the target runtime).
We are starting to work on alternative runtimes and on generating Flash
7 byte codes, all of which will enforce case sensitivity. This brings
up several technical and stylistic issues. Currently:
o In ECMAScript, the types are captialized (e.g., Undefined, Null,
Boolean, String, Number, Object), by convention, classes are also
capitalized (e.g., Function, Array, Date).
o XML is also case sensitive, but by convention tags and attributes are
written in lower case.
o In LZX, we have used XSD types for the type property of attributes.
The compiler automatically maps a subset of built-in XSD types (e.g.,
string, integer, float, double, boolean, date) to the corresponding
ECMAScript type or class, so that, for instance, the XSD type "string"
corresponds to the ECMAScript type "String".
o In LFC (Laszlo Foundation Classes), which are written in ECMAScript,
classes are defined in capitalized camel case, using an "Lz" prefix.
There is a compile- and run-time mapping from tag names to classes, so
that the tags have simple, lower-case names. E.g., <view ... /> maps
to LzView. This mapping is documented by noting the class that
corresponds to each tag. This mapping is not extensible.
o In LZX components, we have named our classes using lower case, so
that the class names corresponded to the tag name. E.g, <class
name="button" ... /> defines the tag <button ... />
People are uncomfortable with this complicated story. Three ideas have
been proposed for making it simpler:
1. Capitalize all class names, change all tags that are implemented by
such classes to have capitalized names, e.g., <Canvas ... />, <View ...
/>, etc.
2. Make up a rule that <class name="foo" ... /> creates a class named
Foo, but you still instantiate it with a tag <foo ... />.
3. Maintain the status quo. Create a style guide that suggests using
lower-case names for classes that define tags. Create lower-case
aliases for the built-in types and classes.
Comments?
_______________________________________________
Laszlo-dev mailing list
Laszlo-dev at openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
More information about the Laszlo-dev
mailing list