August 30, 2016
Part 1: Creating *Juliar * Modules in Python
August 30, 2016
- Juliar.exe ---Main *Juliar * Language
- Juliar.pyc -- The Helper file. Every module you make in Python for * Juliar * must include this. A more experienced person might be wondering, "Do we need to include this file? Can't we make our own?" Although, you can make your own, *Juliar * is an evolving language, and it would be simpler to replace "Juliar.pyc" than to change your project files. It is highly recommended that you use this helper file.
- example.py -- The example file (we won't be using it except for reference).
return "Hello Friend!"*Please NOTE that each def REQUIRES (content,optionals): Get used to using that!Save the file!That's it! You just created your first *Juliar * module in Python! It's as simple as that. As you know, it should output "Hello" and let's test it.Open up "Juliar.exe" and type in *hello *Hmm, it says that the command hello is not found...Where did we go wrong?Right, we didn't import the module...so let's import it now.Type in:
*import=py myfirstmod.py *If everything goes correctly, it should output that you successfully imported commands! The command that should be displayed is hello. Let's test it again.Type in:
*hello *It should output "Hello Friend!" You can create MORE Modules the same way just by following the pattern of:
return somethingIn "myfirstmod.py" file add a new command greet:
return "Hello my dear friend "+contentCan you guess what this command will do? Make sure to save the file and let's go back to "Juliar.exe"Let's execute command *greet Andy *You'll get an error....? Why?Well, the module we imported originally did not have greet command. We need to re-import the myfirstmod.py.Let's do that now. Type in:
*import=py myfirstmod.py *Now typing in *greet Andy * works! and output "Hello my dear friend Andy"Try using *greet * with different names. Congratulations! You just got a white belt in creating modules for *Juliar *!Thanks for following the tutorial and have fun creating modules for *Juliar *If you find any bugs, feature suggestions, or want to help out please contact me. Let's make this great language even better. We appreciate all comments.By the way, Package Manager is coming soon, so you'll soon be able to share your creations with the world! Never discard your creations.If I get a good response, I'll write more parts to this tutorial to do some really amazing things.