Search
Saturday, 13th of August 2022, 1:49:40 UTC
2:53:48
asarch
How can you create '(a . (b . c))?
2:55:08
ultralitsun
just like that?
2:55:36
ultralitsun
(cons 'a (cons 'b 'c)) ?
2:57:13
asarch
That gives: (A B . C)
2:57:31
ultralitsun
so does '(a . (b . c)) though
2:57:40
ultralitsun
[4]> '(a . (b . c))
2:57:45
Bike
(tree-equal '(a b . c) '(a . (b . c))) => T
2:58:10
Bike
(foo . (whatever...)) = (foo whatever...)
2:58:27
asarch
(eq '(a b .c) '(a . (b . c))) → NIL
2:58:41
Bike
Sure, they're different conses
2:59:16
Bike
(eq '(a . (b . c)) '(a . (b . c))) => NIL in my implementation
2:59:39
Bike
try looking around with car and cdr to find a difference
2:59:48
Bike
(you won't) (they're the same structure)
2:59:59
ultralitsun
what's wrong with tree-equal?
3:02:22
ultralitsun
equalp will also tell you they're the same, asarch
3:02:59
ultralitsun
https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node74.html
3:05:39
asarch
(eq '(a . b) '(a . b)) → NIL
3:07:05
asarch
I was reading Land of Lisp and it says that '(a . b) at some point is better than '(a b) because it saves memory
3:08:04
asarch
So in a big app setting settings a la '(foo . (bar . baz)) could improve memory usage
3:08:33
hayley
It does, but for a large application I'd rather use a structure or a class, which will save memory, because the "keys" are stored in the class.
3:08:43
White_Flame
it's only 1 word per list
3:09:08
White_Flame
hmm, 2 words. But that's my final offer!
3:09:32
asarch
And since I am writing the CRUD generator for my web app, I was thinking to use that for the type of the column in the model
3:10:39
hayley
ACTION continues waiting for CDR coding revival
3:28:11
thomaslewis
(a . b) is one cons cell. (a b) is two (a . (b . nil))
3:29:04
thomaslewis
Was answering asarch from 20 mins ago.
3:54:07
asarch
Thank you, thank you very much :-)
5:28:36
ultralitsun
is there an ansi common lisp way to tokenize a string into a list of strings?
5:28:51
ultralitsun
'("aug 19 1991") => '("aug" "19" "1991")
5:39:15
asarch
How do get a ( or a ) as a symbol?
5:47:32
beach
ultralitsun: There is a library called split-sequence that is frequently used.
5:47:48
beach
asarch: You just type the letter.
5:48:30
beach
asarch: I recommend you draw the box diagrams of those lists you mentioned before.
5:48:54
beach
Then you will see that (a b . c) and (a . (b . c)) have the same structure.
5:49:14
asarch
How do you do the draw?
5:50:34
beach
I am not sure how to answer that. It is one of the first things you learn to do when you learn Lisp.
5:51:00
hayley
The library draw-cons-tree is useful if you have no artistic talent.
5:51:03
asarch
I remember a program from the book
5:53:01
beach
You draw a box with two parts, each part representing a slot, i.e., the CAR slot and the CDR slot.
5:54:34
masinter
https://www.google.com/search?q=DIAGRAM+OF+CONS+CELL+LIST&oq=DIAGRAM+OF+CONS+CELL+LIST&aqs=edge..69i57j0i546l2.10224j0j1&sourceid=chrome&ie=UTF-8
5:54:56
beach
asarch: The other thing you can do is to try (car '(a b . c)), (car '(a . (b . c))), (cdr ...), (cadr ...), (cddr ...)
5:55:18
beach
masinter: Oh, thank you.
5:57:49
masinter
About 8,080,000 results (0.45 seconds)
5:58:30
ultralitsun
asarch: which book are you learning lisp from?
5:59:38
ultralitsun
"Land Of Lisp" is very cartoonish, but it has a lot of "good" drawings otherwise
5:59:47
beach
http://metamodular.com/Books/land-of-lisp.html
6:00:05
ultralitsun
especially regarding the elementary stuff
6:00:44
ultralitsun
beach: I saw the libraries, but I was wondering if there was a secret trick I didn't know about yet
6:00:50
beach
I strongly recommend against using that book for learning Common Lisp.
6:01:19
beach
ultralitsun: I don't think there is. I think everyone is just using SPLIT-SEQUENCE.
6:01:26
ultralitsun
I hardly remember the book, I read it about 10 years ago
6:01:42
ultralitsun
I just remember there being plenty of visualizations
6:02:51
ultralitsun
oh darn beach you're right, now that I'm seeing this list of complaints
6:03:16
beach
And that's just the first few chapters. I haven't finished the book yet.
6:06:35
ultralitsun
critic for the critic, provide a citation
6:06:52
ultralitsun
like for that first one about the myth of case insensitivity, just link to here http://www.lispworks.com/documentation/lw51/CLHS/Body/23_ab.htm
6:07:09
ultralitsun
sorry, wrong one https://www.cliki.net/case%20sensitivity
6:07:47
beach
Well, doing this stuff is not my main work, so I have to limit the time I spend on it.
6:09:17
asarch
Believe it or not, I am using a Haskell tutorial to learn Common Lisp.
6:09:44
masinter
In Common Lisp, symbol names can be arbitrary strings
6:09:45
asarch
I mean, when you compare the two programming languages you can see things that usually don't see
6:10:21
masinter
WHY is it not allowed to have a symbol whose name consists entirely of .
6:10:47
masinter
so that .. and ... won't intern
6:10:48
beach
masinter: What makes you think it is not allowed?
6:11:52
masinter
unescaped, it's a READ problem not intern
6:14:54
masinter
what's the easiest CL to install on a x86 windows with WSL?
6:15:14
masinter
or is there a docker image already set up
6:15:28
ultralitsun
I thought about publishing one since I use it in docker all the time now
6:15:59
ultralitsun
I've been using clisp 2.49 still
6:18:36
ultralitsun
looks like plenty of people pushed clisp images
6:18:45
ultralitsun
jess/clisp was updated yesterday
6:20:10
ultralitsun
but you could quickly write your own Dockerfile to USE an official alpine/debian/ubuntu image, then RUN apk install clisp etc.
6:20:35
ultralitsun
I was at dockercon a few months ago and they were telling people to watch out regarding non-official images
6:21:48
masinter
we set up automatic creation of docker images when we do a 'nightly', to update online.interlisp.org
6:24:35
ultralitsun
do you push them to the hub?
6:24:58
ultralitsun
oh interlisp/medley right
6:27:21
masinter
https://docs.interlisp.org/home/running/running-with-docker
6:27:32
masinter
i think that's wrong tho
6:30:20
ultralitsun
I'm not familiar with interlisp
6:30:43
ultralitsun
is it GUI-centric?
6:30:46
masinter
it's an XCL window to start
6:31:23
masinter
Xerox Common Lisp (circa 20 years ago)
6:32:48
masinter
the online edition is friendlier, the docker edition has been neglected
6:34:22
ultralitsun
I kept trying to run gtk programs (emacs, eclipse) within docker containers, and had stability issues
6:35:22
ultralitsun
with Xquartz on macos and on linux, too.
6:36:50
masinter
stability requires constant vigilence
6:37:48
ultralitsun
I didn't even troubleshoot it
6:38:10
ultralitsun
there's a way to disable the NAT/ip masquerading, maybe that would help
6:38:47
masinter
we run on macs with quartz
6:38:50
ultralitsun
I don't think I tried ssh-tunneling into the contain to run the x-clients
6:39:09
ultralitsun
I don't think I tried ssh-tunneling into the containers* to run the x-clients
6:39:40
masinter
it turned out to be more stable to run Xvnc in the container
6:40:04
masinter
then run a vnc client instead of an X server on the machine with the monitor
6:43:28
masinter
online.interlisp.org runs lisp on an AWS insstance and noVNC client in the browser
6:46:15
ultralitsun
I was just messing around but thought it'd be neat if it was "seriously possible" to "run everything in docker"
6:48:24
masinter
we set up a non-profit and are taking donations to keep it running, but so far the AWS charges are minimal
6:49:11
ultralitsun
did you compare the costs to oracle?
6:49:43
masinter
well, AWS offerss $1k credit to non-profits
6:51:13
masinter
which should cover us with people just playing
7:04:54
ultralitsun
wow this is new to me
7:05:00
ultralitsun
I logged in as a guest
7:05:18
ultralitsun
I feel like I'm in a museum
7:05:27
masinter
if you make an account we'll keep your files
7:05:43
masinter
it's intended as a museum exhibit
7:06:37
ultralitsun
is there a reason it's using west coast time?
7:06:57
masinter
it didn't immplement time zones
7:07:08
ultralitsun
oh it says it's 00:07 right now
7:07:18
masinter
the machine it's running on is in ohio
7:08:01
ultralitsun
idk says it's 13-aug-2022 00:07
7:10:16
masinter
that's right isn't it?
7:10:53
ultralitsun
that's not the time in ohio
7:11:06
ultralitsun
might as well make it UTC lol
7:11:13
Shinmera
Can we get back to Lisp, thanks.
7:16:13
masinter
try (eval 'il:|\\TimeZoneComp|)
7:18:10
masinter
(setf il:|\\TimeZoneComp| 5)
7:22:28
ultralitsun
yeah that did it
7:32:34
ultralitsun
thanks for the interlisp tutorial masinter
7:33:15
masinter
i used lower case setf instead of SETQ to stay within the group's limits
11:40:22
contrapunctus
I've defined a macro similar to `defclass`, except it accepts an additional option. This option accepts multiple forms with a common grammar...is there any way to get tools like eldoc to display hints for this grammar?
Saturday, 13th of August 2022, 13:49:40 UTC