Such a concept could use an example to solidify that point.
If I have a function Foo that adds two numbers together. How is that represented in lisp (as a list you say?)? How would one alter that function/lisp-list: to multiply numbers instead?
If I have a function Foo that adds two numbers together. How is that represented in lisp (as a list you say?)? How would one alter that function/lisp-list: to multiply numbers instead?
I'm only a beginner in lisp too, but it as simple as
(defun add-numbers (a b) (+ a b))
if you look at it as "everything between () is a list" then you'll find the above code is actually: [word word [word word] [word word word]]
to get it to multiply numbers instead, you'd just get the last item of the list `(+ a b)` -- replace the first item `+` with `*` (using other list functions, etc..) and then re-evaluate the entire list again,So now your function will multiply values instead of adding them..
The "power" aspect comes from the fact that we use "other list functions" to change the code, ie: code is data that we can manipulate.
note, probable errors, like I said, I'm new
Edit: a macro example, which I think may be the more common route of doing this type of stuff? https://lisp-journey.gitlab.io/blog/common-lisp-macros-by-ex...