first or last empty list should return nil
Posted: Thu Sep 15, 2016 1:23 am
When `rest` or `chop` or `filter` a list, empty list would be create.
But many function that process list would throw error with empty list (first last rest nth).
So newlisper need treate empty list as special list to avoid code crash.
If index empty list return nil, then would simplify coding processing list.
But many function that process list would throw error with empty list (first last rest nth).
So newlisper need treate empty list as special list to avoid code crash.
If index empty list return nil, then would simplify coding processing list.
Code: Select all
(set '@lst (process @lst))
(cond
((symbol? (first @lst) (dosth ..))
(true ..))