« first day (1831 days earlier)      last day (237 days later) » 

5:00 AM
hyper-neutrino has unfrozen this room.
 
(q o/)
room topic changed to tinylisp and Appleseed: Discussion of tinylisp (and its pretentious younger sibling Appleseed). tio.run/#tinylisp [awesome] [functional-programming] [lisp] [minimalism] [parentheses] [tail-recursion]
 
> 1413 days later...
How old is this?
 
Pretty ancient
room topic changed to tinylisp and Appleseed: Discussion of tinylisp (and its pretentious younger sibling Appleseed). tio.run/#tinylisp [awesome] [functional-programming] [lisp] [minimalism] [parentheses] [tail-recursion]
@emanresuA Looks like the first commit to the GitHub repo is from October 2016, but the original challenge is from November 2015.
Anyway, I'm going to bed right now, but leave me any tinylisp questions you may have and I'll get to them tomorrow. ^_^
 
5:26 AM
o/
 
finally a lisp
codegolf.stackexchange.com/questions/205809/… +100 for solving this in tiny lisp. first tinylisp answer on the question wins.
 
5:58 AM
ok so the general function syntax is (f <name>(q((<args>)(<body>))))
 
6:32 AM
@DLosc what do chain-last and partial do?
I'm looking for a function that can take windows or a zipping function
oh partial is partial application
 
6:59 AM
(def zip
 (lambda (l1 l2)
  (if (* (length l1) (length l2))
   c((c((head l1) c((head l2) ()))) (zip (tail l1) (tail l2)))
   ()
)))
 
 
3 hours later…
9:40 AM
@DLosc is there a plain take function?
"n elements from the beginning of a list"
(def take
 (lambda (arr n)
  (if n (c (h arr) (take (t arr) (- n 1))) ())))
 
 
6 hours later…
4:07 PM
@Razetime There is zip, yes. It's in matrices.tl because it's based on transpose.
 
4:18 PM
@Razetime Oh, I think chain-last is borked. :/
This is what it's supposed to do.
@Razetime Looks like I overlooked take and drop (and drop-while, for that matter). :(
If you're loading the library, you can define take this way, which is more robust and also slightly golfier when golfed down:
(def take
 (lambda (ls n)
  (head (transpose (zip ls (1to n))))))
@Razetime I could've sworn I remembered implementing SKI in tinylisp before. Turns out I was remembering this . Not sure how well my answer there will translate to , but it could be a good starting point.
 
4:50 PM
A couple of general tips:
If a function isn't recursive, you can submit it as an anonymous function and save the four bytes from (d f. You'll still need the (d f for the TIO, but you don't have to count it as part of your code.
To avoid naming conflicts, I usually use uppercase letters as my parameters and (if necessary) function names in golf submissions: (d F(q((A B)(a A B)))) for example.
 

« first day (1831 days earlier)      last day (237 days later) »