2 ms·
Really? SBCL: * (defun foo (a) (+ a 42)) FOO * (defun bar (b) (foo 10 20)) ; in: DEFUN BAR ; (FOO 10 20) ; ; caught STYLE-WA
by lispm 8y ago
Really?
SBCL:
* (defun foo (a) (+ a 42))
FOO
* (defun bar (b) (foo 10 20))
; in: DEFUN BAR
; (FOO 10 20)
;
; caught STYLE-WARNING:
; The function was called with two arguments, but wants exactly one.
; (SB-INT:NAMED-LAMBDA BAR
; (B)
; (BLOCK BAR (FOO 10 20)))
;
; caught STYLE-WARNING:
; The variable B is defined but never used.
;
; compilation unit finished
; caught 2 STYLE-WARNING conditions
BAR
- ModernMech 8y agoThat's not the point. You can run static languages in a REPL. Some easier than others. You've chosen a particularly easy static language to write REPLs for as a counterpoint. LISPs and other homoiconic languages are especially well suited for interpreters because they're especially well designed languages. Languages like C which require header files and a pre-processor are much harder to write REPLs for. You can try to do it and you can build a thing that works kind of like a REPL (look I type code and press enter and it evaluates, yay), but the experience always falls short of using a dynamic language in a REPL. It's just not even close, and that's just due to the simple fact you're trying to use something in a way it's not intended. Compiled languages simply are not designed with a tight development loop as a major design goal.
- lispm 8y agoSBCL is compiled, dynamic and supports REPL based programming.
- ModernMech 8y agoLike I said, Lisps are well suited for REPLs.