Objective LOLCODE

Objective LOLCODE is a rewritten version of LOLCODE, created in 2012, rather with an objective than being pointless. Objective LOLCODE uses extensions with names like the C/C++ header names, but all extensions introduce support for more code which looks like LOLSPEAK.

Basic Code
Just like the standard LOLCODE, Objective LOLCODE has these basic commands when no "CAN HAZ [LIBRARY]?" is included.

Basic arithmetic
Like every non-esoteric programming language, basic arithmetic is part of Objective LOLCODE standards. Here is an example which tests all arithmetic functions HAI CAN HAZ STDIO? I HAZ A TEST ITZ 65 + 48 IZ TEST LIEK 113? YARLY VISIBLE "Addition test passed" KTHX NOWAI COMPLAIN "Addition test failed" KTHX I HAZ A TEST ITZ 65 - 48 IZ TEST LIEK 17? YARLY VISIBLE "Subtraction test passed" KTHX NOWAI COMPLAIN "Subtraction test failed" KTHX I HAZ A TEST ITZ 15 * 5 IZ TEST LIEK 75? YARLY VISIBLE "Multiplication test passed" KTHX NOWAI COMPLAIN "Multiplcation test failed" KTHX I HAZ A TEST ITZ 75 / 5 IZ TEST LIEK 15? YARLY VISIBLE "Division test passed" KTHX NOWAI COMPLAIN "Division test failed" KTHX I HAZ A TEST ITZ 10 ^ 2 IZ TEST LIEK 100? YARLY VISIBLE "Exponentation test passed" KTHX NOWAI COMPLIAN "Exponentation test failed" KTHX I HAZ A TEST ITZ 100√ IZ TEST LIEK 10? YARLY VISIBLE "Square Root test passed" KTHX NOWAI COMPLAIN "Square Root test failed" KTHX KTHXBYE

Error handling
When commands like " " are performed, there are "AWSUM THX" and "O NOES" code blocks, for example: HAI CAN HAZ STDIO? AWSUM THX VISIBLE "Hello World!" KTHX O NOES BTW This means that your LOLCODE implementation is rather a completely pointless implementation which doesn't even have STDIO and there is no way to show the error. KTHX KTHXBYE

If instructions that support error handling have no error handling code blocks, it will either continue if it would go to "AWSUM THX" or forcefully terminate the program if it would go to "O NOES".

Objects
In Objective LOLCODE, of course, there are objects. An object class can be defined like this: HAI THRZ A NEW THNG CALLD OBJTESTZ OBJTESTZ HAZ VAL1Z WICH R INTGERZ OBJTESTZ HAZ VAL2Z WICH R STRNGZ I HAZ A TEST ITZ A NEW OBJTEST TESTZ VAL1 IZ 25 TESTZ VAL2 IZ "Objective LOLCODE" KTHXBYE

To test an object's type: HAI CAN HAZ STDIO? THRZ A NEW THNG CALLD OBJTESTZ OBJTESTZ HAZ VAL1Z WICH R INTGERZ OBJTESTZ HAZ VAL2Z WICH R STRNGZ I HAZ A TEST ITZ A NEW OBJTEST IZ TEST LIEK A OBJTEST? YARLY VISIBLE "Type test passed" KTHX NOWAI VISIBLE "Type test failed" KTHX KTHXBYE

Collection Types
Objective LOLCODE, just like non-esoteric programming languages, there are collection types.

A basic collection is initialized with any of the following:
 * I HAZ A CLECTUN F [VAR] (creates an empty basic collection)
 * I HAZ A CLECTUN F [VAR] WID [VAR1] [VAR2] … N [LAST ITEM IN COLLECTION]

To add an item to a basic collection: [ITEM] IZ NOW IN MY CLECTUN F [COLLECTION]

An example of getting an item from a collection: HAI CAN HAZ STDIO? I HAZ A CLECTUN F MYCLECTUN WID 1 2 3 4 5 6 7 8 N 9 I HAZ A TEST ITZ TEH SCUND DING IN MYCLECTUN IZ TEST LIEK 2? YARLY VISIBLE "Collection test passed" KTHX NOWAI VISIBLE "Collection test failed" KTHX KTHXBYE

A dictionary can be initialized like this:
 * I HAZ A [VAR] DICTUNRY (creates an empty dictionary)
 * I HAZ A [VAR] DICTUNRY IN WIZ [KEY1] MENS [VALUE1] [KEY2] MENS [VALUE2] … N [FKEY] MENS [FVALUE]

To add a key and value or change a key to another value: IN [DICTUNRY] [KEY] MENS [VALUE]

Code made available with "CAN HAZ STDIO?"
If the line "CAN HAZ STDIO?" is in the beginning of the program, these keywords become available.