Lisp redefining functions

user3043278

Can someone help understand what is happenning here?

(DEFUN G(L)(+(CAR L)(CADR L)))
(SETQ H`F)(SET H `G)

I want to know what happends when I evaluate (F` (2 3 4 5 6 ))

I've written it in my lisp interpreter but I get the following error:

Undefined function F
Rainer Joswig

Common Lisp has a namespace for values and another namespace for functions.

CL-USER 49 > (DEFUN G(L)(+(CAR L)(CADR L)))
G

CL-USER 50 > (SETQ H 'F)
F

CL-USER 51 > (SET H 'G)
G

CL-USER 52 > F
G

CL-USER 53 > (symbol-value 'F)
G

CL-USER 54 > (symbol-function 'f)

Error: Undefined function F in form (SYMBOL-FUNCTION F).

All you did was setting the value of F, but not the function F.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Redefining PHP class functions on the fly?

From Dev

C++: inheriting functions and redefining them

From Dev

implementations of lisp functions

From Dev

",@" in lisp macro functions

From Dev

Ordering of needle / haystack in Lisp functions

From Dev

Calling a list of functions in Common Lisp

From Dev

Is it possible in Lisp to undefine Macros and Functions?

From Dev

Lisp: labels or separate global functions?

From Dev

Looping through a function in python but redefining a variable when a function from an array of functions gets called

From Dev

Redefining %in% for matrices

From Dev

Redefining %in% for matrices

From Dev

How do recursive functions work in Lisp?

From Dev

Accessor functions for Common Lisp class slots

From Dev

Defining aliases to standard Common Lisp functions?

From Dev

Lisp error: (error "Lisp nesting exceeds `max-lisp-eval-depth'") when using cl- functions

From Dev

Common Lisp functions that accept arguments either by position or by keyword?

From Dev

Passing and returning structs to C functions on stack from Common Lisp with CFFI

From Dev

Does Common Lisp (SBCL) have high level parallelism functions?

From Dev

Lisp randomize and using two functions to pull from list into another

From Dev

Scope of functions and variables within a function and/or let statement for lisp

From Dev

Passing and returning structs to C functions on stack from Common Lisp with CFFI

From Dev

Common Lisp functions that accept arguments either by position or by keyword?

From Dev

Scope of functions and variables within a function and/or let statement for lisp

From Dev

Lisp randomize and using two functions to pull from list into another

From Dev

how are functions defined in the lisp dialect used in the little lisper 1974 edition

From Dev

Defining functions Scheme-style in Common Lisp, without defun

From Dev

Combining two functions in LISP to atomize list and then find max?

From Dev

Lisp Horner's method using map-functions

From Dev

Redefining the context of an event handler

Related Related

  1. 1

    Redefining PHP class functions on the fly?

  2. 2

    C++: inheriting functions and redefining them

  3. 3

    implementations of lisp functions

  4. 4

    ",@" in lisp macro functions

  5. 5

    Ordering of needle / haystack in Lisp functions

  6. 6

    Calling a list of functions in Common Lisp

  7. 7

    Is it possible in Lisp to undefine Macros and Functions?

  8. 8

    Lisp: labels or separate global functions?

  9. 9

    Looping through a function in python but redefining a variable when a function from an array of functions gets called

  10. 10

    Redefining %in% for matrices

  11. 11

    Redefining %in% for matrices

  12. 12

    How do recursive functions work in Lisp?

  13. 13

    Accessor functions for Common Lisp class slots

  14. 14

    Defining aliases to standard Common Lisp functions?

  15. 15

    Lisp error: (error "Lisp nesting exceeds `max-lisp-eval-depth'") when using cl- functions

  16. 16

    Common Lisp functions that accept arguments either by position or by keyword?

  17. 17

    Passing and returning structs to C functions on stack from Common Lisp with CFFI

  18. 18

    Does Common Lisp (SBCL) have high level parallelism functions?

  19. 19

    Lisp randomize and using two functions to pull from list into another

  20. 20

    Scope of functions and variables within a function and/or let statement for lisp

  21. 21

    Passing and returning structs to C functions on stack from Common Lisp with CFFI

  22. 22

    Common Lisp functions that accept arguments either by position or by keyword?

  23. 23

    Scope of functions and variables within a function and/or let statement for lisp

  24. 24

    Lisp randomize and using two functions to pull from list into another

  25. 25

    how are functions defined in the lisp dialect used in the little lisper 1974 edition

  26. 26

    Defining functions Scheme-style in Common Lisp, without defun

  27. 27

    Combining two functions in LISP to atomize list and then find max?

  28. 28

    Lisp Horner's method using map-functions

  29. 29

    Redefining the context of an event handler

HotTag

Archive