freenode/lisp - IRC Chatlog
Search
21:54:33
aeth
It has been a while since I wrote that code but it looks like I handle nil by simply checking for the existence of tail before calling the next iteration
21:55:04
aeth
Instead of the more traditional way of having a case that handles endp (or null) at the top of a cond
21:56:23
aeth
I guess maybe I should handle the empty list at the top level (before the labels recursion) but that's not really an infix list if it's empty and there's no symbol. An infix list basically requires 3 elements as its minimum.
21:58:07
aeth
Well, speaking of reader macros... someone was talking in another Lisp channel a week ago about how C++ has the ugliest hello world so I reused my infix parser to make this: https://gitlab.com/mbabich/lisp-hello-world/blob/c45deaab9918285d3de43c52340100fef6591d15/main.lisp
21:59:12
aeth
I did it very quickly. With more time, I could probably make it semantically match C++ more (but then I'd have to relearn that part of C++ first)
22:00:24
aeth
All I did was turn that infix function into a macro (a one-liner) and then wrote a << macro in 10 lines and then wrote a reader macro in 11 lines
22:00:54
aeth
It didn't take m uch to turn parse-infix-list into a reader macro. https://gitlab.com/mbabich/lisp-hello-world/blob/c45deaab9918285d3de43c52340100fef6591d15/infix.lisp
22:01:23
aeth
Unfortunately, it's not portable because a Lisp implementation doesn't have to implement tail recursion... although I really hope you wouldn't blow the stack with a massive amount of infix.
22:04:33
aeth
refpga: get it to be printed to the SLIME REPL and then: right click and inspect or M-x slime-inspect-presentation-at-point or C-c C-v TAB
22:11:45
vms14
but I see there is usocket and should work on most implementations, so will make it more portable
1:14:56
randyjohnson86
perhaps a controversial question, but how long would one normally say to become familiar with the general lisp syntax?
1:18:12
wavemode
once you start using it to make small projects you will pick it up like any other language's syntax
1:18:55
randyjohnson86
yes, I'm slowly working my way through 'a gentle introduction to symbolic computation' by touretzky
1:19:44
randyjohnson86
it's rather quite fascinating, but I still find myself making little things in python rather than practicing my lispcraft
1:21:23
Xach
I use lisp for small things because of the nicer support for interactive ongoing development and debugging.
1:24:31
no-defun-allowed
you can use lisp on the boat, on the house, on the pets, in the kitchen, there's nothing you can't do with lisp
1:30:58
randyjohnson86
I think it will take some more time to get into the rhythm of it, it's a lot to undertake in a few settings
2:38:00
aeth
I think fixnum might be one of the few where of-type is optional, but it's better just to be uniform and always have of-type there imo
2:38:26
aeth
You have to be careful for testing it because SBCL and CCL will accept more than the spec, e.g. single-float and double-float, which will fail under CLISP
2:40:14
aeth
interestingly, I just tested that in CLISP and I only get a warning, so I guess it only fails sometimes (since it's not like CLISP has gotten a new version recently)
2:40:15
mfiano
Kind of like (declare (type fixnum ...)) vs (declare (fixnum ...)) for simple/complex forms.
2:41:43
White_Flame
if LOOP demanded keywords for its ... keywords, then it would look like actual lambda args
2:42:20
aeth
I always use keywords for LOOP keywords because then they're syntax highlighted like keywords and stand out
2:42:26
White_Flame
although the ordering demands between the key/value pairs still extends what lambda args support
2:43:58
aeth
With very minimal changes (mostly just adding some extra parens) you could have basically LOOP, but with plists. e.g. (loop :for x :of-type fixnum :below 1000000000) vs. (do-loop (:for x :of-type fixnum :below 1000000000))
2:44:36
aeth
It'd probably be hard to implement, but easier than LOOP, since you could just do destructuring-bind with &key
2:44:50
mfiano
Probably also worth mentioning you can destructure types when using loop variable destructuring.
9:36:31
decent-username
hey I'm trying to run slime and I get the following error: https://paste.gnome.org/pt8dbzbnx