← Home ← Back to /g/

Thread 107108105

20 posts 6 images /g/
Anonymous No.107108105 [Report] >>107108133 >>107108147 >>107108152 >>107108196 >>107108563 >>107108630 >>107108663 >>107108677 >>107108712 >>107108820
the name of a function which returns the first element of a list
> first

the name of a function which returns a list of elements of a list execept the fist element
> rest

the name of a function which return the last element of a list
> last

the name of a function which returns a list of elements of a list execept the last element
> ???

suggestions?
Anonymous No.107108133 [Report]
>>107108105 (OP)
all_of_yous_guys_but_the_one_in_the_back
Send it
Anonymous No.107108147 [Report]
>>107108105 (OP)
>the fist element
How about ``tsrif''
Anonymous No.107108152 [Report] >>107108204
>>107108105 (OP)
>the name of a function which returns a list of elements of a list execept the fist element
Tail
>the name of a function which returns a list of elements of a list execept the last element
Head
Anonymous No.107108196 [Report] >>107108228
>>107108105 (OP)
[0]
[1:]
[-1]
[:-1]
Anonymous No.107108204 [Report]
>>107108152
interesting...
maybe a winner
Anonymous No.107108228 [Report]
>>107108196
You are too smart for this board.
Anonymous No.107108563 [Report] >>107108587
>>107108105 (OP)
>first
>not_first
>last
>not_last
Anonymous No.107108587 [Report]
>>107108563
I like this.
>first
>nirst
>last
>nast
Huh?
Anonymous No.107108630 [Report]
>>107108105 (OP)
why do you need a function that's just
[ H | T ] where (length T) == 1 => H
Anonymous No.107108663 [Report]
>>107108105 (OP)
>the name of a function which returns a list of elements of a list execept the last element

whitelist
Anonymous No.107108677 [Report] >>107108789
>>107108105 (OP)
sub1

The better question is why not make a function that takes three arguments: the list, the beginning index, and the last index? DRY o algo
Anonymous No.107108712 [Report]
>>107108105 (OP)
make a generic range function that works like python instead
Anonymous No.107108789 [Report] >>107108801 >>107108802 >>107108809
>>107108677
how do i remember the order of the arguments in a codebase that's 500k lines?
Anonymous No.107108801 [Report]
>>107108789
Don't put 500k lines in a single file, or use visual studio.
Anonymous No.107108802 [Report]
>>107108789
it's list, start, end, the most basic and prolific argument orders ever
Anonymous No.107108809 [Report]
>>107108789
Your intellisense
Anonymous No.107108820 [Report]
>>107108105 (OP)
allButLast()
Anonymous No.107108952 [Report]
car
cdr
rac
rdc
sage No.107110273 [Report]
rtfm
http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_butlastcm_nbutlast.html