Subtraction was broken
I caught a very silly bug recently! In Lisp languages, you write
a - b
as
(- a b)
which seems ridiculous when you first learn it, but then you learn you can write
a - b - c
as
(- a b c)
which is marginally less keystrokes per operand. Totally cool huh?
So subtraction is supposed to start with the first number given and keep subtracting as many numbers as you want until you add the close-parenthesis. There is one exception, which is that
(- a)
simply returns the opposite of a (a times -1). If this were to follow the pattern, you'd expect (- a) to return a without changing it, but for Super Important ReasonsTM in most Lisps you can't just write
-a
because symbols can only start with letters.
Anyway, I'm currently on my 3rd attempt at implementing my own Lisp language to use for gamedev. In the first 2 attempts, I was diligent and remembered to implement and test the special case for subtraction with 1 argument. I guess on my 3rd attempt--which is the best one by far--it must have slipped my mind! Because I was trying to position sprites offscreen by using
(- coordinate)
and they were appearing on-screen at the positive coordinate value. D'oh! Wild to think that something as basic as subtraction was broken in the language I've been building for 3 years.
Get FLIES FLIES FLIES
FLIES FLIES FLIES
queer sci-fi comedy
Status | In development |
Author | Nat Quayle Nelson |
Genre | Visual Novel |
Tags | Comedy, Dark, Queer, Sci-fi |
Languages | English |
Accessibility | Subtitles, One button |
More posts
- Buy FLIES & 8 other indie games for $15!69 days ago
- Episode 3 is now available!85 days ago
- "I Collect Butterflies"Mar 10, 2024
- The results are in!Feb 10, 2024
- I try to do marketingJan 31, 2024
- Win some, lose someJan 14, 2024
- 10 Reviews QuestJan 04, 2024
- Can't predict 'em all!Dec 13, 2023
- Launch WeekendDec 04, 2023
- It's out!!Dec 01, 2023
Leave a comment
Log in with itch.io to leave a comment.