I'm looking to write some beginner friendly tutorials for Lowerdash and wanted to gauge the average ability in the community.
What are peoples reactions to this example?
I tried to only use "namespaces" and nothing else from LD.
@Alex hit the nail on the head!
@Arthur Vanilla SB has everything I would've wanted first starting out. Its great you're converting your kids :p
MODULE does two things used this way: 1. scoping 2. create a convenience DEF to look through that scope.
I left #2 out of this example.
If you were to add:
EXPORT DEF new
then the module can be used as a class.
Im loving the better phrasing you guys
I have a few questions about this syntax and surely I'll have more as I'm very interested in Lowerdash. The SBS docs are a bit overwhelming. Classes would make some of my programs much easier to program though.
Do the percentage "%" signs signify they are local in scope to the module?
Can you tell me more about instancing & updating objects after creating a class?
@BBB % is an int. # double. $ string.
If you go to the docs, you can type #section at the end of the address bar. Ill use them to be brief.
A module with a #CONSTRUCTOR can be instantiated with #NEW. Instances are referenced through strings.
#EXPORT Defs are methods.
You should also get a setter for each #MEM (ber), but there is great bug.
Thank you for all the help! You are the developer?
To clarify, did you want me to look at the "Structure" section of your documentation?
What is the maximum integer value? What about double?
Oh okay, so any module can be a class? Cool.
I would love an example of this!
I'm not sure what members, getters/setters are and your last message was a bit cryptic to me.
I was trying to direct you to the individual commands. Structure is the reference for your main file. The list of class commands is in Dynamic objects under #objects.
Int,Double, and string are SmileBasic things. Ints are 1byte. Doubles are... 8?
Yep any module. I would recommend passing/using the Module object unless you have members.
Methods, members, getters and setters are common names when talking about class data
Methods are things the class knows how to do. EG a ball can bounce
Members are things that belong to that class. EG a yoyo has a string.
Getters and setters are a design pattern where Members are exposed with Methods. EG a cashier has money in their drawer and can take your money and put it in the same drawer.
SmileBASIC ints are 32-bit signed, two's compliment. 1-byte ints would be worthless. Doubles are just regular doubles like you would see in any computer.