Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Shitty Bugs thread

Name: Anonymous 2009-11-21 17:09

Post here whenever you waste hours of your life on a simple bug, so that others may mock you (and/or learn from your mistakes).

(cons 'let (cons paramlist body)) is not the same as (list 'let paramlist body)

Name: Anonymous 2009-11-21 17:17

I would have never made that mistake, and you could have easily tested it in a REPL.
(cons 'let (cons 'paramlist 'body))
;=> (LET . (PARAMLIST . BODY)) => (LET PARAMLIST . BODY)
(list 'let 'paramlist 'body) => (LET PARAMLIST BODY)
; the first one is not a proper list for it does not end with a NIL, the first can also be written as:
(list* 'let paramlist body) instead of (cons 'let (cons paramlist body))

Learn the difference between LIST and LIST*, it may save your life one day!!!

Name: Anonymous 2009-11-21 17:18

And, if I were doing this for a macro, I would have just used backquote
`(let ,paramlist . ,body) or `(let ,paramlist ,@body)

Name: Anonymous 2009-11-21 17:20

>>2
I hadn't noticed it, since it was buried deep down in my evaluator, and all the test data only had one list in body. I realise this isn't an excuse, since I should have had better test coverage.

Name: Anonymous 2009-11-21 17:24

lol.
lisp

Name: Anonymous 2009-11-21 17:29

>>5
back to /pr/

Name: Anonymous 2009-11-21 17:38

>>6
back to /you're mother's basement/.
lol, lispers.

Name: Anonymous 2009-11-21 17:47

>>7
back to /pr/

Name: Anonymous 2009-11-21 17:57

[[0]*n]*m does not initialize an m rows by n columns matrix (at least not one that will work like you think it should).

use [[0 for j in range(n)] for i in range(m)] instead

Name: Anonymous 2009-11-21 18:03

>>9
[[0]*n for i in range(m)] will work fine, as 0 is immutable.

Name: Anonymous 2009-11-21 18:23

*i++ vs *++i

Name: Anonymous 2009-11-21 18:24

i+++++++++++++++++++++++++++++++

Name: Anonymous 2009-11-21 18:31

>>11
you moron its c++

Name: Anonymous 2009-11-21 18:51

From a Jew's face
The wicked Devil speaks to us,
The Devil who, in every country,
Is known as an evil plague.

Would we from the Jew be free,
Again be cheeful and happy,
Then must youth fight with us
To get rid of the Jewish Devil.

Name: Anonymous 2009-11-21 23:13

A good one that got me often was forgetting to implement a copy constructor, and chasing down a copy bug for hours. I hate sepples. Of course these days GCC has a warning against that (the C++ style bullshit), but it comes with so much other baggage...

Name: Anonymous 2011-02-03 3:57

Name: Anonymous 2013-01-19 23:45

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

Don't change these.
Name: Email:
Entire Thread Thread List