0
> (procedure? +)
#t
> (procedure? (car '(+ 2 3)))
#f
> (list? '(+ 2 3))
#t
> (symbol? (car '(+ 2 3)))
#t
> (define someList (list + 2 3))

> someList

>    '(#< procedure:+ > 2 3)

> (procedure? (car someList))
#t
>

Is it possible + to be recognized as a procedure when using quotes?

soegaard
  • 30,661
  • 4
  • 57
  • 106
STD
  • 5
  • 3
  • 1
    No. `'+` is a symbol because quoting prevents the evaluation of the symbol. – uselpa Aug 21 '16 at 09:01
  • Possible duplicate of [What is the difference between quote and list?](http://stackoverflow.com/questions/34984552/what-is-the-difference-between-quote-and-list) – Alexis King Aug 21 '16 at 18:47

1 Answers1

1

Lists, vectors, symbols, strings, booleans, and numbers have the advantage of having literal representations while procedures doesn't. One might argue that it would be doable to have literal representation for globals and perhaps even global module bindings since they could be determined at macro expansion time, but since we don't the best way to do what you want is to use quasiquote to evaluate some parts:

`(,+ 1 2 3) ; ==> (#<procedure:+> 1 2 3)

Notice that after evaluating + there is nothing in this list associated with the symbol +. Also know that the symbol + is data and not to be confused with the variable +.

Sylwester
  • 47,942
  • 4
  • 47
  • 79