News for hackers. Stuff that matters.
Re:Why Fennel? by ahoka on Wednesday September 13, 2023 @02:40PM (#37500072)
Fun fact: in C, if you have a signature like “int foo()”, it means any number of arguments can be passed (vs “int foo(void)” which means no args).
Re:Why Fennel? by sovietswag on Wednesday September 13, 2023 @02:44PM (#37500133)
Good reference for that: https://jameshfisher.com/2016/11/27/c-k-and-r/

This was also used to implement variadic functions like printf before varargs, see https://retrocomputing.stackexchange.com/a/20517

Re:Why Fennel? by fulafel on Wednesday September 13, 2023 @02:47PM (#37500161)
And there is no way for the callee to check the nr of passed args, unlike in Lua.
Re:Why Fennel? by mdaniel on Wednesday September 13, 2023 @02:50PM (#37500190)
that's ... (amazing|C for ya)

  int foo() {
      return 0;
  }
  int main(int argc, char* argv[]) {
      return foo("alpha", "beta", 1);
  }
  $ gcc-13 -Wall -Werror -o foo foo.c
  # oh, sads

  $ clang -o foo ./foo.c
  ./foo.c:5:34: warning: too many arguments in call to 'foo'
      return foo("alpha", "beta", 1);
             ~~~                   ^
  ./foo.c:5:15: warning: passing arguments to 'foo' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      return foo("alpha", "beta", 1);
                ^
  2 warnings generated.
Re:Why Fennel? by astrange on Wednesday September 13, 2023 @03:59PM (#37501000)
No longer true in C23, it means void now.