? Lowerdash Beta ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Lowerdash Beta

Submitted
Updated
Author
kldck_hul
Public Key
N334J313
Min. Compat.
All
Version
0.7.3 beta
Size
65 KB
Rating
13 votes
Description

Lowerdash is an object-oriented language extension for SmileBasic v3.

It simplifies the structure of your code for you, leaving you free to focus on ambitious projects that can be compiled and distributed. It extends the SmileBasic instruction set to include fast constant dictionaries, namespaced modules and adds objects running on a dynamic memory model. Modules are designed to be used with or without dynamic objects. INCLUDES A PACKAGE MANAGER CHECK OUT THE MANUAL! REPORT ALL THE BUGS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Last update: 10/25/16 - New minor version removing privacy... ! 10/22/16 - New minor version with _ 10/18/16 - New minor version with bug fixes 8/27/16 - Small bug fix 8/26/16 - Updated to 0.7 beta 3/20/16 - Updated to 0.6.5 beta 2/28/16 - Spicy new spoiler tags! 2/24/16 - Added code for 0.6 beta 2
Instructions To use Lowerdash initially, load "LDC" into PRG2. EXEC "PRG2:LDC"

Lowerdash 0.7 introduces an entirely new compiler architecture. This lets Lowerdash be a more flexible language

See the manual for usage!

Guides

  1. Starting Out With Lowerdash
  2. Ways to use Lowerdash
  3. Debugging in Lowerdash
BALL.PRG - Accelerometer influenced ball object-oriented demo. HELLO.PRG - A hello world demo. LD.KEYS - Changes the editor keys to simple text macros for Lowerdash features. LOWERDASH - The Lowerdash runtime and standard library. Automatically loaded in PRG3 by the compiler. LDC - The Lowerdash compiler. Should be loaded in PRG2. Slot not used at runtime. LPM - Package manager for copying libraries. TEMPLATE - Sample main layout with stubs. __PKG - file describing Lowerdash to LPM. Can install compiler & runtime. _{CLASSES} - files loaded by the demo programs
Notes

LIMITATIONS:

- No ON...GOSUB yet - No inline elseifs (I was too lazy to parse ifs in a loop... should be easy to add) - Calling a command like a function results in a command call with a single argument.

Version History:

Version 0.7 Beta: Garden Parsley ----------------------------------------- This release features an entirely new architecture, with separate lexing and parsing - meaning powerful new features can be implemented N334J313 - remove module level privacy from members. You can now set a member or var from anywhere after looking it up. These games. You no need security. - fix a bug with "dot" not respecting the type of the left-hand operand BUGS: 8EDX83A4 - remove static dispatch from lookups on me. Static properties will now be found dynamically if they are being called this way. Which is slightly slower - add _ as a placeholder for the current module. Lookups on _ will be statically dispatched, and if not found, will be a compile-time error. BUGS: some calls to the "dot" operator will stringify the left-hand side under incorrect conditions 45W372QE - fix multiple FOR...IN uses in one def - != is now an operator - fix lookup on static names such as MyModule.static BUGS: WXNEY3JJ - fix array literals - fix module labels, added case for gosub from def BUGS: - multiple FOR...IN uses in one def redeclare the loop vars - I didn't declare != as an operator. WHOOPS! J534DV3E - New . (dot) operator - New instantiation syntax - Cleaner function and command calls from lookups - More tolerant, punctuation aware lexing - restrictions on colons, quotes, and operators are all gone - Find more syntax errors, earlier BUGS: - array literals are not initialized - module labels are slightly malformed Version 0.6.5 Ballerific-er Beta: ----------------------------------------- This release adds a few missing features and fixes critical bugs in preparation for a refactor 2383C3HE - Array literals - DO can now take arguments - Fixed a serious bug with deleting string type members - Bug fixes BUGS: Version 0.6 Ballerific Beta: ----------------------------------------- QKAEAX73 - Bug fixes - IMPORTs inside an IMPORT are now compiled first, so that their VARs are visible. (They are still only compiled once) - PROTO() does not use dynamic dispatch to find the next prototype - Added TYPE to dynamically dispatch to the type of me BUGS: - While using _DEBUG, RETURNing from a command (not function) early will cause a slightly wrong call history NRSDAXTD - Improved error messages - PROTO() - DO() - Bug fixiest yet. BUGS: √ IMPORT from inside a file being compiled quotes its argument, so the string needs to be unquoted (Whoops!) √ ERR requires a string. It should be more lenient to print numbers. √ PROTO recurses once; 3 or more nested PROTO() calls will cause a stack overflow. THIS IS ONLY THE ACCESSOR, INHERITANCE WORKS Version 0.5 Ogiri Beta ----------------------------------------- 5KV4N8NV - Proto parsing fix BUGS: [COMMON] DEFs cannot immediately follow a MODULE (STATIC and EXPORT can) COMPILE_LIB uses the removed function chomp$ Closing a MODULE with END results in an error. Modules with members will overwrite inherited members 43x3x336 BUGS: Static lookups may chain to the wrong prototype. Dynamic lookups are unaffect. FEATURES: - Change how instances work - Fewer slots taken up - Deallocating memory - EACH - VAR parsing with REGEX patch Version 0.4 BETA ----------------------------------------- XKE8N53P CK33E3RJ BUGS: * _ lookup on instance member setters fails Parse multiple Lowerdash expressions per line. Imports, Module labels and Module-level access to + namespacing on module vars. Compile libraries that don't include the Lowerdash runtime to be used in other Lowerdash projects! Version 0.3 BETA ----------------------------------------- E45QF3L4 Faster runtime at expense of slower constructor. Module Vars, Typed Members, Nil$, Parsing fixes. You can't use : as a line separator. Version 0.2 BETA ----------------------------------------- RADQA3Z4 Initial public release with hot off the stylus prototypal inheritance.

Roadmap

0.7: - Generate parser using REGEX - Standard Lib .Lib - Improved Iterator commands 0.8 - Incremental compile - plugin system 0.9 - 2-pass static resolver plugin (no me("") needed) - private plugin 1.0 - Macros Future: - import Lowerdash into your library to save spaaaaaace in your files - Array members - Operators? - Better handling of :
Categories
Keywords
  • oop
  • lowerdash
  • objects
  • inheritance
  • methods
  • members
  • dictionary
  • object
  • oriented
  • programming
56 Comment(s) HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Are there any plans to port this to SB4? Now that I can actually use a keyboard I’m willing to give Lowerdash a shot. If kldck_hul is still inactive, I could try porting it. Is the GOSUB bug still in SB4? raimondz raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself There is a bug that appear on 3.5.2: GOSUB is ignored if it's called inside a def. This broke all the dictionaries generated by the compiler. If anyone is using lowerdash, then change the "gosub" to "goto" on the strings inserted on LDC and recompile your project. Since kldck_hul has been inactive a long time, I'll upload a bugfix of this issue. banana banana RNG Hidden Easter Eggs Disguised Hidden Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength I have made a key for a Lowerdash with:
  1. Function lookup fixed
  2. GOSUB bug fixed
Key: KNQXG1
HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Sorry for necroposting, but what changes did you make to the function lookup? banana banana RNG Hidden Easter Eggs Disguised Hidden Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength I feel this might be useless, as the key is unavailable, but I want to explain the changes and the reasoning behind them: The "t_func" function in LDC declares a variable "R$" for the output, but returns one of it's parameters with an extra left parenthesis, so, for example, in the call «t_func(CHR$(34)+"fun"+CHR$(34),"x,y")» returned «"fun")» instead of the desired «CALL("fun",x,y)». So, for the actual changes: DEF t_func(N$,A$) VAR R$="CALL("+N$ IF LEN(A$) THEN INC R$,","+A$ INC R$,"," RETURN R$ END HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website I don't know if I downloaded this. Can you repost it? banana banana RNG Hidden Easter Eggs Disguised Hidden Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength No problem: [SDLXC38E] HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Thanks!
banana banana RNG Hidden Easter Eggs Disguised Hidden Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Bug Report: Code: module math STATIC DEF add(a,b) return a+b end end print math.add(1,2) Gives an error and the line compiled results PRINT _("math","add")) banana banana RNG Hidden Easter Eggs Disguised Hidden Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength How does MDICT works? kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself MDICT stand for "Mutable Dictionary" The short answer: I haven't implemented this yet. Long answer: One of the idea with the upcoming versions of Lowerdash is to move as many library functions to separate files as possible. MDICT was planned to simply point to some automatic import - e.g. some _DICT.LIB library code. Right now, it looks like 12me21 has the fastest dictionaries with his library. I currently am looking at refactoring his code to do automatic type-casts to support all data types. If there's a definite need here, I can definitely fast-track this feature. (Shouldn't be too hard to argue, they are dictionaries...) Mr_Mo Mr_Mo Promoted Page My page was promoted on SmileBASIC Source! Achievements Video Games I like to play video games! Hobbies Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Hey cool! this'll be my first OOP language. raimondz raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Hi, I tried to make a program using the last version of lowerdash but there is a problem with the parser: it doesn't detect the operator "!=" correctly. For example, if I put this code inside a module: IF A!=0 THEN ? "ENTER" then it says "Expected Then but found Number" on the error. PS: The dot operator works great. That's one of the features that I wanted since you started this famework. Thanks raimondz raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Hi again, I found a way to fix this issue. I did this change on the label "@2" in the function lex: @2 EP=P:ACT=22 IF S$[P-1]=="!" && S$[P]=="=" THEN INC EP GOTO @E The problem was that != wasn't recognized as an operation. It took me some time to figure out how the code works. kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself That code probably took some time to understand because I have a generator for it. ;) Of course, leave it to me to forget that != is an operator... Wheres that test coverage program when you need it? raimondz raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself I suggest that you use sprites instead of graphic for ball.prg because the drawing functions are too slow. In O3DS the speed test give the following values: Spirtes: 71542 Drawing lines: 18811 With that, the demo will slow down when the number of balls is greater than 30. kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself The speed test I ran were without any graphics. The largest slow down is in doing the context switching between the various ball or entity instances. If you take a look at Sprint, I use a sprite with most of the same control logic as the balls. The entity limit is very similar at ~25. Of course, Sprint has a lot more OOP going on. Nevermind, not quite comparable things... EDIT: I'll probably still update the demo. Working with sprites is still something most people need an example for. EDIT2: I am completely prepared to buy a hat and eat it. MCGamer20000 MCGamer20000 Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Minecraft Is Awesome! I love Minecraft! Express Yourself First Month Joined in the very first month of SmileBASIC Source Website Could you add support for : as a line separator? That's the one thing that is discouraging me from using Lowerdash. kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself You can use " : " but there is a gotcha. The current parser can't find two LD statements that separated by " : " - mostly because it can't tell if the symbol is inside a string. In the future, this won't be the case. You can write lines of SB with only LD expressions, and it will compile fine. I figured statements and expressions might be a little too confusing to think about for beginners, so thats why the limitation exists. I also find readability goes out the window if you're doing anything too complex and trying to fit it on one line. It's also worth noting that having commands on successive lines is faster than using : and does not make your program larger. Yttria Yttria Head Admin Won the "Captain's Award" in the 4th Ogiri contest: http://smilebasic.com/en/ogiri4/
Captain's Comment This is exactly the sort of thing we anticipated when developing the SmileBASIC language in the way that we did. Excellent! More like this, please!
ChangeV ChangeV Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Staff Pick "Your program is one of our favorites!" - Staff Achievements Congratulations!
16bitcoder 16bitcoder Do you mind IF I make this A REAL CODING LANGUAGE? With credit to you ofcoarse (*cough*Before they start the language and make something so they are reminded YOU MADE THIS *cough**cough*) Well excuse me... kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself What do you mean a real coding languages? ;p And I might actually be confused what you mean. If you're taking about building a library, Lowerdash was built for that. See Ways to Use if you want to publish something that runs on top of Lowerdash. I have mixed feelings on an actual fork of the compiler since its still evolving. With the move to Regex, syntax can be added and removed through plugins; and I'll make that a public interface in a future release. randomous randomous Robot Hidden Easter Eggs Second Year My account is over 2 years old Website Drawing I like to draw! Hobbies So... how stable is your syntax specification? If I start making a project that's going to take months, am I going to be messed up if Lowerdash updates? RNGesus RNGesus looks like random is starting to become interested in making SB games. I wanna see what you make! kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself I'm happy with where the syntax is at. Going forward I really only want to add a few additional commands for sweetening entity systems. With REGEX in place, commands like EACH might gain more "attributes". One thing that I am considering going into 0.6, was brought up by AGAaron: Should MODULE have a MODEND or similar tag? Right now, the compiler can infer when to close the Module in every situation; but is this the BASIC way of doing it? randomous randomous Robot Hidden Easter Eggs Second Year My account is over 2 years old Website Drawing I like to draw! Hobbies I think you should do whatever is consistent. If END is used for some top-level constructs, it should probably be used for all of them. That being said, making it optional (if possible) would be nice. kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself 0.6 has an optional END for MODULES. It does look slicker with it I gotta say. Should be the last syntax I touch. Hopefully. randomous randomous Robot Hidden Easter Eggs Second Year My account is over 2 years old Website Drawing I like to draw! Hobbies I'm sorry I never commented, but this is still REALLY impressive. I hope you continue to work on it, and I'm sorry the website doesn't provide the best place for documentation. I'll probably use this for a large project... if I ever make one. Super_Defaultio Super_Defaultio Video Games I like to play video games! Hobbies Day Person I like the warm sunshine and wake up early! Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself #randomouscrapBigProject 2016 Chemicalex Chemicalex Drawing I like to draw! Hobbies Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength osu! Is Awesome! I love osu! Express Yourself ^ kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Did I make ELSEIF not work again... ? Super_Defaultio Super_Defaultio Video Games I like to play video games! Hobbies Day Person I like the warm sunshine and wake up early! Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Can you use this to make 3d games/raycasting fster? kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself No, but you can use this to make 3D games/raycasting at the exact same speed. kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself To expand on this: When SmileBasic BIG comes out, we'll have ample performance to handle more complex 3D scenes and Lowerdash's overhead won't be noticeable. Lowerdash will make it easy to think about 3D design patterns such as scene graphs, and can enable advanced 3D techniques given a fast enough processor. NeatNit NeatNit First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself This is very interesting, but at the same time very confusing - especially since I can't try it for myself just yet! Some questions: 1. Where did the name Lowerdash come from? 2. Can you give an example of something that this makes easier? (Vanilla SB code vs Lowerdash code) 3. Do you think this improves readability, or decreases it? 4. Have you tested the speed of Lowerdash compared to equivalent vanilla SmileBASIC code, and if so, what were the results? More technical: 5. How many lines is the main Lowerdash program? 6. How long does it take to compile a simple module, for example, the BALL in the screenshot? You don't have to answer all at once :) kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Great questions! 1. Lowerdash is a play on the Javascript libraries Underscore and Lodash. Instead of providing functional sugar, it provides low level sugar. 2. This is going to be a huge answer... :P 3. I think this greatly improves readability. Your code is split apart by functionality. Variable names can be shorter or more descriptive and they don't have to be unique. 4. Yep. The speed has been improving with each release. Right now, 0.4 of Lowerdash is only a few frames slower (2-4) when avoiding lookups. Objects created using new have to have their properties looked up with a function that adds only about 6 more instructions per call. 5. 318 lines runtime. 283 lines compiler. 6. The BALL module is nearly instant. My current project has several thousand lines of code in close to 15 files. The compile time is around 1-2 seconds. Its fast enough that you do not have to distribute compiled code. kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself I should add I program on a New 3DS. I haven't tested on an original in any way. kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself The speed of statics (not using lookups) is also mostly because they are function calls instead of labels. I'm adding labels in the future, and the only cost you'll incur using those is going between the PRG slots. Super_Defaultio Super_Defaultio Video Games I like to play video games! Hobbies Day Person I like the warm sunshine and wake up early! Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Just wondering, what exzactly is this used for? kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself From the description: "It provides a framework for writing structured modular code, that can be compiled and distributed." Modern programming languages often have constructs in them that let programmers compartmentalize logic and reuse code. SmileBasic harkens back to the old (dark) days, where your program is one big soup of "stuff"; And this soup can be physically painful to a software engineer. Lowerdash attempts to provide shortcuts and "sweeten" the experience of programming in SmileBasic. Real world use cases might include: * a physics library that is self contained (you don't have to copy paste it in) that lets you add 2d mass to anything with an (X,Y) coordinate. * An AI module that makes enemies have randomized, intelligent behavior. * Making a UI with buttons that can be stamped on the screen with different text and icons raimondz raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself I found a bug. I made a private method in a module to apply gravity based on a certain angle. I load the module's members and then use this condition to limit the gravity If VX*VX+VY*VY > GM*GM THEN VX=GM*COS(A) VY=GM*SIN(A) ENDIF but after running my program, lowerdash generate this: If VX*VX+VY*VY > GM*GM THEN ENDIF VX=GM*COS(A) VY=GM*SIN(A) ENDIF I don't know if this is enough to detect where is the cause of the bug, but If you need more details I can post a pic or upload the code. kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Thanks for reporting this! The IF... THEN parsing was kind of a last minute hack to enable me references in both statements. I think this might be caused by an extra space after THEN. Regardless, I will be improving the parsing for IF statements next release. raimondz raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself I check the code and indeed that was the cause. Now I can go on with my project. Thanks. joelable joelable First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies This is pretty cool! I like the idea of custom commands! MasterR3C0RD MasterR3C0RD Helper Received for being very helpful around SmileBASIC Source Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself I really freaking wish this was for NodeJS That would be SO COOL! kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Shhh! You might give away my plans to turn 3DS's into highly redundant RESTful micro-services! MasterR3C0RD MasterR3C0RD Helper Received for being very helpful around SmileBASIC Source Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself Lol kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself We have a modem! raimondz raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself This look good.However: -Can I do nested module on this framework? - the fact that you couldn't delete will cause memory leak, right? kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Theres no syntax for nested modules. Having another module in the same file just ends the previous module and starts a new one. You can however create a constant or variable that points to another module. subMod->"mySubMod" ... _(myMod("subMod"), "meth") VAR subMod = "mySubMod" ... In the future I want to add a me$ accessor so this can be more dynamic per instance. For the memory leak question: YES. Implementing a minheap and storing that information in a symbol table is somewhat trivial at this point, but I still have to do it. I imagine V0.3 or V0.4 will let you deallocate memory. You can also build a singleton module with its own array that you use as an object pool. When you're done with an object it can return to the pool, so its allocated memory can be reused. kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself the VAR subMod would only be available inside DEFs, and is not instance specific BTW. EXPORT DEF update ... CALL _(subMod$, "stuff") ... END kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself I made a demo using object pools: http://smilebasicsource.com/page?pid=61
1 2