SlideScript

Getting SlideScript

Starting off with SlideScript, you'll first need to obtain the source and build it. We're going to assume you're using a *nix based system today, so the easiest way to get the source is with a tool a developer should be familiar with: git.

Installing system-wide:


# git clone https://notabug.org/Pentium44/slidescript 
# cd slidescript/
# make & make install
# slidescript
ss:prompt: 
Running after build:

# git clone https://notabug.org/Pentium44/slidescript
# cd slidescript/
# make
# ./slidescript
ss:prompt:
From this step, you should easily have built SlideScript, and would be sitting at the fancy incorporation of an interactive shell. Want to use it at as a script? Just make a file "script.ss", and add a shebang after system wide install:
#!/usr/bin/slidescript
Of course, make sure your script is executable!

Variables & strings

SlideScript will parse an equal character into a variable using the contents on each side of such equal character. No quotes are needed after an equal character and can be ended via new-line. You can print variables and/or strings to stdout in SlideScript using the "print" function. Examples (interactive and scripted):


ss:prompt: buffer=This will be the contents of variable "buffer"
ss: var 'buffer' -> This is the contents of variable "buffer"
ss:prompt: print "%buffer%"
This is the contents of variable "buffer"
ss:prompt: 

OR

#!/usr/bin/slidescript
# This is a comment, script away
buffer=This will be the contents of variable "buffer"
print "%buffer%"
# Unset function on variables similar to perl
unset "buffer" # Dumps buffer from memory!

From here, we are going to be refering to all examples as scripts. Yes, SlideScript does have interactive mode for being a convenient all-in-one shell, but lets focus on the scripting side of things; shall we?

Piping, math & backquoting

Piping is very similar to piping within a *nix shell. In SlideScript, the piping character remains "vertical bar" or "|". The return value of the function processed on the left side of the piping character will be pushed into a variable known as "PIPE". Hmm, wonder why? :P You can use piping in recursion in SlideScript.
Backquotes or "`" are used within SlideScript, mainly in variables, for processing functions within the language, and saving the returned value as a string. For example: whatsthetime=`time` would be saved as: ss: var 'whatsthetime' -> Wed Jun 9 17:56:23 2021
Here are some examples:


#!/usr/bin/slidescript
# First, lets show how a pipe works:
print "hello" | print "%PIPE% world" # Returns: hello world

# Now for stacked piping, lets use a variable with the current time, and
# Play with it!

whatsthetime=`time` # return: ss: var 'whatsthetime' -> Wed Jun  9 17:56:23 2021

calc "56.5 * 6.25" | print "Solved: %PIPE%" | print "[%whatsthetime%] %PIPE%" 
### Return value of the contraption: [Wed Jun  9 17:56:23 2021] Solved: 353.125000

# This is more for, how math works in SlideScript #
# Example of using piping to do mathimatical equations with parathesis!
calc "33.3 / 2" | calc "%PIPE% * 26" | calc "%PIPE% + 2" # Return: 434.899994

IRC server

Still need help? Want to report a bug? Join us!

IP/Port: cddo.cc/1337
Main hang channel: #theroot
FreeBox channel: #freebox
FreonLinux channel: #freonlinux