May 17th, 2004

Neko (lofulah)


Notes to self (although it may interest others who work on S2)
-There is no while or for loops. Foreach does work however, just like in perl (yay!)
-Arrays are dynamic. Calling something non-existent returns "" in a string array.
-You can have multi leveled arrays. Not really tested, but it compiles without problems.
-Strings are severely lacking in string-manip functions/methods. I'm writing my own functions to do string searches, because it's a) reusable code, and b) I hate putting ugly code like that in a function that's supposed to do something else.
-Compiler doesn't look ahead, so functions must be created early. Or at least started beforehand? doesn't work.
-Arrays can be accessed via foreach. Nice stuff.
-Classes are supported, but in a weird sense.
Collapse )
(NOTE: This is untested code, I wrote it to probe S2's class capabilities. Ought to compile without problems though)
-S2 is weird (read: annoying) in that a variable declaration uses "var [variable type] [variable name] [= value]. HOWEVER, when you want to use the variable, $[variable name] is required. This annoys me because I tend to type var int index, and then just index when I need to use the $index variable. This makes the compiler return annoy error messages that aren't always immediately clear.
-The compiler error messages are helpful if you READ them carefully and logically. Yes, Neko, I know you like using the guess-and-fail method of programming when trying out things, but you know, error messages are there for A REASON. Baka.

Ok, that's enough for now. I forsee a few more ugly surprises later on, in the actual printing-code-to-the-system part, but it looks like clear sailing for a while... Oh, and here's two string manip functions (actually four, two as the "interface" for the two recursive functions) that I'm starting to find useful.
Collapse )
They're not commented because I've got better stuff to do right now. And those function names are pretty self-explanatory, aren't they? Split is from perl's string.split("tokens") functions and replace does what it says- replaces all instances of $target in the string $chunk with $replacement.

You know, I have to say I do love learning new programming languages... so fun~ Wish I has a permament account here so I could play around with S2 as they make changes. ^^;; Xella, I may have to ask you to make the layout public or give me the ID or something so I can create my own theme for the layout. Given the flexibility I'm working into the layout, it will be nothing like yours, I promise~ (mmm, I hope there's not too much flexibility... =o.O= )

The thing that worries me now is that part of the flexibility that I have added makes use of the belief that I can allow users to add their own "text" - and that the text can be inserted into certain places, like the style="" part of a div tag, giving them practically unlimited powers to the equivalent of the S1 style creator/editor.

Oh, and javascript still doesn't work. They check for that between the server and the user's browser. Anything between generated html "script" tags are removed. Pity, ne? Yes, I tried printing the letters of script one by one. Doesn't work.
  • Current Music EuroDance
Neko (lofulah)


Collapse )
Reposted here in the event that it get's lost or deleted. Original souce:

Mmm, my favorite.
"Let us pray first for those in these lines, waiting to receive what is an illegal piece of paper," he said. "Let us pray for the sin of Massachusetts and the pain and confusion that today will bring to so many."
Why? Oh, yes, because God (and the Goddess) care a whole lot regarding the legality of the paper.

And yes, the pain and confusion shall be theirs and theirs alone. Let us pray for them. Amen.