jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
lucasta has joined #commonlisp
yuna has quit [Remote host closed the connection]
yuna has joined #commonlisp
neon has joined #commonlisp
occ has joined #commonlisp
roygbyte has quit [Ping timeout: 250 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
occ has quit [Read error: Connection reset by peer]
karlosz has quit [Quit: karlosz]
occ has joined #commonlisp
rdrg109_ has quit [Read error: Connection reset by peer]
azimut has quit [Ping timeout: 255 seconds]
azimut has joined #commonlisp
karlosz has joined #commonlisp
karlosz has quit [Ping timeout: 265 seconds]
random-nick has quit [Ping timeout: 268 seconds]
Oladon has quit [Quit: Leaving.]
dipper has joined #commonlisp
yuna has quit [Remote host closed the connection]
yuna has joined #commonlisp
neon has quit [Ping timeout: 250 seconds]
neon has joined #commonlisp
Inline has quit [Remote host closed the connection]
neon has quit [Remote host closed the connection]
jeosol has joined #commonlisp
Devon has quit [Remote host closed the connection]
slyrus has joined #commonlisp
epony has quit [Ping timeout: 268 seconds]
rgherdt has joined #commonlisp
lucasta has quit [Remote host closed the connection]
<beach> jmercouris: It's a reference to works by Frank Zappa.
<beach> Or rather, many of the names chosen by Edi are references to works by Frank Zappa.
slyrus has quit [Remote host closed the connection]
slyrus has joined #commonlisp
<jmercouris> beach: indeed, i just find them dumb
triffid has quit [Remote host closed the connection]
bilegeek has joined #commonlisp
occ has quit [Ping timeout: 276 seconds]
epony has joined #commonlisp
bilegeek has quit [Client Quit]
slyrus has quit [Remote host closed the connection]
slyrus has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
slyrus has quit [Ping timeout: 255 seconds]
occ has joined #commonlisp
hayley has joined #commonlisp
slyrus has joined #commonlisp
<hayley> Don't worry, Chunga will have his revenge.
hayley has left #commonlisp [#commonlisp]
slyrus has quit [Remote host closed the connection]
slyrus has joined #commonlisp
slyrus has quit [Ping timeout: 248 seconds]
slyrus has joined #commonlisp
johnjaye has quit [Ping timeout: 268 seconds]
Noisytoot has quit [Ping timeout: 246 seconds]
johnjaye has joined #commonlisp
Noisytoot has joined #commonlisp
johnjaye has quit [Ping timeout: 268 seconds]
johnjaye has joined #commonlisp
Noisytoot has quit [Ping timeout: 248 seconds]
Noisytoot has joined #commonlisp
johnjaye has quit [Ping timeout: 276 seconds]
johnjaye has joined #commonlisp
dcb has quit [Quit: MSN Messenger 3.8]
slyrus has quit [Remote host closed the connection]
slyrus has joined #commonlisp
Noisytoot has quit [Quit: ZNC 1.8.2 - https://znc.in]
Noisytoot has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Hibernating too long]
Perflosopher has quit [Quit: Ping timeout (120 seconds)]
Perflosopher has joined #commonlisp
Noisytoot has quit [Quit: ZNC 1.8.2 - https://znc.in]
pjb has joined #commonlisp
Noisytoot has joined #commonlisp
Noisytoot has quit [Quit: ZNC 1.8.2 - https://znc.in]
Noisytoot has joined #commonlisp
pranavats has joined #commonlisp
<jackdaniel> all software should be named {country-of-residence}.{affiliation}.software{counter}, versioning shalt be semantic - i.e us.google.software233 (that would be android), eu.google.software244 (fuchsia)
<jackdaniel> good morning ;)
occ has quit [Ping timeout: 265 seconds]
waleee has quit [Ping timeout: 248 seconds]
occ has joined #commonlisp
Noisytoot has quit [Ping timeout: 250 seconds]
<aeth> all software should be named aeth
<jackdaniel> you need to check with others whether this name does not irritate them
Noisytoot has joined #commonlisp
shka has joined #commonlisp
pjb is now known as Guest7573
pjb has joined #commonlisp
azimut has quit [Ping timeout: 255 seconds]
Cymew has joined #commonlisp
kenran has joined #commonlisp
pjb has quit [Read error: Connection reset by peer]
LW has joined #commonlisp
ahc has joined #commonlisp
MajorBiscuit has joined #commonlisp
occ has quit [Ping timeout: 255 seconds]
occ has joined #commonlisp
jeffrey has joined #commonlisp
epony has quit [Remote host closed the connection]
epony has joined #commonlisp
<splittist> let-plus? cl-yacc?
<jackdaniel> should be aeth.opus.1 and aeth.opus.2
scymtym has joined #commonlisp
jeosol has quit [Quit: Client closed]
Noisytoot has quit [Quit: ZNC 1.8.2 - https://znc.in]
Noisytoot has joined #commonlisp
Noisytoot has quit [Ping timeout: 250 seconds]
Noisytoot has joined #commonlisp
occ has quit [Ping timeout: 246 seconds]
Noisytoot has quit [Quit: ZNC 1.8.2 - https://znc.in]
Noisytoot has joined #commonlisp
jeffrey has quit [Ping timeout: 240 seconds]
nij- has joined #commonlisp
<nij-> Hello :) I defined *members* and *admins* to be (list) to start with, and write a function (defun make (type name) ..) which push the newly created object to either *admins* or *members* (depending on the type 'member or 'admin).
<nij-> The problem is.. when I use (let ((list (case type ('member *members*) ..)))) it doesn't work as expected. This is because *members* points to THE empty list NIL, and pushing things into NIL doesn't really change the value of *members*.
<beach> Will the first argument to MAKE every be form other than a quoted symbol?
<nij-> What should I do to create a unique NIL that can be mutated?
<nij-> it's always a symbol, yes.
<beach> Then it is silly to dispatch on it, and better to have a MAKE-MEMBER and MAKE-ADMIN.
<nij-> I actually have member, admin, sub-member, teacher, coach.. etc.
<nij-> It would be verbose to write a make function for all of them.
<beach> The solution to this problem is to use a "sentinel".
<nij-> There is no way to create a mutatable empty list?
<beach> That's correct, you can not alter NIL.
<nij-> So I need a real empty list..
<beach> Lists in Common Lisp are not abstract data types, so you must wrap your concrete list in an abstract data type that can be mutated.
<nij-> I can use eval instead.. not very good style but it works.
<beach> That's a very bad idea.
<beach> You should create an abstract data type instead.
<nij-> hmm.. but then it's hard to loop over the list later on
<beach> Common Lisp lists should almost never be used as a substitute for a data structure in an application.
<beach> If you loop over the list later on, your concrete data type has leaked all over your code, which is bad.
<beach> You can create an iterator or a mapping function.
<nij-> geez
<nij-> How about make MAKE a macro?
<beach> Your concrete data type would still leak all over the place. But if that's what you want, go ahead.
<beach> nij-: Look, this is advice number 1 in all the literature about data representation. First define a protocol containing creators and accessors for you data. Then centralize in one place the translation between protocol operations and the concrete representation.
* beach is off for a lunch break.
<nij-> Thanks. My takeaway is "Common Lisp lists should almost never be used as a substitute for a data structure in an application."
<nij-> Do you mean to suggest that I create my own class that models a collection, and writes an iterator function for it?
<paulapatience> Yes, I believe that is what beach is suggesting. Your class can store the collection as a list or array or whatever you like, thus allowing you to change the representation at a later time without affecting the public API.
xaltsc has quit [Ping timeout: 265 seconds]
Noisytoot has quit [Ping timeout: 260 seconds]
<nij-> Such data type must have existed in some library right? Or should I just create it by myself?
Noisytoot has joined #commonlisp
<beach> The official name for such a data structure is a dictionary. It supports the operations INSERT, DELETE, MEMBER. I am sure there are libraries around for that, but if your collections are small, then it is trivial to create it yourself.
<beach> (defclass dictionary () ((%contents :initform '() :accessor contents)))
<beach> (defmethod member (thing (dictionary dictionary)) (cl:member thing (contents dictionary)))
<beach> (defmethod insert (thing (dictionary dictionary)) (push thing (contents dictionary)))
<jackdaniel> a level of indirection may solve all problems (except of the problem of too many levels of indirection)
<beach> (defmethod delete (thing (dictionary dictionary)) (setf (contents dictionary) (delete thing (contents dictionary))))
<beach> Something like that.
<nij-> Hmm sounds like a hashtable.
<beach> nij-: No, a hash table is another concrete data type.
occ has joined #commonlisp
<beach> So a hash table can be used to implement a dictionary abstract data type. Or a list can be used to implement it. Or a vector.
Cymew has quit [Ping timeout: 255 seconds]
son0p has quit [Ping timeout: 240 seconds]
<beach> I recommend: Aho, Hopcroft, Ullman: The design and analysis of computer algorithms.
<beach> Perhaps this stuff is no longer taught in computing class.
jeffrey has joined #commonlisp
karlosz has joined #commonlisp
random-nick has joined #commonlisp
ahc has quit [Quit: Client closed]
Noisytoot has quit [Ping timeout: 246 seconds]
jmdaemon has quit [Ping timeout: 252 seconds]
Noisytoot has joined #commonlisp
Noisytoot has quit [Remote host closed the connection]
Noisytoot has joined #commonlisp
cage has joined #commonlisp
pve has joined #commonlisp
LW has quit [Quit: WeeChat 3.6]
kevingal has joined #commonlisp
kevingal_ has joined #commonlisp
tyson2 has joined #commonlisp
dipper_ has joined #commonlisp
dipper has quit [Ping timeout: 260 seconds]
nij- has quit [Ping timeout: 276 seconds]
random-jellyfish has joined #commonlisp
random-jellyfish has quit [Client Quit]
Noisytoot has quit [Ping timeout: 252 seconds]
<edwlan[m]> Python confuses things here because it uses “dictionary” to name a concrete data type.
<beach> Why am I not surprised.
<beach> ?
lucasta has joined #commonlisp
Noisytoot has joined #commonlisp
Volt_ has joined #commonlisp
edgar-rft has quit [Quit: Leaving]
maximaximal has joined #commonlisp
dcb has joined #commonlisp
Volt_ has quit [Quit: ]
<bjorkintosh> beach, is that book still relevant?!
grawlinson has quit [Quit: SIGTERM]
grawlinson has joined #commonlisp
<NotThatRPG> Corman, Leiserson and Rivest is more up to date, AHU better on the analysis, and other formal accesses (IMO)
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
<beach> bjorkintosh: Yes, I think it is.
<bjorkintosh> oh fun!
<beach> bjorkintosh: Some things have to be compensated for because they assumed some very primitive language features.
<bjorkintosh> was it written in Pascal or C?
<bjorkintosh> (i don't have a copy at hand)
<beach> Neither.
<beach> They use their own syntax.
<NotThatRPG> CLR a better cookbook for algorithms, but AHU still worth reading. Their discussion on graphs and dynamic programming are both quite good, IIRC
<NotThatRPG> Pseudo-Algol, I would say
<beach> Something like that, yes.
<bjorkintosh> I wonder why books on Algorithms and datastructures at the time (and even now) tended to use algol-like languages instead of lisp.
<bjorkintosh> I don't think I've come across anything like that which uses lisp.
jmdaemon has joined #commonlisp
<beach> There is still massive resistance to learning Lisp. As I often say, people go to a lot of trouble to avoid learning Lisp.
morganw has joined #commonlisp
<beach> So an author who wants sales to be reasonable had better use something else.
<bjorkintosh> oh right. computing is a pop culture.
<NotThatRPG> Also typically one sees algorithms books written from an explicitly procedural frame
<mariari> bjorkintosh: purely functional data strcutures uses SML, with Haskell in the appendex for describing algorithms
<mariari> the book probably use lisp for laziness, as in the later half they had to make up laziness syntax for SML
azimut has joined #commonlisp
maximaximal has quit [Remote host closed the connection]
<bjorkintosh> mariari, you're right.
<bjorkintosh> there are only 3 such written so far.
<bjorkintosh> Were. not Are. I was wrong. it seems a whole lot more have been written in recent times, focusing on FP
<mariari> from purely functional data structures spawned some good papers, and advancement in data structures, it's a fairly solid book
<ixelp> Abstract Data Types in Standard ML by Harrison Rachel, John Wiley & Sons, 1993212 pp, ISBN 0-471-93844-0. | Journal of F [...]
tyson2 has quit [Remote host closed the connection]
phantomics has quit [Ping timeout: 276 seconds]
kenran has quit [Remote host closed the connection]
<edwlan[m]> There’s a recent book called something like “algorithms in lisp”, but I don’t know how good
<edwlan[m]> It is.
<ixelp> "Programming Algorithms" Book
phantomics has joined #commonlisp
<mariari> bjorkintosh: is it covering abstract data types or data structures along with algorithms, as those topics are quite a bit different
nij- has joined #commonlisp
<bjorkintosh> ADTs. the previous edition of that book used Modula-2. I think this was written to demonstrate how the same subject would be treated in a functional programming language.
<bjorkintosh> it's a 30 year old book. thoughts about SML were rather optimistic then.
tyson2 has joined #commonlisp
LW has joined #commonlisp
LW has quit [Client Quit]
LW has joined #commonlisp
LW has quit [Client Quit]
<mariari> SML was interesting, I'm sad about OCaml being the bigger language these days
<mariari> as it's inherently a batch oriented language, unlike SML, which had some image based compilers
<mariari> Out of the ML's I have some fondness for SML, even though I've mostly only written all the other MLs
<edwlan[m]> Is the code for any MLs in CL or previous lisps around?
<mariari> yes! sort of
<mariari> https://en.wikipedia.org/wiki/Poplog would you consider this?
<mariari> poplog implemented an environment for CL, SML, and Prolog all in pop11
<edwlan[m]> I forgot about that
dipper_ has quit [Ping timeout: 255 seconds]
<mariari> there is coalton as well if you count that, it's more of a haskell derivative in Lisp than proper ML
<mariari> ML has a massive issue with their type system not really being fully algebraic, so it makes tasks like compilers a really ballach in them
<_death> in Lisp we use list-like ADTs less than typical Algols, since cons-based lists are so ingrained and provide tough competition.. so in the original problem another solution would be to use a simple "boxed representation" (defstruct box list) that has a selector (box-list) to get at the list
<mariari> _death: we have anonymous or types which gets around the issues presented by ML
<_death> mariari: I'm not sure why that was directed at me?
<mariari> just as the `box' is the tag here instead of box-list
<_death> also in the original problem you could use the symbol as the "hook" for the list, like (set symbol ...)
<_death> the relevant Perlisism was "9. It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures."
<_death>
<_death>
kevingal has quit [Ping timeout: 252 seconds]
kevingal_ has quit [Ping timeout: 252 seconds]
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
<_death> the box can be thought as a degenerate ADT that has a constructor (make-box) and two operators to efficiently "convert" from/to cons-based lists
yuna has quit [Remote host closed the connection]
yuna has joined #commonlisp
<bjorkintosh> _death, sounds like Perlis's #9 foreshadowed unix pipes.
<bjorkintosh> text followed by as many pipes as you need.
<_death> right, that's a unix power tool (if you get what I mean :).. a similar one was "everything is a file" that related systems took even more seriously
edgar-rft has joined #commonlisp
<bjorkintosh> plan9.
<bjorkintosh> also inferno.
tyson2 has quit [Remote host closed the connection]
<johnjaye> is inferno still a thing.
Noisytoot has quit [Quit: ZNC 1.8.2 - https://znc.in]
<bjorkintosh> johnjaye, in as much as Multics is still a thing.
<bjorkintosh> or Oberon, for that matter. it's there to be played with.
Noisytoot has joined #commonlisp
<johnjaye> wikipedia gives me at least a dozen fictional characters named oberon before the os
<johnjaye> > TUI
Nezteb has joined #commonlisp
<johnjaye> sign me up, that sounds amazing
kevingal has joined #commonlisp
kevingal_ has joined #commonlisp
szkl has joined #commonlisp
tyson2 has joined #commonlisp
karlosz has quit [Quit: karlosz]
Guest7573 is now known as pjb
pjb has quit [Remote host closed the connection]
lucasta has quit [Remote host closed the connection]
pvb has quit [Ping timeout: 268 seconds]
tyson2 has quit [Remote host closed the connection]
kenran has joined #commonlisp
lucasta has joined #commonlisp
NicknameJohn has quit [Remote host closed the connection]
waleee has joined #commonlisp
NicknameJohn has joined #commonlisp
johnjaye has quit [Read error: Connection reset by peer]
lucasta has quit [Remote host closed the connection]
<aeth> jackdaniel: something like aeth.1 and aeth.2 is not too different from Scheme, where you have (srfi 1) and (srfi 2) and...
NotThatRPG has quit [Quit: Textual IRC Client: www.textualapp.com]
azimut has quit [Ping timeout: 255 seconds]
mrcom_ has joined #commonlisp
mrcom_ has quit [Remote host closed the connection]
azimut has joined #commonlisp
<jackdaniel> I'm all for it, but I'd replace a with j, e with a, t with c and h with k
tyson2 has joined #commonlisp
karlosz has joined #commonlisp
pjb has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
yuna has quit [Remote host closed the connection]
yuna has joined #commonlisp
kenran has quit [Remote host closed the connection]
yuna has quit [Remote host closed the connection]
yuna has joined #commonlisp
eddof13 has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 28.2]
karlosz has quit [Quit: karlosz]
yuna has left #commonlisp [WeeChat 3.8]
ahc has joined #commonlisp
eddof13 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
shka has quit [Ping timeout: 256 seconds]
lucasta has joined #commonlisp
karlosz has joined #commonlisp
morganw has quit [Remote host closed the connection]
rtoy has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 250 seconds]
karlosz has quit [Quit: karlosz]
kevingal_ has quit [Ping timeout: 246 seconds]
kevingal has quit [Ping timeout: 246 seconds]
occ has quit [Ping timeout: 252 seconds]
jeffrey has quit [Ping timeout: 240 seconds]
dipper_ has joined #commonlisp
rtoy has quit [Ping timeout: 265 seconds]
NicknameJohn has quit [Ping timeout: 260 seconds]
eddof13 has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 250 seconds]
Lord_of_Life has joined #commonlisp