-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mixed operation in 'list-insert' #361
Comments
Can you please elaborate what you mean by unifying the destructive operations? |
Sorry, that was not clear enough. I mean that (setq lst nil)
;; nil
(list-insert 1 0 lst)
;; (1)
lst
;; nil ;Not Destructive
(setq lst (list 1 2))
;; (1 2)
(list-insert 3 2 lst)
;; (1 2 3)
lst
;; (1 2 3) ;Destructive
(list-insert 0 0 lst)
;; (0 1 2 3)
lst
;; (1 2 3) ;Not Destructive Should be: (setq lst nil)
;; nil
(list-insert 1 0 lst)
;; (1)
lst
;; (1) ;Destructive
(setq lst (list 1 2))
;; (1 2)
(list-insert 3 2 lst)
;; (1 2 3)
lst
;; (1 2 3) ;Destructive
(list-insert 0 0 lst)
;; (0 1 2 3)
lst
;; (0 1 2 3) ;Destructive |
This looks right to me. |
Thanks, your help is appreciated. In case you have not found it yet, the function definition is in https://github.com/euslisp/EusLisp/blob/master/lisp/l/common.l#L369-L377 . |
made a pull request |
In
list-insert
, we have non-destructive operation for null lists or zero position and destructive operation for other cases.https://github.com/euslisp/EusLisp/blob/master/lisp/l/common.l#L369-L377
Shouldn't these be unified as destructive operation?
The text was updated successfully, but these errors were encountered: