LnkAppend

Freeform discussion about anything related to modding Transcendence.
Post Reply
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Does lnkappend work by appending a list to a list (so list a b c and lnkappend (list 123)) => (1 2 3 '(abc)) OR does it work like union and return '(1 2 3 a b c)?
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

It works as an append. The main thing about all the lnk* functions is that they operate in place, not returning the new list. So, an example:

Code: Select all

(setq myList (list 1 2 3))
(lnkAppend myList 4)
;; myList is now '(1 2 3 4)
(lnkAppend myList (list 5 6))
;; myList is now '(1 2 3 4 (5 6))
For your union needs, you need to use `append'. Just remember that it does not operate in place, but rather returns the new list, like so:

Code: Select all

(setq myList (list 1 2 3))
(setq myList (append myList (list 4 5 6))
;; myList is now '(1 2 3 4 5 6)
Hope that helps .]
Get your own Galactic Omni Device
Get it now. It's free!!
Image
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Thanks alterecco :3
I had assumed that lnkappend worked as #1 and not as union but I wanted to make sure >.<
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
Post Reply