1. 程式人生 > >建立list方法總結

建立list方法總結

構建一個list

注意要標記不要求值。比方用‘ 或者list

> (list "a" "b" "c")
("a" "b" "c")

或者

> '("a" "b" "c")
("a" "b" "c")


設定一個空list

(set 'my-list '())


用函式引數構建一個list

(define-macro (location-file-based-on-modified-time dir-path from-seconds to-seconds)
  (println (list from-seconds to-seconds))
呼叫程式碼例如以下:

(FILE:location-file-based-on-modified-time "/home/dean/Videos/" 1409496931 1409496931)
結果:

(1409496931 1409496931)