lemonScript


When life gives you lemons ... code in lemonScript

About


One morning, a young Khalid awoke and decided to finish his A.I assignment. “Gosh, I just hate python more than life itself” he muttered as he typed with a sour face. At that moment, he looked at the lemon pulp he has been collecting for the past 5 years due to his midnight lemon snack addiction. At that moment, he decided to call his much smarter and superior friend David to write him a language that everyone could enjoy. So, David formed a team with Brent, Julian, Justin, Raul, and Khalid with the intent to create a language for all lemon enthusiasts. The stage has been set. lemonScript was to be a self-explanatory, statically-typed, esoteric language with the sole purpose of saving people who had a sour taste in their mouth from using popular languages.

Coding Examples


Hello World


    When life gives you lemons try noLemon helloWorld()
        BEGIN JUICING
        pour(“Hello World”)
        END JUICING
                        

Adding Two


    When life gives you lemons try slice add(slice a, slice b)
        BEGIN JUICING
        you get lemonade and a + b
        END JUICING
                        

Five Numbers


    forEachLemon (slice i = 0; i < 5; i++)
        BEGIN JUICING
        pour(“Number: ”)
		pour(i)
        END JUICING
                            

Nth Fibonacci


    When life gives you lemons try slice fibonacci(slice num)
        BEGIN JUICING
        Squeeze the lemon if(num == 0)
            BEGIN JUICING
            you get lemonade and 0
            END JUICING
        Squeeze the lemon if(num == 1 || num == 2)
            BEGIN JUICING
            you get lemonade and 1
            END JUICING
        you get lemonade and fibonacci(num - 2) + fibonacci(num - 1)
        END JUICING
                            

Objects

								
		<slice, taste>  binary = {0: sour, 1: sweet}
		forEachLemon(slice i = 0; i <= 1; i++)
			BEGIN JUICING
			pour(i)
			pour("-->")
			pour(binary.key(i))
			END JUICING								
                        

2 4 6 8


    slice even = 4
    pulp twofoursixeight
    Pick (even)
        BEGIN JUICING
        lemonCase 2
        twofoursix = "two"
        chop
        lemonCase 4
        twofoursix = "four"
        chop
        lemonCase 6
        twofoursix = "six"
        chop
        citrusLimon
        twofoursix = "eight"
        END JUICING
    pour(“Our result is ” + twofoursix)
        
                        

1, 2, 3,... infinity

								
		( *) prints forever from 1 to infinity
		slice x = 0
		Drink the lemonade while(sweet)
			BEGIN JUICING
			x++
			pour(x)
		END JUICING									
						

Developer


lemonScript is brought to you by Khalid Alghunaim, Julian Arregoces, David Sackler, Justin Yee, Brent Shafer, Raul Rodriguez. A group of Computer Science students @ Loyola Marymount University.