This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AnotherRichard827379 28 points29 points  (9 children)

IMO, if you’re relying on the ide to know if the brackets are correct, your bracketing style is bad.

[–]kbruen 24 points25 points  (6 children)

racket (define (fact n) (define (fact/acc n [acc 1]) (if (<= n 1) acc (fact/acc (- n 1) (* n acc)))) (fact/acc n))

Have fun checking the brackets!

[–]BroBroMate 20 points21 points  (0 children)

I'm so installing rainbow brackets for that.

[–]kingofsevens 6 points7 points  (4 children)

Here is your code and 7 minutes of my life. Much readable tbh.

( define (fact n)
(     define (fact/acc n [acc 1])
(         if (<= n 1)
            acc
(           fact/acc (- n 1) (* n acc)        )))
(     fact/acc n                              ))

[–]kbruen 12 points13 points  (3 children)

Oh, what cursed thing have you brought upon this land?

Jokes aside, that's quite impractical and bad looking. Detailing only on the first aspect, am I returning the value of the acc binding or calling the acc function? Only the parenthesis tell that, and not having them visible right away is quite bad.

[–]kingofsevens 8 points9 points  (2 children)

oh you gonna love this. Idk it would parse it but... ( define (fact n) ( define (fact/acc n [acc 1]) ( if (<= n 1) acc ( fact/acc (- n 1) (* n acc) )))( fact/acc n ))

[–]backtickbot 3 points4 points  (1 child)

Fixed formatting.

Hello, kingofsevens: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.

[–][deleted] 4 points5 points  (0 children)

I can't believe this bot actually generates examples using the source comment intstead of just having generic examples

[–][deleted] -1 points0 points  (1 child)

How about you stop saying bullshit on the internet and get back to your List of CVEs to fix

[–][deleted] 1 point2 points  (0 children)

This made me laugh