« first day (1835 days earlier)      last day (233 days later) » 

01:06
I don't get why this doesn't work
(d f(q(()()(disp (q a) (f) )))))
in fact, I haven't had any luck with parameterless functions at all and it's driving me nuts
01:53
@DLosc oh smort
@DLosc in tinylisp?
@DLosc Try it online! is about as low as i could get.
@chunes That's a macro (macros are lists with three elements; functions have two). Also, disp only takes one argument and you've given it two, (q a) and (f).
@Razetime You're on the right track! Try making the function variadic.
02:09
variadic?
that's a thing??
> A function is a list of two items. The first is either a list of parameter names, or a single name which will receive a list of any arguments passed to the function (thus allowing for variable-arity functions).
oh i see
that reduces 2
@chunes ...aaand it turns out that the official implementation assumes that any list starting with () is trying to be a macro, so you actually can't write a parameterless function. But you can write a variadic function and pass it 0 parameters.
OH I GOT IT
this is very funny
now i wonder where i can lose 3 bytes
You have 18?
02:13
yes
Interesting... I'm not seeing an obvious 18-byter, unless it's the 15-byter with some unnecessary stuff added (which, maybe it is).
oops
@Razetime Oh, right. Yes, I do remember going through that stage now that you mention it.
@chunes Must be a full program, tho
so you have to also call the function
@DLosc hm this is not very easy to spot
02:17
Hint: what happens if you try other builtins instead of v?
ok i have 17 lol
yep got 15
Ayyy ^_^
In other news:
very cute
hm so 15 can be done in one line and two lines
lisp is a helluva drug
@Razetime Huh, you're right! For some reason I never tried the one-line version and just assumed it would be 16 bytes.
the newline's removed so it's the same lul
codegolf.stackexchange.com/questions/210976/… there has to be no proper way to do this right
considering that disp is only print with newline
02:29
Yeah, tinylisp can't do that one.
is there no way to get stdin?
Nope
tinylisp is almost a pure functional language--only disp can cause side-effects.
what lisp needs is monads
that highlighter will actually be really helpful for me, thanks
Oh, yesterday I was trying to figure out how to (d things inside functions and then refer to them later in the function but couldn't get it to work. Can it work?
@Razetime I don't know Haskell well enough to claim I understand monads, but I tried to do maybe something in that direction with Appleseed, but with an event-driven model. It just ended up being clunky and annoying.
@chunes I think not--anyway, it's not supposed to. But I can't say for 100% sure that it actually doesn't. Let me try something...
02:37
@DLosc i don't know them either
but i sit around enough fp folks to know its use
dear DLosc if am doing "functional" programming then why doesn't my program work
I guess sometimes it's "dysfunctional" programming X^D
ok
how would i convert an integer to a name?
@chunes It appears that it can work. But getting it to do anything useful is going to be tricky.
fair enough
@Razetime Somewhat surprisingly, just pass it to string
02:51
Ooh, all this time I thought subtraction is in the library but it isn't
This is handy
03:12
@DLosc burh
@chunes Yes. s is the one math builtin atop which the entire library is constructed. (Though a is also a builtin because I got tired of writing (s X (s 0 Y)) to add two numbers.)
03:29
i don't know why the it's erroring on 0
and it refuses to display
even stranger
related to this
03:42
@Razetime join won't work with an empty list, it has to be an empty name (string ())
Oh, also, -265 is not an integer literal, it's a name. Use (neg 265) instead.
I take it back, join does work with an empty list, sort of: it calls chars, which should return nil if it's passed an empty name; when it's passed a list it errors... and returns nil.
03:58
@DLosc amazing
so i unintentially golfed it properly
 
1 hour later…
05:15
@Razetime Hint: I have a 21-byte (anonymous function) solution for finding the sign of a number, and it doesn't involve strings at all.
05:43
@DLosc mine is 32 now
if i remove the def part it's.. 29?
 
12 hours later…
17:40
@Razetime Reminder: there's no need for strings at all. You're still returning -1 as a string (q -1) when you could be returning the actual number -1.
 
2 hours later…
19:33
Update: the syntax highlighter now adds implicit parentheses, indicates matching parentheses and the content between them, and highlights unmatched close-parens in red.

« first day (1835 days earlier)      last day (233 days later) »