zoukankan      html  css  js  c++  java
  • Difference between SET, SETQ and SETF in LISP

    SET can set the value of symbols;
     
    SETQ can set the value of variables;
     
    SETF is a macro that will call different function depending on what was called as its first argument.
     
    examples
     
    (set (quote l) '(1 2 3))
    (1 2 3)
     
     
    (set l '(1 2 3))
    Failure, l must be a symbol.
     
     
    (set 'l '(1 2 3))
    (1 2 3)
     
     
    (setq l '(1 2 3))
    (1 2 3)
     
     
    (setq (car l) 10)
    Failure.
     
     
    (setf l '(1 2 3))
    (1 2 3)
     
     
    (setf (car l) 10)
    l is (10 2 3)
  • 相关阅读:
    模块3 re + 正则表达式
    模块2
    模块1
    super
    MRO,C3算法
    日志,固定格式
    异常处理,MD5
    类的约束
    反射
    异常处理MR5
  • 原文地址:https://www.cnblogs.com/johnpher/p/3404575.html
Copyright © 2011-2022 走看看