Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.38 KB

File metadata and controls

51 lines (35 loc) · 1.38 KB

Examples Walkthrough 📚

Let's break down the examples provided in the examples/ folder to see how everything ties together.

1. hello.lah

The classic starting point.

  • Concepts: eh listen lah, oi, variable declaration.

2. fizzbuzz.lah

A standard programming challenge.

  • Concepts: Loops (one by one lah), Conditionals (confirm or not), Modulo operator (%).

3. fibonacci.lah

Calculating the Fibonacci sequence.

  • Concepts: Functions (steady lah do this), recursion, and math.

4. data_structures.lah

Exploring complex data types.

  • Concepts: whole list (arrays) and all the things (objects).

5. advanced_logic.lah

Closures and higher-order functions.

  • Concepts: Returning functions from functions, complex scope.

6. syntax_error.lah

What happens when you "talk cock".

  • Concepts: Error reporting, TokKokError.

7. nuclear.lah

The spicy side of Lahlang.

  • Concepts: puki panic, kan ni na crash, and other 🌶️ keywords.

8. spicy.lah

Aggressive error handling and assertions.

  • Concepts: chao cb assert, si beh intensifiers.

How to run them?

From the root of the project, you can run any example:

lahlang examples/1.\ hello.lah

Conclusion

You've reached the end of the documentation! You're now ready to build amazing things with Lahlang. Can one lah! 🇸🇬