Page Content1. Get slim.r
1. Get slim.r
Here is the link to it on rebol.org: slim.r
You can also dowload it directly using rebol:
>> write %/path/to/slim.r read http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=slim.r
Dowload it and save it anywhere you want on your local system. I suggest creating a new folder so you will have only one place to look for all your slim library data.
1.1 Testing quickly from the Console
To use slim, all you have to do is do slim.r directly .
> do %/path/to/slim.r
Note that REBOL should printout the following in console:
Script: "SLiM - STEEL | Library Manager" (19-Oct-2006)
if you wish to see if slim is properly configured, you can try to use its 'CACHED? method.
> slim/cached?/list 'lib == 
Obviously, it will return an empty block, since we have not yet opened any library.
If you are wondering why we added the 'lib on the call, its just because we must supply a library name to comply with 'cached? arguments. This function is usually used internally by slim to know if a library has already been loaded.
2. Downloading slim files.
For the purpose of testing and simple install, the best location to store your slim libraries is in the same folder as the one used for slim.r itself.
Slim will automatically find the libraries, no special setup needed. Its that simple.
So if your slim.r is here:
Then your libs can be here:
3. Using Slim
Now that you've got one or more slim libaries on your disk, all you need to do is open them.
in a console or in a file, its the same procedure:
do %/path/to/slim.r mylib: slim/open 'mylib 1.0.0
In the above example, you expect the mylib library to be versioned 1.0.0 or more. If its not the case, the call will return none and might print out an error in the console.
In the case you do not care for a minimal version (be sure your libs comply with what you expect), then you can use none as a "don't care" version.
mylib: slim/open 'mylib none
3.2 library word
Also note that the word to which you assign your library is up to you, liquid does not force any lib names within the end-user code. And Note that you can load the same library many times without any memory being used up... its the same library.
Here is an example of above notes in use.
> do %/path/to/slim.r > mylib: slim/open 'mylib none > bogus: slim/open 'mylib none > same? mylib bogus == True
4. Permanent installation
All of the above are internal defaults and are sufficient for the majority of users to understand and use slim for a long time.
But for more prolongued use or for more advanced users, MANY configuration and use options exist.
I will just give a pointer in how to allow you to have slim available all the time. its very easy.
Just locate your user.r file, and add the:
Line somewhere in it. Then you won't have to put that line in every script you call and will be able to use slim libraries from the console directly.
If you do not know about the user.r file or which one is being used... (my experience tells me that the user.r file location is not always what you'd expect), I'd consider looking into the slim reference documentation for a much more in-depth coverage of slim setup and usage.
page last updated: 2-Nov-2006