summaryrefslogtreecommitdiffstats
path: root/2024/captions/emacsconf-2024-mcclim--elisp-and-mcclim--screwlisp--main.vtt
blob: f37aea64f21184d4a9aaafff4eb577cad0521ca6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
WEBVTT captioned by rodrigo

NOTE Introduction

00:00:01.750 --> 00:00:11.969
Welcome everyone to my EmacsConf presentation,

00:00:15.370 --> 00:00:22.089
where we're going to look at Lisp's vdemo[??] app from 1978,

00:00:22.139 --> 00:00:25.659
but done in modern Elisp.

00:00:28.460 --> 00:00:33.039
Then we're going to look at getting inferior-lisp working,

00:00:33.390 --> 00:00:34.753
my dear Common Lisp.

00:00:37.003 --> 00:00:42.059
Then we're going to use the Common Lisp interface manager,

00:00:42.159 --> 00:00:45.663
the open source child of the Common Lisp interface manager,

00:00:47.813 --> 00:00:52.959
McCLIM, from inferior-lisp in Superior Lisp,

00:00:55.710 --> 00:00:58.325
which is the opposite order that I initially thought

00:00:58.375 --> 00:00:59.276
we were going to do things in,

00:00:59.326 --> 00:01:00.779
but this is how it's kind of turned out.

00:01:00.829 --> 00:01:01.795
So it's this article,

00:01:01.845 --> 00:01:05.199
I thought, from 1978, was interesting to us today.

00:01:05.999 --> 00:01:08.702
“Programming in an Interactive Environment:

00:01:08.752 --> 00:01:11.805
the ‘Lisp’ Experience.”

00:01:12.005 --> 00:01:17.678
Explaining what all these LISP programmers were doing to

00:01:19.478 --> 00:01:22.466
people unfamiliar with LISP programming.

00:01:22.566 --> 00:01:24.401
“LISP systems have been used for

00:01:24.451 --> 00:01:27.454
highly interactive programming for more than a decade.”

00:01:27.604 --> 00:01:29.790
This was from 1978.

00:01:29.990 --> 00:01:31.959
And we're just going to go and,

00:01:34.109 --> 00:01:39.717
almost verbatim, port the demo application for LISP

00:01:40.017 --> 00:01:46.119
out of 1978 Interlisp and into Emacs Lisp.

00:01:49.720 --> 00:01:51.428
And we're going to do it without Org Mode,

00:01:51.478 --> 00:01:54.231
because I think everyone is finding out

00:01:54.281 --> 00:01:56.950
how great Org Mode is already.

00:01:58.100 --> 00:02:00.787
For inferior Lisp, I thought instead of org-mode,

00:02:00.837 --> 00:02:02.823
we'll theme it around slime-mode and then it turned out

00:02:02.873 --> 00:02:06.059
most of this presentation happens in Emacs Lisp,

00:02:06.109 --> 00:02:08.929
because this is an Emacs Lisp conference.

00:02:09.379 --> 00:02:12.799
But I found out that there's ielm-mode,

00:02:12.849 --> 00:02:17.604
which is pretty similar to slime-mode,

00:02:19.054 --> 00:02:23.610
but in our hearts, we can imagine that this is

00:02:23.660 --> 00:02:27.448
an Emacs example, homed around slime-mode,

00:02:27.498 --> 00:02:33.353
Superior Lisp Interaction Mode for Emacs, instead of org-mode.

00:02:33.403 --> 00:02:36.390
Though, you know, I do secretly use org-mode as well,

00:02:36.440 --> 00:02:37.858
not very secretly.

00:02:37.958 --> 00:02:40.539
But that means we're kind of improvising,

00:02:46.790 --> 00:02:48.786
improvising a presentation mode.

00:02:49.986 --> 00:02:55.576
So we have this big buffer of Elisp, and let's just...

00:02:56.726 --> 00:02:59.164
This is me, not Sandewall, out of interest,

00:03:00.614 --> 00:03:02.616
let's make a keyboard macro,

00:03:04.216 --> 00:03:10.240
go get the S-expression wherever the cursor is,

00:03:10.290 --> 00:03:13.611
move it to the next S-expression, paste it in here,

00:03:13.661 --> 00:03:15.989
and the keyboard macro, alright.

00:03:20.190 --> 00:03:21.652
What was basically happening...

NOTE Calendar

00:03:21.702 --> 00:03:25.306
So the demo application in this case is

00:03:25.356 --> 00:03:27.842
a scheduling application.

00:03:28.792 --> 00:03:34.631
And so you can imagine improvising a calendar like this

00:03:34.731 --> 00:03:36.633
if you weren't existingly using an

00:03:36.683 --> 00:03:38.952
org-mode integrated calendar.

00:03:39.252 --> 00:03:42.739
So, you know, just have a list and maybe

00:03:43.989 --> 00:03:49.479
each list is of sublists, where the first element,

00:03:49.579 --> 00:03:51.531
the car of the sublist, I guess,

00:03:51.931 --> 00:03:55.669
is a sensible-sounding date format, like sat dec 7,

00:03:56.119 --> 00:03:59.589
this is clearly the first day of EmacsConf.

00:03:59.939 --> 00:04:06.230
Then after that, a list of basically from and to times,

00:04:06.280 --> 00:04:18.592
and then a quick written description of whatever event

00:04:18.642 --> 00:04:19.576
was at that time.

00:04:19.876 --> 00:04:23.130
So similar to what we were seeing recently

00:04:23.180 --> 00:04:25.449
as of me recording this in our Structure and

00:04:25.499 --> 00:04:28.902
Interpretation of Computer Programs study group,

00:04:29.902 --> 00:04:35.709
you have all these little methods, sorry, defuns.

00:04:35.759 --> 00:04:39.513
So hours of a time is actually just car of the time,

00:04:40.763 --> 00:04:42.966
minutes of the time, cadr of time.

00:04:43.216 --> 00:04:46.719
And so we all know these kind of little,

00:04:46.720 --> 00:04:50.173
basically turning car and cadr,

00:04:50.223 --> 00:04:53.093
which we do use into descriptive names like from and to.

00:04:53.143 --> 00:04:56.329
You can see how this lines up with the appointments.

00:04:56.379 --> 00:05:01.701
So for "reproducibly building emacs" described event,

00:05:01.751 --> 00:05:05.679
I guess from would be 16 25.

00:05:05.680 --> 00:05:07.658
Let's just grab that and literally use those,

00:05:07.708 --> 00:05:11.011
because we're in interactive programming, right?

00:05:11.711 --> 00:05:18.216
So we have this quoted form and then

00:05:18.266 --> 00:05:22.240
let's do from of that. Great.

00:05:22.290 --> 00:05:24.458
And let's do minutes.

00:05:25.308 --> 00:05:31.498
So from 16 25, 16 45 reproducibly building Emacs,

00:05:31.548 --> 00:05:34.801
so when I do from to that I get 16 25

00:05:34.851 --> 00:05:40.707
when I do minutes to 16 25, I get 25

00:05:42.057 --> 00:05:45.489
and a description of this number in octal and hexadecimal,

00:05:45.590 --> 00:05:47.147
out of interest.

00:05:48.047 --> 00:05:52.953
What was up next? Okay, getting nextday from a date.

00:05:53.553 --> 00:05:57.023
And so, what was it? Saturday, December 27th.

00:05:57.073 --> 00:05:59.245
So what happens? So this function,

00:06:01.345 --> 00:06:05.932
I guess this was part of Sandewall's personal exploration of

00:06:06.032 --> 00:06:12.188
atoms using symbols with property lists,

00:06:12.238 --> 00:06:15.492
with an attached property list to every symbol.

00:06:15.942 --> 00:06:18.059
And so you can kind of see how this works.

00:06:21.510 --> 00:06:32.799
I get whatever was keyed by the symbol nextweekday out of

00:06:32.800 --> 00:06:36.529
the day symbol, so I guess we would do...

00:06:36.579 --> 00:06:46.640
so if we had Sat December 6, I guess we get Sat

00:06:48.140 --> 00:06:54.379
Oh, it destructures that itself somehow, get nextweekday.

00:06:58.429 --> 00:07:02.279
Sorry, nextday.

00:07:02.280 --> 00:07:10.170
set December 6th

00:07:10.270 --> 00:07:12.732
But of course these weren't defined yet,

00:07:12.782 --> 00:07:23.593
so what if we (setf (get 'sat 'nextweekday) 'sun)

00:07:23.793 --> 00:07:25.239
and it's going to be sun right

00:07:28.990 --> 00:07:34.369
And then if we (nextday '(sat dec 6)),

00:07:36.720 --> 00:07:38.392
Sunday, December 7th.

00:07:38.942 --> 00:07:41.628
Yeah, so that kind of makes sense in an intuitive way.

00:07:41.778 --> 00:07:43.550
And you can see cond is being used.

00:07:43.850 --> 00:07:51.538
So if you're not a Lisp person, cond evaluates a condition.

00:07:51.588 --> 00:07:54.708
If the condition returns non-nil,

00:07:54.758 --> 00:07:57.160
it executes the code attached to that condition.

00:07:57.210 --> 00:08:00.247
It evaluates each of these conditions in terms

00:08:00.297 --> 00:08:04.851
and then stops when one returns non-nil,

00:08:04.901 --> 00:08:07.420
as you might expect as a Lisp programmer.

00:08:07.670 --> 00:08:09.622
Let's keep marching along.

00:08:09.672 --> 00:08:11.691
Okay, so we have to populate this.

00:08:11.741 --> 00:08:13.493
And this was an interesting one.

00:08:13.543 --> 00:08:15.562
As you can see, this was my attempt.

00:08:15.612 --> 00:08:19.199
let days mon tue wed, so forth.

00:08:19.249 --> 00:08:23.403
Then I used cl-loop from Emacs Lisp, you know,

00:08:23.453 --> 00:08:32.359
for day in days, for nex in cdr days, setf nextweekday.

00:08:32.610 --> 00:08:35.382
This I thought was surprisingly deep, was that

00:08:36.432 --> 00:08:38.435
Lisp programmers, Sandewall thought,

00:08:38.485 --> 00:08:43.123
are basically constantly trying to break new ground and they

00:08:43.723 --> 00:08:45.325
lose interest very quickly when

00:08:45.425 --> 00:08:46.743
that's not what they're doing.

00:08:46.843 --> 00:08:50.129
And he was making the point that breaking new ground

00:08:50.229 --> 00:08:52.832
involves solving a problem exactly once.

00:08:54.232 --> 00:08:55.903
And so you kind of should do it

00:08:56.003 --> 00:08:58.572
in the most expedient way possible

00:08:58.672 --> 00:09:00.692
to solve it kind of for the first time.

00:09:00.992 --> 00:09:07.113
And after that, it's not breaking new ground anymore.

00:09:07.663 --> 00:09:10.350
And so I thought that was a kind of fun point

00:09:10.400 --> 00:09:14.521
from Sandewall's paper that we could kind of chew on.

00:09:15.121 --> 00:09:19.359
Do something similar for months and month lengths.

00:09:21.059 --> 00:09:30.120
But as we can see, if I get Feb,

00:09:32.120 --> 00:09:41.982
nrdr days I think that characters in 1978,

00:09:42.082 --> 00:09:45.418
characters and symbols in 1978 were more precious

00:09:45.468 --> 00:09:47.821
which is why Sandewall was writing in this abbreviated way.

00:09:47.871 --> 00:09:51.341
We might write more verbosely these days.

00:09:51.391 --> 00:09:54.177
We get 28th but it is in fact a leap year,

00:09:54.277 --> 00:09:58.998
so let's just set that to be 29. Now, it's fine.

00:09:59.048 --> 00:10:05.638
Then I guess if we do, we were doing nextday.

00:10:06.038 --> 00:10:10.944
Sure, nextday. I don't know what day it was.

00:10:10.994 --> 00:10:16.716
let's assume it was Sunday Feb 28

00:10:22.716 --> 00:10:26.179
some kind of typo crept in there, but we can deal with it.

00:10:26.230 --> 00:10:43.844
Let's just setf get sun nextweekday month.

00:10:43.944 --> 00:10:48.648
So once we've solved it once, we should be fine, right?

00:10:48.698 --> 00:10:51.849
Okay, I think I have to speed up a bit.

00:10:52.000 --> 00:10:55.555
Yeah, there we go, Monday February 29th and then

00:10:55.605 --> 00:11:01.194
what if we nextday... Tuesday March 1st.

00:11:01.244 --> 00:11:03.700
Okay, it basically seems to be working.

00:11:03.750 --> 00:11:06.398
And I'd argue it's actually fun that

00:11:06.448 --> 00:11:08.535
we kind of had to do that.

00:11:08.585 --> 00:11:13.473
Then, just imagining you're kind of functioning with

00:11:13.523 --> 00:11:18.311
other people: day begins at 900, ends at 1700,

00:11:18.361 --> 00:11:22.415
so kind of a 9:00 to 5:00, imagining... though perhaps,

00:11:23.915 --> 00:11:25.318
shorter is more appropriate,

00:11:25.368 --> 00:11:27.320
but let's not quibble about that.

00:11:27.420 --> 00:11:29.789
What was happening next in this app?

00:11:29.839 --> 00:11:35.562
holesin. Oh, yeah, so get me the free slots

00:11:35.712 --> 00:11:40.060
in from start time, list of appointments,

00:11:40.110 --> 00:11:45.238
remembering characters, I guess, were more precious

00:11:45.288 --> 00:11:46.556
is my theory.

00:11:46.906 --> 00:11:58.399
And then an end time, so if I go holesin and then from 900

00:11:59.050 --> 00:12:02.689
to where I've written 9 space 0 0

00:12:03.389 --> 00:12:05.959
and what are my appointments?

00:12:07.459 --> 00:12:09.930
So I have a list of appointments that

00:12:09.980 --> 00:12:12.032
need to have start times and finish times.

00:12:12.132 --> 00:12:20.080
So let's go 12 59 to 13 01.

00:12:23.580 --> 00:12:25.379
The description, I guess, can be test.

00:12:25.429 --> 00:12:28.715
And then let's finish that at 1700,

00:12:29.115 --> 00:12:30.729
like we kind of thought.

00:12:37.830 --> 00:12:41.049
Oops, some of these were meant to be arguments.

00:12:54.800 --> 00:12:55.742
Okay, there we go.

00:12:56.042 --> 00:13:01.297
And so the available times between nine and five,

00:13:01.397 --> 00:13:04.429
if there's one appointment from 12:59 to 1:01,

00:13:05.580 --> 00:13:13.092
are from 9 to 1259 and from 1 past 1 to 5,

00:13:13.792 --> 00:13:15.528
which is kind of what we were expecting.

00:13:15.728 --> 00:13:18.631
And so our appointment app is kind of coming along.

00:13:18.931 --> 00:13:20.379
Then we have commonholes,

00:13:23.430 --> 00:13:25.189
kind of works in a sensible way.

00:13:33.890 --> 00:13:36.199
Do we have, what are some common holes from

00:13:36.249 --> 00:13:40.153
two lists of appointments, I guess? commonholes.

00:13:50.903 --> 00:13:53.800
I guess, let's have one person have an appointment

00:13:53.850 --> 00:13:56.419
from 9 to 10.

00:13:59.569 --> 00:14:02.508
That's going to be their only appointment.

00:14:02.558 --> 00:14:05.946
And let's have another person have an appointment

00:14:05.996 --> 00:14:10.399
from 9.30 to 10.30.

00:14:14.450 --> 00:14:18.391
Oh, we didn't do beforetime yet.

00:14:18.441 --> 00:14:22.295
This is the order Sandewall implemented things in there.

00:14:22.345 --> 00:14:25.465
Ok, there.

00:14:25.515 --> 00:14:32.972
So the commonholes are from 9.30 to 10.

00:14:34.272 --> 00:14:42.182
That's actually the overlapping time.

00:14:42.232 --> 00:14:43.850
I'll re-record this

00:14:43.900 --> 00:14:50.799
if some kind of gremlin has crept into my things.

00:15:04.150 --> 00:15:06.839
And then, what did we first start by doing?

00:15:07.389 --> 00:15:11.444
Emacsconf track 1 and Emacsconf track 2,

00:15:11.494 --> 00:15:15.139
and we'll do it on Saturday, December 7.

00:15:21.140 --> 00:15:23.756
commontime, and I'm being prompted, of course.

00:15:23.806 --> 00:15:27.226
emacsconf-track-1,

00:15:29.676 --> 00:15:32.369
emacsconf-track-2,

00:15:33.370 --> 00:15:35.485
the date that we grabbed.

00:15:36.585 --> 00:15:39.519
Let's say we want five minutes.

00:15:49.120 --> 00:15:52.418
And, as always, I'm forgetting to quote things.

00:15:52.468 --> 00:15:56.689
And so my opportunities for common times

00:15:56.739 --> 00:16:01.326
between emacsconf-track-1 to emacsconf-track-2

00:16:01.376 --> 00:16:02.819
on the first day of the conference,

00:16:02.869 --> 00:16:05.464
Saturday, December 7th, for five minutes.

00:16:05.864 --> 00:16:08.834
I have an opportunity between 9:20 and 9:40,

00:16:08.984 --> 00:16:13.639
11:40 and 13:00, 13:10, 13:25,

00:16:14.489 --> 00:16:19.612
13:45, 13:55, and 16:15 to 16:25.

00:16:19.662 --> 00:16:21.581
So I think that's all working.

00:16:23.881 --> 00:16:29.155
And it was done with almost exactly the same code,

00:16:31.355 --> 00:16:38.965
except for my loopy populating symbol plist bits earlier,

00:16:39.015 --> 00:16:46.489
in Interlisp in 1978 as Emacs Lisp in 2024.

00:16:46.539 --> 00:16:48.625
I thought that was pretty interesting that

00:16:48.675 --> 00:16:49.492
you could do that.

00:16:49.542 --> 00:16:57.049
I think setf get was put prop

00:16:57.099 --> 00:17:02.737
was the biggest difference in 1978 Interlisp and

00:17:02.787 --> 00:17:04.690
modern Emacs Lisp.

00:17:04.740 --> 00:17:09.178
And obviously modern Emacs Lisp has Common Lisp loop in it,

00:17:09.228 --> 00:17:11.514
kind of. It's another big difference.

00:17:11.914 --> 00:17:16.099
How are we doing for time? 17 minutes?

00:17:16.450 --> 00:17:19.105
Great, because now let's get a bit closer to what

00:17:19.805 --> 00:17:21.941
my talk title has promised.

00:17:21.991 --> 00:17:24.911
We're going to use Common Lisp from Emacs Lisp

00:17:25.211 --> 00:17:28.080
and we're going to use Common Lisp Interface Manager,

00:17:28.130 --> 00:17:30.116
the open source implementation of

00:17:30.166 --> 00:17:33.786
Common Lisp Interface Manager from

00:17:33.836 --> 00:17:36.999
Inferior Lisp from Emacs Lisp.

00:17:37.300 --> 00:17:42.695
And what we just went over in Sandewall's paper...

00:17:45.550 --> 00:17:47.683
This was the starting point, and Sandewall says,

00:17:47.783 --> 00:17:51.537
well, if you just kind of jammed these ideas using lists

00:17:51.587 --> 00:17:55.341
you just kind of made hour a synonym for car and

00:17:55.391 --> 00:17:58.945
minute a synonym for cadr and so forth,

00:17:59.795 --> 00:18:03.066
you can then make a whole bunch of improvements.

00:18:04.166 --> 00:18:06.689
Can we actually get a glimpse of the …

00:18:09.239 --> 00:18:10.423
No, I didn't really write this.

00:18:10.473 --> 00:18:14.244
Yeah, so you can see I basically just ported out of

00:18:14.294 --> 00:18:17.430
the Interlisp code in the text of this paper.

00:18:17.580 --> 00:18:21.300
Yeah, you see from lambda of appointment,

00:18:21.350 --> 00:18:24.904
car appointment, and that's defineq.

00:18:24.954 --> 00:18:27.857
I guess Interlisp in 1978 used defineq,

00:18:27.907 --> 00:18:32.311
whereas we used defun in Elisp,

00:18:33.361 --> 00:18:35.264
but I'd encourage you to explore that yourselves.

00:18:35.314 --> 00:18:38.551
But the extension that I wanted to develop today is,

00:18:38.601 --> 00:18:41.187
since Common Lisp interface manager is just Lisp,

00:18:41.237 --> 00:18:43.422
and Inferior Lisp is just Lisp,

00:18:43.472 --> 00:18:45.291
and Emacs Lisp is just Lisp,

00:18:45.341 --> 00:18:48.878
and Interlisp in 1978 is just Lisp,

00:18:48.928 --> 00:18:50.112
we could kind of use them all together

00:18:50.162 --> 00:18:51.430
in a kind of funky way.

00:18:51.480 --> 00:18:57.036
But a complaint you often hear, or a statement of confusion

00:18:57.086 --> 00:19:00.373
that you often hear as a Lisp person,

00:19:00.423 --> 00:19:06.712
people from other languages often can't kind of figure out

00:19:06.762 --> 00:19:09.715
how to get started with Lisp.

00:19:09.765 --> 00:19:12.752
So I'm just going to try and do everything here and now.

NOTE Inferior Lisp and McCLIM

00:19:12.802 --> 00:19:18.357
And this is the second piece of my three pieces,

00:19:18.407 --> 00:19:22.628
so let's just get inferior lisp and McCLIM happening.

00:19:22.928 --> 00:19:29.268
We normally use slime Superior Lisp Interaction Mode

00:19:29.318 --> 00:19:41.847
for Emacs, which we could get from Emacs's package manager.

00:19:41.897 --> 00:19:48.604
If I go package-list-packages and then we wait

00:19:48.954 --> 00:19:50.969
for however fast my network is,

00:19:54.270 --> 00:19:55.311
we're going to see how long it's been

00:19:55.361 --> 00:19:57.079
since I updated something.

00:19:58.629 --> 00:20:00.999
Yeah, but you see it's in MELPA, right?

00:20:15.750 --> 00:20:16.982
It's got to be somewhere here.

00:20:18.082 --> 00:20:18.501
Yeah, all right.

00:20:18.551 --> 00:20:21.420
So there's one slime available in non-GNU,

00:20:21.470 --> 00:20:25.958
one possibly more recent one available in

00:20:26.758 --> 00:20:28.678
the MELPA package repositories.

00:20:30.278 --> 00:20:30.963
I don't know about you,

00:20:31.013 --> 00:20:33.616
but I can sympathize with people who feel confused by this

00:20:33.666 --> 00:20:36.469
because I think if you look online,

00:20:36.519 --> 00:20:38.637
if you found a search engine result,

00:20:38.687 --> 00:20:44.110
it doesn't customize these like I customize them.

00:20:44.160 --> 00:20:45.945
So let's just do this.

00:20:45.995 --> 00:20:48.147
customize-variable.

00:20:48.197 --> 00:20:52.318
package-archives.

00:20:54.518 --> 00:21:00.392
Yeah and you can see here I've ins-ed gnu, non-gnu, and melpa.

00:21:00.542 --> 00:21:02.628
It's melpa, not melpa stable.

00:21:03.478 --> 00:21:04.359
Saved and set.

00:21:06.810 --> 00:21:08.334
So that's how I do that.

00:21:08.384 --> 00:21:13.279
We're just kind of totally get an inferior lisp working.

00:21:17.130 --> 00:21:20.599
And then, like we saw before,

00:21:20.949 --> 00:21:22.648
this might occur, buffer is still open.

00:21:23.148 --> 00:21:26.879
No. occur. slime.

00:21:35.330 --> 00:21:38.631
So we could install and execute that.

00:21:38.681 --> 00:21:41.734
I cloned slime since Common Lisp people

00:21:41.784 --> 00:21:48.874
might use slime and swank, like McCLIM does outside of Emacs.

00:21:48.924 --> 00:21:51.043
I think we can secretly see

00:21:51.093 --> 00:21:55.614
I've got it here already in my ~/.emacs.d/slime,

00:21:56.064 --> 00:22:00.119
but you could install it like that. The hotkey is I,

00:22:00.169 --> 00:22:02.021
and then execute the install.

00:22:02.071 --> 00:22:03.789
I realize you all already know this,

00:22:04.039 --> 00:22:06.759
but many of you might not yet be Common Lisp programmers,

00:22:06.809 --> 00:22:09.569
and you can use both Superior and Inferior Lisp.

00:22:10.370 --> 00:22:14.733
Instead of package archives in Emacs,

00:22:14.783 --> 00:22:19.705
in Inferior Lisp, and with great controversy,

00:22:19.755 --> 00:22:22.708
we often use QuickLisp.

00:22:22.758 --> 00:22:25.778
People sometimes complain QuickLisp releases

00:22:25.828 --> 00:22:27.780
get out of date quite quickly.

00:22:28.630 --> 00:22:31.717
But there was one recently, so they're pretty in date.

00:22:32.167 --> 00:22:35.321
And so there should be a …

00:22:35.371 --> 00:22:39.058
Yeah, so basically you download quicklisp.lisp,

00:22:39.158 --> 00:22:41.959
you check its SHA-256 sum.

00:22:44.910 --> 00:22:47.829
So I guess in, ooh, over here, if I press D,

00:22:51.229 --> 00:22:53.706
~screwtape/downloads/quicklisp.lisp.

00:22:53.756 --> 00:22:57.376
Great. If we open a shell, we realize that

00:22:57.426 --> 00:23:03.599
this is just riveting for all of our experts there.

00:23:06.450 --> 00:23:15.919
sha256 ~/Downloads/quicklisp.lisp

00:23:19.720 --> 00:23:22.001
Your SHA-256 might be different to mine.

00:23:22.601 --> 00:23:25.471
Somebody please tell me during the actual conference,

00:23:25.621 --> 00:23:29.125
the right Emacs idiom to do this.

00:23:29.225 --> 00:23:32.679
I guess it will be tools decrypt something.

00:23:33.930 --> 00:23:36.014
But then once you have QuickLisp,

00:23:36.214 --> 00:23:37.959
let's go back to our shell.

00:23:41.810 --> 00:23:46.625
I'm on OpenBSD or a BSD, so I type pkg_add ecl

00:23:46.675 --> 00:23:48.239
to get embeddable Common Lisp.

00:23:53.590 --> 00:23:55.090
However, I think I already have it.

00:23:58.540 --> 00:24:02.069
And then, let's start ecl [embeddable Common Lisp].

00:24:04.670 --> 00:24:07.039
Quicklisp inserts itself already,

00:24:11.290 --> 00:24:14.920
but just loading that quicklisp.lisp file

00:24:14.970 --> 00:24:16.989
kind of would get you here anyway.

00:24:17.039 --> 00:24:22.939
Now let's (ql:quickload :mcclim)

00:24:27.140 --> 00:24:28.769
I'm actually following my plan.

00:24:33.269 --> 00:24:38.294
McCLIM is kind of like Emacs in that

00:24:38.344 --> 00:24:40.713
it handles all sorts of graphical stuff

00:24:41.013 --> 00:24:42.748
like if you have GTK Emacs,

00:24:42.798 --> 00:24:44.333
you know, it can do really a lot of stuff.

00:24:44.383 --> 00:24:48.604
That's the reason why compiling and loading

00:24:50.504 --> 00:24:53.125
the McCLIM package takes a while

00:24:53.175 --> 00:24:56.962
and I do use my old computer laptop,

00:24:57.012 --> 00:25:00.299
my old computer challenge laptop all the time,

00:25:00.349 --> 00:25:02.685
so when you do this, your computer will be

00:25:02.735 --> 00:25:05.504
substantially faster or you will be feeling

00:25:06.404 --> 00:25:09.609
smug about how slow you're running your computer,

00:25:12.759 --> 00:25:15.481
and so there's no problem.

00:25:15.531 --> 00:25:17.316
Next, we're going to start Swank

00:25:17.366 --> 00:25:23.699
which is the Lisp part of Emacs's slime-mode.

00:25:27.649 --> 00:25:32.298
If I remember, we looked at this before

00:25:32.348 --> 00:25:34.700
in my .emacs.d,

00:25:35.050 --> 00:25:40.499
and then there should be slime/start-swank.lisp.

00:25:41.699 --> 00:25:44.643
Let's just grab that and load it.

00:25:46.293 --> 00:25:48.470
You don't have to type #p.

00:25:48.870 --> 00:25:51.150
The string will work as well as the path name,

00:25:51.200 --> 00:25:52.618
but it's kind of fun to do so.

00:25:52.668 --> 00:25:55.287
Now, slime-connect.

00:25:55.437 --> 00:25:56.859
You installed slime earlier.

00:25:57.559 --> 00:25:59.024
Default values.

00:25:59.074 --> 00:26:01.794
Oh, the reason we had to do this

00:26:01.844 --> 00:26:07.064
and not use Slime, start Slime normally was that

00:26:07.214 --> 00:26:10.736
CLIM, Common Lisp Interface Manager,

00:26:10.786 --> 00:26:12.204
McCLIM, implementation of the

00:26:12.254 --> 00:26:16.275
Common Lisp Interface Manager spec, also uses Swank

00:26:16.675 --> 00:26:19.912
and McCLIM really wants to be in the driver's seat.

00:26:20.162 --> 00:26:23.282
We can have our Emacs connect

00:26:23.332 --> 00:26:28.053
to the Swank that McCLIM was already running.

00:26:28.553 --> 00:26:30.823
So (in-package :clim-user)...

00:26:30.873 --> 00:26:33.575
I don't know if this is an Emacs Lisp idiom,

00:26:33.625 --> 00:26:37.112
so you normally have user packages to absorb user code

00:26:37.162 --> 00:26:38.809
just for fooling around.

00:26:42.110 --> 00:26:47.556
Then let's just use clim at all.

00:26:47.606 --> 00:26:52.544
And so clim does lots of things around presentations

00:26:53.094 --> 00:26:58.317
but one thing it does is automatically, to a large extent,

00:26:58.367 --> 00:27:03.956
generate graphical user interfaces.

00:27:04.006 --> 00:27:09.394
So there's a lot to it that's not about graphics,

00:27:09.444 --> 00:27:13.332
kind of richer interfaces than

00:27:14.082 --> 00:27:17.089
ANSI Common Lisp's character streams.

00:27:19.389 --> 00:27:23.158
But let's use it to grab a graphical pop-up

00:27:23.258 --> 00:27:24.393
that returns a value.

00:27:24.743 --> 00:27:27.413
So we have this accepting-values tool.

00:27:28.013 --> 00:27:31.950
t is just choose whatever you think the default stream is.

00:27:32.150 --> 00:27:36.088
We're going to want our own window, t as well,

00:27:36.688 --> 00:27:38.390
so just a keyword argument.

00:27:38.640 --> 00:27:43.328
After that, we can just write things like (accept 'string).

00:27:44.978 --> 00:27:47.883
And I'm just doing this in, for people only listening,

00:27:47.933 --> 00:27:50.936
I've just done this in my ECL Slime REPL.

00:27:50.986 --> 00:27:55.279
Enter a string: foo bar baz.

00:27:56.530 --> 00:27:58.849
Alt-Enter, I think, is the shortcut to return that.

00:27:59.150 --> 00:28:02.248
As you can see, its first return was "foo bar baz",

00:28:02.298 --> 00:28:04.316
and it had second and third returns,

00:28:04.366 --> 00:28:10.105
string being the type, presentation type that it got,

00:28:10.155 --> 00:28:13.739
and t, I think, to indicate that it exited successfully.

00:28:16.189 --> 00:28:20.916
We can also do expression, might be more interesting.

00:28:20.966 --> 00:28:22.189
There are a whole bunch of these.

00:28:26.140 --> 00:28:29.308
clim's examples folder is pretty good.

00:28:29.358 --> 00:28:32.294
And the documentation, everybody's documentation,

00:28:32.344 --> 00:28:34.713
McCLIM's documentation, you know,

00:28:35.413 --> 00:28:39.135
lispworks and franz's documentation will tell you about

00:28:39.385 --> 00:28:45.069
the different default presentation types you can accept.

00:28:47.969 --> 00:28:49.862
And they're pretty intuitive and

00:28:49.912 --> 00:28:52.464
they're kind of very Lisp compatible,

00:28:53.264 --> 00:28:54.266
which everything kind of is.

00:28:54.316 --> 00:29:00.399
We could accept an expression. foo bar baz.

00:29:05.350 --> 00:29:09.414
return "foo bar baz 123" because that's what I wrote.

NOTE Putting things together

00:29:10.964 --> 00:29:14.570
And now the kind of pièce de résistance

00:29:14.820 --> 00:29:17.055
of putting those things together.

00:29:17.555 --> 00:29:21.326
Let's just run over to our scratch buffer.

00:29:22.226 --> 00:29:24.096
Oh, or our ielm thing, right?

00:29:24.246 --> 00:29:25.564
That's what we're actually doing.

00:29:25.964 --> 00:29:28.951
So now, I think we're going to do, hang on,

00:29:30.251 --> 00:29:32.871
M-:.

00:29:32.921 --> 00:29:41.313
I think it's going to be slime-eval-save,

00:29:41.663 --> 00:29:44.549
because it'll eval asynchronously.

00:29:45.849 --> 00:29:49.121
There's a question of how to get the value out of

00:29:49.171 --> 00:29:52.124
the asynchronous slime evaluation.

00:29:52.524 --> 00:29:55.761
And so an obvious way is to yank it.

00:29:59.661 --> 00:30:02.234
I'm looking forward to learning from kickingvegas.

00:30:02.284 --> 00:30:06.638
He finally makes it stick in my brain how to...

00:30:07.138 --> 00:30:10.559
Options other than just starting to write a command

00:30:10.959 --> 00:30:14.013
in the minibuffer and then mashing Tab

00:30:14.063 --> 00:30:16.465
and looking at what the likely sounding results are.

00:30:16.765 --> 00:30:21.720
That's what I will be learning this conference, if anything.

00:30:22.070 --> 00:30:26.558
slime-eval-save and then, what was happening over here?

00:30:26.958 --> 00:30:31.769
(accepting-values (t :own-window t) (accept 'expression)).

00:30:33.369 --> 00:30:38.319
Kind of confusingly, slime-eval-save takes a string,

00:30:39.169 --> 00:30:41.840
but it works really well, I'd argue.

00:30:41.940 --> 00:30:43.475
I think it's about to work really well.

00:30:45.825 --> 00:30:46.712
Ok, this is great.

00:30:46.762 --> 00:30:50.182
So you can see I've used... Oh, please enter an expression.

00:30:50.882 --> 00:30:52.117
So we're doing an expression.

00:30:52.167 --> 00:30:59.057
And so let's write like (3 4/2 5/6).

00:30:59.357 --> 00:31:00.609
That's an expression, right?

00:31:03.609 --> 00:31:05.797
And now I've yanked it.

00:31:05.847 --> 00:31:07.379
I should have really been in *scratch*,

00:31:07.429 --> 00:31:11.770
because I just want to dump. Sorry, *scratch*.

00:31:13.770 --> 00:31:15.290
Dump whatever that did.

00:31:16.540 --> 00:31:19.480
Oh, yeah, and see, it kind of simplified that

00:31:19.530 --> 00:31:20.712
while it was reading it.

00:31:20.762 --> 00:31:27.486
So running in Elisp, (slime-eval-save "(accepting-values

00:31:27.536 --> 00:31:32.557
(t :own-window t), accept 'expression))").

00:31:33.157 --> 00:31:36.328
And I got the three returns all the way

00:31:36.378 --> 00:31:43.235
from McCLIM to inferior-lisp to Elisp.

00:31:43.885 --> 00:31:46.471
3, 2, 5/6.

00:31:46.521 --> 00:31:50.575
Second return, it was a presentation type of expression,

00:31:50.625 --> 00:31:52.811
returned successfully, key.

00:31:53.561 --> 00:31:56.679
Yeah, so that's pretty cool. How out of time are we?

00:31:58.530 --> 00:32:00.859
Oh, we did this in basically half an hour.

00:32:04.009 --> 00:32:07.209
Maybe we could stop and assume there will be a bit under

00:32:07.259 --> 00:32:10.796
half an hour of interactive discussion.

00:32:11.646 --> 00:32:15.634
And when I also watch this and also receive suggestions,

00:32:16.934 --> 00:32:20.071
there will be additions and changes to make, I think.

00:32:21.671 --> 00:32:32.617
But can we quickly defun accept-date?

00:32:34.667 --> 00:32:36.589
Let's not take any arguments.

00:32:40.239 --> 00:32:41.709
Let's do this.

00:32:48.409 --> 00:32:49.769
accept-date.

00:32:55.519 --> 00:32:58.099
Saturday, December 7th.

00:33:02.649 --> 00:33:04.015
Oh, it doesn't return it.

00:33:04.215 --> 00:33:05.518
But it gets pretty close to returning it.

00:33:05.568 --> 00:33:06.718
I guess it yanks it.

00:33:07.818 --> 00:33:18.359
I would have to call … I'm going to say it's slime-sync,

00:33:21.160 --> 00:33:25.370
at which point it will resolve the slime-eval-async.

00:33:25.670 --> 00:33:28.757
And then I could get the first value out of

00:33:28.807 --> 00:33:32.179
my kill-ring pop, right?

00:33:33.629 --> 00:33:35.046
Does kill ring pop what I want?

00:33:36.646 --> 00:33:39.918
You know, you tell me in the interactive feedback,

00:33:39.968 --> 00:33:41.720
which should be happening in LambdaMOO.

00:33:43.020 --> 00:33:45.559
Well, I'll record another draft of this later

00:33:45.609 --> 00:33:47.709
after getting some feedback.

00:33:48.609 --> 00:33:51.580
Or worse to worse, this is just what you'll hear.

00:33:52.180 --> 00:33:58.503
Hopefully we have some questions and constructive comments.

00:33:59.303 --> 00:34:00.255
All right, see everybody later.

00:34:00.305 --> 00:34:01.359
Thank you so much for being here.

00:34:04.470 --> 00:34:08.613
Please do drop in to my live show

00:34:08.663 --> 00:34:11.266
if you're so inclined on Wednesdays

00:34:11.316 --> 00:34:14.186
where you're not busy with cool Emacs conferences.

00:34:14.936 --> 00:34:16.169
The list be go for climate.

00:34:16.219 --> 00:34:17.572
Thank you to everyone who helped.

00:34:17.772 --> 00:34:18.640
Thank you to Sacha

00:34:18.690 --> 00:34:21.660
for really getting me into this conference

00:34:21.710 --> 00:34:23.428
and kind of getting me going and

00:34:23.678 --> 00:34:26.181
submitting this prerecorded talk.

00:34:27.981 --> 00:34:28.780
See everybody later.