https://pine32.be - © pine32.be 2024
Welcome! - 58 total posts. [RSS]
A funny little cycle. [LATEST]


Search 58 posts with 29 unique tags


#1717783312


[ c | lisp | BYOWL ]

Finished the Build Your Own Lisp book and already added some extra features. There are still lots of extra’s I want to add to the langue. I also really need to add some docs and examples, and maybe even tests.

The language is quite capable especially with the prelude that is embedded into to it. It even has things like switch statements, completely implemented in lzp. Lisps are really programmable programming languages.

(fun {day-name x} {
  case x
    {0 "Monday"}
    {1 "Tuesday"}
    {2 "Wednesday"}
    {3 "Thursday"}
    {4 "Friday"}
    {5 "Saturday"}
    {6 "Sunday"}
})
(print (day-name 4))

> "Friday" 

#1716911837


[ c | lisp | BYOWL ]

Just finished chapter 13, which added flow control. Recursive functions are now possible like one that calculates the Fibonacci sequence. It is not that fast, even compared to Python but at least it works.

lzp> def {fib} (\ {n} {if (<= n 1) {n} {+ (fib (- n 1)) (fib (- n 2))}})
()
lzp> fib 25
75025

#1716581850


[ c | lisp | BYOWL ]

Almost done with chapter 11 of Build Your Own Lisp and I have finally variables (that are immutable actually) and you can do some funky stuff with them. This is maybe very basic for any lisp but I have never used a lisp.

lzp> def {arglist} {a b x y}
()   
lzp> arglist
{a b x y}
lzp> def arglist 1 2 3 4
()   
lzp> list a b x y
{1 2 3 4}

#1715841763


[ c | lisp | BYOWL ]

Finally learning some C. I am following Build Your Own Lisp by Daniel Holden. The final code should only be about 1000 lines so it’s a small project but still a great way to learn C. I’m only on chapter 7 of 16, but so far I’d recommend it.