evincarofautumn / kitten

A statically typed concatenative systems programming language.
http://kittenlang.org/
Other
1.1k stars 42 forks source link

Example of FizzBuzz in kitten #213

Closed svc-user closed 6 years ago

svc-user commented 6 years ago

An example of the FizzBuzz puzzle in Kitten.

svc-user commented 6 years ago

Changes pushed.

As you suggested I've moved the (%) 0 (=) into a divisible function which uses the do (with (+Fail)) expression so I avoid having +Fail permission all the way back to the loop function.

I changed the match/case to if/else's it does make the intent more clear. At first I was focused on a different approach with pattern matching which I thought I needed match/case for.

I have also removed the say's and added a show in the buzzes function. This clearly makes more sense, but I am very focused on the language rather that being DRY 😄

Also; Sorry about all the git-trash I'm making. I try to spend more time loving code than loving to manage code 🙃 I think the amount of PR's I've ever made can be counted on one hand.

evincarofautumn commented 6 years ago

LGTM, committed in 64a00f3b8a01941152a26c06a8c1c731359f74f5. :)