|
|
|
|
|
by kragen
26 days ago
|
|
You seem to have misunderstood this remark: > It seems sort of wasteful of tokens! This was referring to the LLMs' tendency to blat out hundreds of tokens into a single tool call, not to Clojure. The REPL in the part of the presentation you link to only evaluates two forms, (range 10) and (bounce!), neither of which takes much advantage of homoiconicity. cchase88 was talking about a degree of homoiconicity in Tcl that has been abandoned by most dialects of Lisp: : ~; tclsh
% proc deproc {name} {return [list proc $name [info args $name] [info body $name]]}
% deproc deproc
proc deproc name {return [list proc $name [info args $name] [info body $name]]}
(That might look wrong, but it's actually correct. In Tcl the list {name} is exactly the same as the quasiquoted string "name" and the bare word name.) % proc ack {m n} {
if {$m == 0} {
expr {$n + 1}
} elseif {$n == 0} {
ack [expr {$m - 1}] 1
} else {
ack [expr {$m - 1}] [ack $m [expr {$n - 1}]]
}
}
% deproc ack
proc ack {m n} {
if {$m == 0} {
expr {$n + 1}
} elseif {$n == 0} {
ack [expr {$m - 1}] 1
} else {
ack [expr {$m - 1}] [ack $m [expr {$n - 1}]]
}
}
You can't do that in Racket or SBCL, but it does exist in Clojure; it's clojure.repl/source. However, the part of the presentation you link to doesn't use anything similar, and it's not really a mainstream part of Lisp development anymore, the way it was 50 years ago. |
|