function map accept a quoted list as its seconds arguments:
(map inc '(1 2 3 4 5))
but above expression returned a list? or a quoted list? I think its should be a quoted list, because it could used with second map:
(map inc (map inc '(1 2 3 4)))
I don't know if it is a macro with map, but the expression with map is evaluted with some delay.
How to know a primitive function is macro or common function?
The evaluted order about primitive function? I know `eval` is first should be evaluate than `println`.
List or quoted List
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
Re: List or quoted List
It returns an unevaluated list:(map inc '(1 2 3 4 5))
but above expression returned a list? or a quoted list?
Code: Select all
(2 3 4 5)
Code: Select all
'(1 2 3 4)
(1 2 3 4)
Code: Select all
(map inc (map inc '(1 2 3 4))
;-> (3 4 5 6)
Re: List or quoted List
I think must have a type of data structure -> 'lazy-list' in newLISP, which would not be evaluted when passed into function as argument. most of list processing function would return a 'lazy-list'.