Sunday, September 29, 2013

USL Update

I made a mistake in my last release. I broke the sysExec function, but it's fixed now.

I have been working on a startup with a friend of mine which I won't make public anytime soon, but that and school plus work is keeping me pretty busy these days. I'm still looking for a programming job. Even if it's something like $30,000 annual salary. Anything beats my current hourly pay.

Anyway. Here is a code sample demonstrating some USL code manipulation.



So what's going on in this code? We've defined a method called "ls" that lists either the directories or files within the current working directory. This is done by storing the procedure in a variable called @code. If the parameter passed is a string containing the letter "d", a for-loop which generates a temporary list of directories in a specific directory (found at @path) will be written to the @code variable. You can guess what happens if the letter "f" was passed instead. But something really cool happens in the else-block. Since an invalid parameter value was found, we set @code to the commentation symbol #. After the endif, the rest of the code is appended. If an invalid parameter was passed, the code executed is just a comment. It may be a bit quirky of me to be excited about the discovery of cool tricks in my own language, but I'm just a quirky dude like that.

Follow me on Github!

No comments:

Post a Comment