I seem to remember from way back in early Mac developing, if certain variable names were kept to 4 characters they were compiled directly, but variable names over 4 were tokenized and added an additional dereference step during execution. Does anything like that still exist in RR?
Thanks,
Walt
A Question From The Old Days
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
A Question From The Old Days
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
From http://www-psych.stanford.edu/~pinto/hc3.html :
Mark
Best regards,How long can a variable name be?
--------------------------------
According to Winkler and Kamins in _HyperTalk 2.2: The Book_,
comments and blank lines are stripped before runtime and make no
difference in speed, and short variable names also have no impact on
speed. Both of these are listed as myths on pages 49. And
longDescriptiveVariableNames do make program code so much
more readable and understandable, for yourself 6 months to a year
from when the code was written and for anyone trying to learn from
your code.
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 10045
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Throughout both OS X and Windows there are a number of constants which, in languages that compile to native objects code, often compile to integers. Mac OS is historically fond of 4-byte constants for many things, such as the codes for special folder paths noted at:
http://developer.apple.com/documentatio ... 4g-C006668
For example, in C you could use the constant " kPreferencesFolderType" and with the header Folders.h it will compile to "pref".
Interestingly, you can pass those constants to Rev's specialFolderPath function to determine the paths to folders beyond the range Rev provides its own constants for, as noted at Ken Ray's site:
http://sonsothunder.com/devres/revoluti ... ile010.htm
But since Rev operates more like a virtual machine than a traditional compiler, that's about as far as it goes, and these conventions for some constants don't affect variables in any way, as Mark noted.
http://developer.apple.com/documentatio ... 4g-C006668
For example, in C you could use the constant " kPreferencesFolderType" and with the header Folders.h it will compile to "pref".
Interestingly, you can pass those constants to Rev's specialFolderPath function to determine the paths to folders beyond the range Rev provides its own constants for, as noted at Ken Ray's site:
http://sonsothunder.com/devres/revoluti ... ile010.htm
But since Rev operates more like a virtual machine than a traditional compiler, that's about as far as it goes, and these conventions for some constants don't affect variables in any way, as Mark noted.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn