I suggested calling it Join in http://wiki.neurohack.com/transcendence/trac/ticket/858 and now I'm remembering to get around to making a discussion thread thing about it.
So, um, discuss.
Why append shouldn't be called append
- Star Weaver
- Militia Commander
- Posts: 311
- Joined: Sun Nov 07, 2010 10:20 pm
- Location: . . . between the stars and the warm black sky . . .
- Aury
- Fleet Admiral
- Posts: 5510
- Joined: Tue Feb 05, 2008 1:10 am
- Location: At the VSS Shipyards in the frontier, designing new ships.
As a C-family native programmer, I divide things into 'atomic & pseudo-atomic' and 'non-atomic' types. Atomic are things like ints, pointers, chars, etc. Pseudo-atomic things are Abstract Data Types (ADTs) and tend to be things like c-strings, etc. Non-atomic types are clearly non-atomic data structures like lists, templates, arrays, etc.
Links and Structs fall into the non-atomic group here, while the function name 'Append' suggests that it is meant to be used on atomic items, due to lack of a prefix. Maybe a clone with the prefix of lst for all list functions (ie, operating with lists). I've actually been pre-pending them with lnk in TAI so far, since I didn't realize that there was a distinction between functions operating with elements of the list and the lists themselves.
Links and Structs fall into the non-atomic group here, while the function name 'Append' suggests that it is meant to be used on atomic items, due to lack of a prefix. Maybe a clone with the prefix of lst for all list functions (ie, operating with lists). I've actually been pre-pending them with lnk in TAI so far, since I didn't realize that there was a distinction between functions operating with elements of the list and the lists themselves.
(shpOrder gPlayership 'barrelRoll)
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
And I basically missed everything which Wolfy just said.
(move along, nothing to comprehend here!)
(move along, nothing to comprehend here!)
(func(Admin Response)= true){
if(admin func(amiable) = true)
Create func(Helpful Posts)
else func(Keep Calm and Post derisive topics)}
if(admin func(amiable) = true)
Create func(Helpful Posts)
else func(Keep Calm and Post derisive topics)}
-
- Developer
- Posts: 2998
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
I agree that "append" is suboptimal, but I'm not sure "join" is better. In many languages "join" is used to concatenate a list of strings into a single string with a separator:
p.s., the most common usage of append it to append an atom to a list:
p.p.s., Lisp uses the word "append" the same way:
http://en.wikipedia.org/wiki/.append#Lisp
p.p.p.s., You can always alias it:
Code: Select all
(join (list "a" "b" "c") ",") -> "a,b,c"
Code: Select all
(append (list 'a 'b 'c) 'd) -> ('a 'b 'c 'd)
http://en.wikipedia.org/wiki/.append#Lisp
p.p.p.s., You can always alias it:
Code: Select all
(setq join append)
- Star Weaver
- Militia Commander
- Posts: 311
- Joined: Sun Nov 07, 2010 10:20 pm
- Location: . . . between the stars and the warm black sky . . .
Hmm, I'd do this but wouldn't .......... oh, no it wouldn't. I was thinking it would introduce substantial call overhead but it's just a name rebindinggeorge moromisato wrote:Code: Select all
(setq join append)

I don't think i've ever used append so no big there, I've just kinda been wanting to get it out of the headspace of people trying to learn the language ....
I need to finish that best practicices page and maybe start a 'stuff that will trip you up' page .... like default global data D:.
My first encounter with append was with making pdf files where append means to put at the end of, think of an appendis of a book.
This seems to do just that in that it puts things together in the order you put them in.
Seems fine to me. to say append "thingy" with "other thingy".
In my head at least join sounds like inheriting traits of a class rather than putting things together.
This seems to do just that in that it puts things together in the order you put them in.
Seems fine to me. to say append "thingy" with "other thingy".
In my head at least join sounds like inheriting traits of a class rather than putting things together.
"Have you guys ever watched the show?" ~ Guy