What is the difference between [ ] and ( ) brackets in Racket (lisp programming language)?

According to the Racket documentation, there is no difference — there is only a convention to use [ and ] for cond clauses (and use your judgement for the rest, as far as I understand): The use of square brackets for cond clauses is a convention. In Racket, parentheses and square brackets are actually interchangeable, … Read more

What does it mean when a variable equals a function? [duplicate]

Note: Please see the update at the end of the answer, declarations within blocks became valid (but quite complicated if you’re not using strict mode). Here’s one reason: var whatever; if (some_condition) { whatever = function() { // Do something }; } else { whatever = function() { // Do something else }; } whatever(); … Read more

PSR-2 standard for long if-conditions

There is no recommendation / convention for this case, and as Halcyon already mentioned this is a quite exceptional case. However, there is a recommendation for a function call with a long list of parameters: Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first … Read more

tech