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/>
jonatack has quit [Read error: Connection reset by peer]
jonatack has joined #commonlisp
pve has quit [Quit: leaving]
varjag has joined #commonlisp
varjag has quit [Ping timeout: 264 seconds]
donleo has quit [Ping timeout: 256 seconds]
varjag has joined #commonlisp
varjag has quit [Ping timeout: 264 seconds]
Devon has quit [Ping timeout: 264 seconds]
Pixel_Outlaw has joined #commonlisp
dra has quit [Ping timeout: 264 seconds]
Lord_of_Life has quit [Ping timeout: 264 seconds]
Lord_of_Life_ has joined #commonlisp
Lord_of_Life_ is now known as Lord_of_Life
Lycurgus has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
Devon has joined #commonlisp
triffid has quit [Ping timeout: 240 seconds]
triffid has joined #commonlisp
szkl has joined #commonlisp
pfdietz has quit [Quit: Client closed]
rtypo has quit [Quit: WeeChat 4.1.2]
josrr has quit [Remote host closed the connection]
random-nick has quit [Ping timeout: 268 seconds]
vyrsh has joined #commonlisp
tyson2 has joined #commonlisp
piglet_ has joined #commonlisp
vyrsh has quit [Ping timeout: 276 seconds]
pfdietz has joined #commonlisp
Lycurgus has quit [Quit: leaving]
piglet_ has quit [Quit: Konversation terminated!]
piglet_ has joined #commonlisp
piglet_ is now known as vyrsh
piglet has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
pfdietz has quit [Quit: Client closed]
pfdietz has joined #commonlisp
hayley has quit [Ping timeout: 256 seconds]
hayley has joined #commonlisp
piglet has quit [Remote host closed the connection]
piglet has joined #commonlisp
piglet has quit [Remote host closed the connection]
piglet has joined #commonlisp
Pixel_Outlaw has quit [Remote host closed the connection]
bjorkint0sh has joined #commonlisp
ronald_ has joined #commonlisp
bjorkintosh has quit [Ping timeout: 276 seconds]
johnjaye has quit [Ping timeout: 264 seconds]
ronald has quit [Ping timeout: 264 seconds]
ronald has joined #commonlisp
vyrsh has quit [Ping timeout: 246 seconds]
Pixel_Outlaw has joined #commonlisp
piglet has quit [Ping timeout: 256 seconds]
ronald_ has quit [Ping timeout: 256 seconds]
Lycurgus has joined #commonlisp
decweb has quit [Ping timeout: 252 seconds]
occ has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
Lycurgus has quit [Quit: leaving]
wacki has joined #commonlisp
<Pixel_Outlaw> Some fun working on the "Little Man Computer" https://github.com/RyanBurnside/lmc/blob/main/lmc.lisp
<Pixel_Outlaw> Still need to test the jumps and such though.
<Pixel_Outlaw> Maybe put up a LTK GUI
amb007 has joined #commonlisp
<beach> Why not CLIM?
<Pixel_Outlaw> I've not used CLIM, I browsed the docs a bit and it seems like it'd take a lot more work to get LTK's level of widgets.
<Pixel_Outlaw> Nothing against CLIM I'm just ignorant of it. :)
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
zetef has joined #commonlisp
zetef has quit [Remote host closed the connection]
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
igemnace has joined #commonlisp
Devon has quit [Ping timeout: 256 seconds]
<beach> With CLIM, it is extremely easy to whip up a GUI, but it might not (currently) be as native looking as if you go FFI.
<beach> Plus, with CLIM, you avoid all the hassle trying to debug an application that uses a (very) different language in addition to Common Lisp.
<beach> But you are right, it takes a while to learn.
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
wacki has joined #commonlisp
_cymew_ has joined #commonlisp
ym has quit [Ping timeout: 276 seconds]
donleo has joined #commonlisp
Pixel_Outlaw has quit [Quit: Leaving]
AndreiDuma has joined #commonlisp
mgl_ has joined #commonlisp
prokhor has quit [Remote host closed the connection]
prokhor has joined #commonlisp
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
azimut has quit [Ping timeout: 240 seconds]
<splittist> My beginner's impression of CLIM is that it is great for growing a GUI as you explore your application's solution-space. But if you already have in mind a 'normal' widgets-and-gadgets/MVC etc style GUI that you want to bring to life, (current) CLIM will not make it easy.
dnhester26 has quit [Read error: Connection reset by peer]
shka has joined #commonlisp
waleee has joined #commonlisp
dnhester26 has joined #commonlisp
amb007 has quit [Ping timeout: 255 seconds]
dino_tutter has joined #commonlisp
danse-nr3 has joined #commonlisp
luis1903 has joined #commonlisp
luis190 has quit [Ping timeout: 252 seconds]
luis1903 is now known as luis190
varjag has joined #commonlisp
traidare has joined #commonlisp
treflip has joined #commonlisp
luis190 has quit [Ping timeout: 260 seconds]
luis1903 has joined #commonlisp
dcb has quit [Quit: Connection closed for inactivity]
drakonis has quit [Ping timeout: 268 seconds]
drakonis has joined #commonlisp
bendersteed has joined #commonlisp
khrbtxyz has quit [Ping timeout: 264 seconds]
drakonis has quit [Ping timeout: 260 seconds]
khrbtxyz has joined #commonlisp
pfdietz has quit [Quit: Client closed]
drakonis has joined #commonlisp
zetef has joined #commonlisp
Nilby has joined #commonlisp
herjazz has joined #commonlisp
Equill has quit [Quit: Gone offline]
Gleefre has joined #commonlisp
Equill has joined #commonlisp
AndreiDuma has joined #commonlisp
attila_lendvai has joined #commonlisp
drakonis has quit [Ping timeout: 246 seconds]
danse-nr3 has quit [Read error: Connection reset by peer]
danse-nr3 has joined #commonlisp
drakonis has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
zetef has quit [Remote host closed the connection]
zetef has joined #commonlisp
jmdaemon has quit [Ping timeout: 256 seconds]
dnhester26 has joined #commonlisp
anticomputer has quit [Ping timeout: 240 seconds]
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dcb has joined #commonlisp
zetef has quit [Remote host closed the connection]
drakonis has quit [Ping timeout: 260 seconds]
danse-nr3 has quit [Ping timeout: 260 seconds]
attila_lendvai has quit [Ping timeout: 260 seconds]
drakonis has joined #commonlisp
attila_lendvai has joined #commonlisp
random-nick has joined #commonlisp
AndreiDuma has joined #commonlisp
decweb has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
_cymew_ has quit [Ping timeout: 240 seconds]
_cymew_ has joined #commonlisp
_cymew_ has quit [Ping timeout: 255 seconds]
yitzi has joined #commonlisp
thuna` has quit [Ping timeout: 268 seconds]
<dnhester26> I am thinking of making a role based access control package, and since the concept uses inheritance, I thought: why not just use CLOS instead of making something new? the idea is to: - just create a class for each role - some classes can have inheritance - just assign role classes to the user
<dnhester26> The question is should I model each user in the system as an instance that I dynamically assign the classes for which it has roles in? Or should each user be corresponding to a new class which inherits from each of the role classes? The goal is to check (is-obj-instance-of-class user-obj role-class). The user is loaded from a DB row... Is this a good way to model ths? Or just resort to making my own logic for dealing with inheritan
<dnhester26> ce and not use the CLOS?
<dnhester26> inheritance* (the word was cut because of the message character limit)
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 268 seconds]
danse-nr3 has joined #commonlisp
thuna` has joined #commonlisp
Inline has quit [Ping timeout: 256 seconds]
szkl has quit [Quit: Connection closed for inactivity]
<dnhester26> I guess this is a CL design question not a syntax question
cage has joined #commonlisp
attila_lendvai_ has quit [Remote host closed the connection]
attila_lendvai_ has joined #commonlisp
green_ has quit [Ping timeout: 264 seconds]
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Inline has joined #commonlisp
Guest68 has joined #commonlisp
cage has quit [Remote host closed the connection]
Guest68 is now known as chenggong7788
josrr has joined #commonlisp
dcb has quit [Quit: Connection closed for inactivity]
AndreiDuma has joined #commonlisp
herjazz has quit [Quit: leaving]
<beach> dnhester26: I would give you some advice, but I know nothing of the domain, so I have none to give.
<phoe> stealth-mixin could possibly be of use here if you want to use the class DAG to model this behavior
<phoe> I have no idea if this is the best idea though
chenggong7788 is now known as nil78
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
<dnhester26> phoe: thanks for the recommendation, I'll look into it
nil78 has quit [Quit: Client closed]
<dnhester26> beach: thanks, the domain knowledge is very simple: usually you have roles represented by strings ("guest" "buyer" "seller" "admin" "") and some rules like a buyer can do anything that a guest can do: ("buyer" "guest"), and an admin can do anything that a buyer or seller can do ("admin" "buyer" "seller"). Finally, a user database which has a column with a list of the roles assigned to that user say (:name "robert" :roles ("buyer"))
<dnhester26> . That is the whole system, then some functions in the program will only be accessible if the user has a certain role. I picked buyer and seller here to show roles that do not inherit from each other. The code can just check if say john is an admin, can he access a buyer function. The system has to check johns role, then compare his role to the permission for the function which is buyer, and then realize that the admin role inherit
<dnhester26> s the buyer role, so therefore he has access even though he only has the "admin" role in his roles list
<dnhester26> So this is really a modeling in common lisp question
<dnhester26> I think most libraries in other languages do some sort of search comparing each string and then using each string to find its inherited roles and again compare or find more inherited roles
<dnhester26> It's basically a classic search problem with depth first or breath first search
<dnhester26> It's just that it matches exactly how classes work, specially with multiple inheritance
pfdietz has joined #commonlisp
<dnhester26> So this could basically be a shortcut to avoid writing a lot of code since all that logic is already programmed into the CLOS
<dnhester26> hahaha phoe: I just realized that library was written by beach himself
jonatack has quit [Ping timeout: 264 seconds]
green_ has joined #commonlisp
<phoe> dnhester26: that's a part of the humor in this situation, yes
<beach> gilberth came up with the idea of stealth mixins (but not the name I think), and we published a joint paper about them at the Australian Software Engineering conference. Quite some time ago.
<phoe> one issue is how to represent "users" in that situation
<beach> Yeah, I don't see an easy way to do that and take advantage of CLOS generic dispatch.
<dnhester26> I think the point of that package is when we don't want the target (or victim class as they call it) to know of the mixin, but for my case it actually doesn't matter
<phoe> re-reading stealth mixins, this seems to require that each user should be represented by a singular class
<dnhester26> Why is line 15 a macro and not simply a function? https://github.com/robert-strandh/Stealth-mixin/blob/master/stealth-mixin.lisp#L15
<phoe> so that you can add a mixin only to the user in question
<beach> phoe: That was my analysis too. And that class would then inherit from all the roles the user can have.
<phoe> dnhester26: I assume it could be, you'd just need to write a SETF for it too
<phoe> but, yes, what beach said
<beach> dnhester26: I don't see a reason why it is a macro.
<dnhester26> thanks, yeah exactly, that's what I wrote in the original question
<dnhester26> "The question is should I model each user in the system as an instance that I dynamically assign the classes for which it has roles in? Or should each user be corresponding to a new class which inherits from each of the role classes? The goal is to check (is-obj-instance-of-class user-obj role-class). The user is loaded from a DB row..."
<phoe> I wonder if using superclasses isn't overkill; you could (defclass user () (roles ...) ...) and have ROLES contain a list of strings/keywords
<dnhester26> beach: ok thanks, I thought I was missing something, could that be what phoe meant with the setf? but gethash seems to not need anything
<phoe> and then model your RBAC around (MEMBER ROLE (USER-ROLES ...)) or something
<dnhester26> phoe yeah, I think that's how most other languages model it since there's no dynamic class definitions
<phoe> dnhester26: (setf (gethash ...) ...) is handled by the macro case; it's just a dirty shortcut to avoid writing DEFUN FOO and DEFUN (SETF FOO)
<phoe> dnhester26: classes are usually responsible for groups of objects though, unless you want a big collection of singletons
<phoe> at which point you've just pushed the instance-class hierarchy one element up the chain into the class-metaclass hierarchy
igemnace has quit [Read error: Connection reset by peer]
<dnhester26> right, the whole reason to model it that way was this: "(is-obj-instance-of-class user-obj role-class)"
<dnhester26> for the inheritance of roles, like an admin can do anything the guest can do, even though the admin role inherits only from buyer and seller, buyer inherits from guest
<dnhester26> and I thought they could be short lived classes or objects, just when loading them from the DB, assign the classes to the newly created object/class, do whatever checking I need, and then it should be garbage collected
<dnhester26> Probably as an object that I assign it a class dynamically will be easier for the garbage collection
<dnhester26> and then when the function returns I expect the object will be garbage collected
<dnhester26> It just makes it easier to check the inheritance
<dnhester26> I think after thinking about it because of the garbage collection that using objects and assigning to them classes is better than defining a new class per user
<dnhester26> ok, thanks!
<dnhester26> it will also make it easier to associate it with the user data since it will be the same object in CL
<dnhester26> so I think design wise that's the best
<dnhester26> is adding classes dynamically to an object something I need closer-mop for or just regular CL?
<beach> An object is always an instance of one particular class.
<beach> So you would have to redefine the class that the object is an instance of and add more superclasses.
<beach> You can do that with REINITIALIZE-INSTANCE on the class metaobject.
<beach> But again, you would then have one class for each user, and that class would have a single instance.
<beach> Not that that solution is problematic. A class is not a very complicated object.
robin has quit [Remote host closed the connection]
<dnhester26> I think this exactly solves the issue but I don't know how mixins work: https://40ants.com/lisp-project-of-the-day/2020/10/0199-dynamic-mixins.html
<ixelp> dynamic-mixins
robin_ has joined #commonlisp
<dnhester26> Just from the example it makes sense
<phoe> yes, because this works on instance level
<phoe> stealth-mixin accepts a mixin and a class; this accepts a mixin and an instance
* phoe takes notes
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_cymew_ has joined #commonlisp
<dnhester26> thanks
AndreiDuma has joined #commonlisp
igemnace has joined #commonlisp
<dnhester26> I am going through the code though and don't really see where "ensure-mix" from the example is defined, here's the source code: https://github.com/hraban/dynamic-classes/blob/master/dev/define-class.lisp
amb007 has joined #commonlisp
icebarf has quit [Remote host closed the connection]
<dnhester26> my question is will these mixed classes be deleted after the function returns and I don't have to worry about my system memory bloating up?
robin_ has quit [Remote host closed the connection]
robin_ has joined #commonlisp
tyson2 has joined #commonlisp
icebarf has joined #commonlisp
<dnhester26> ohhh no! I made a mistake! found the wrong github code hahahaha it was dynamic-mixins not dynamic-classes, my bad
epony has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 260 seconds]
epony has joined #commonlisp
triffid has quit [Ping timeout: 240 seconds]
reb` has joined #commonlisp
ym has joined #commonlisp
varjag has quit [Quit: ERC (IRC client for Emacs 27.1)]
yewscion has joined #commonlisp
reb` has quit [Ping timeout: 260 seconds]
kevingal has joined #commonlisp
dcb has joined #commonlisp
occ has quit [Ping timeout: 276 seconds]
kevingal has quit [Ping timeout: 240 seconds]
kevingal has joined #commonlisp
kevingal_ has joined #commonlisp
yewscion has quit [Remote host closed the connection]
yewscion has joined #commonlisp
zetef has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
<phoe> minion: memo for dnhester26: no, classes won't get cleaned up afterwards; you will need to explicitly remove them from the system
<minion> Remembered. I'll tell dnhester26 when he/she/it next speaks.
* thuna` .oO("they" isn't that complicated)
waleee has quit [Ping timeout: 268 seconds]
<bjorkint0sh> it's a bot. it/he/she/they/those knows little.
yitzi has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
attila_lendvai_ has quit [Remote host closed the connection]
attila_lendvai_ has joined #commonlisp
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
donleo has quit [Quit: Leaving]
yewscion has quit [Ping timeout: 264 seconds]
yewscion has joined #commonlisp
attila_lendvai_ has quit [Ping timeout: 264 seconds]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
bendersteed has quit [Quit: bendersteed]
dnhester26 has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
muswawir has joined #commonlisp
epony has quit [Ping timeout: 264 seconds]
mgl_ has quit [Ping timeout: 256 seconds]
donleo has joined #commonlisp
decweb has quit [Ping timeout: 268 seconds]
dnhester26 has joined #commonlisp
igemnace has quit [Quit: WeeChat 4.2.1]
cage has joined #commonlisp
attila_lendvai has joined #commonlisp
zetef has quit [Ping timeout: 256 seconds]
danse-nr3 has quit [Ping timeout: 260 seconds]
attila_lendvai has quit [Ping timeout: 264 seconds]
epony has joined #commonlisp
decweb has joined #commonlisp
amb007 has quit [Ping timeout: 264 seconds]
danse-nr3 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
wacki has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
wacki has joined #commonlisp
mzan has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
mzan has joined #commonlisp
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnhester26 has quit [Remote host closed the connection]
attila_lendvai has joined #commonlisp
scymtym has quit [Read error: Connection reset by peer]
scymtym has joined #commonlisp
zxcvz has joined #commonlisp
yitzi has joined #commonlisp
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
mgl_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 256 seconds]
Pixel_Outlaw has joined #commonlisp
jmdaemon has joined #commonlisp
attila_lendvai has joined #commonlisp
<Shinmera> minion: are you a bot?
<minion> i'm not a bot. i prefer the term ``electronically composed''.
dnhester26 has joined #commonlisp
danse-nr3 has quit [Ping timeout: 246 seconds]
muswawir has quit [Quit: Quit]
jonatack has joined #commonlisp
pfdietz has quit [Quit: Client closed]
wacki has joined #commonlisp
luis1903 has quit [Ping timeout: 264 seconds]
mgl_ has quit [Ping timeout: 276 seconds]
<BrokenCog> can slime connected to a remote lisp session? or does it need to be local?
<BrokenCog> *be connected
yitzi has quit [Ping timeout: 256 seconds]
yitzi has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
pfdietz has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
mgl_ has joined #commonlisp
bubblegum has joined #commonlisp
mgl_ has quit [Ping timeout: 264 seconds]
yewscion has quit [Ping timeout: 268 seconds]
dnhester26 has quit [Remote host closed the connection]
bubblegum has quit [Ping timeout: 260 seconds]
Gleefre has joined #commonlisp
varjag has joined #commonlisp
chiselfuse has quit [Remote host closed the connection]
ec has quit [Remote host closed the connection]
gxt has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 276 seconds]
tyson2 has quit [Remote host closed the connection]
Gleefre has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
azimut has joined #commonlisp
Gleefre has joined #commonlisp
mgl_ has joined #commonlisp
pfdietz has quit [Quit: Client closed]
Lycurgus has joined #commonlisp
dnhester26 has joined #commonlisp
ec has joined #commonlisp
<BrokenCog> sorry ... wrong channel. Thought I was in #emacs ... but, I figured it out ... turns out I can't connect remoetly, but can start the process and connect via ssh
gxt has joined #commonlisp
triffid has joined #commonlisp
jmdaemon has quit [Quit: ZNC 1.8.2 - https://znc.in]
<jfh> BrokenCog: you can use swank:create-server in the remote box, then in the local box connect to it using Mx slime-connect
<jfh> assuming ports are open, etc
jfh is now known as kagevf
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<BrokenCog> jfh: by default create-server only listens on localhost, I suspect it can be told to listen globally, but, I haven't figured out any way to secure the port which doesn't seem healthy so I'll use ssh with a tunnel for Emacs.
Lycurgus has left #commonlisp [#commonlisp]
waleee has joined #commonlisp
<kagevf> BrokenCog: I think you can use interface to specify an IP
dnhester26 has quit [Ping timeout: 264 seconds]
<BrokenCog> :interface to create-server?
<kagevf> for example, I've done (swank:create-server :interface "192.168.1.2" :dont-close t)
jmdaemon has joined #commonlisp
<BrokenCog> ah. okay.
dnhester26 has joined #commonlisp
<kagevf> assuming the .2 is my remote, then you would slime-connect to that
<BrokenCog> but that would accept all connections without validation, yes?
<BrokenCog> if it were in a LAN obviously I wouldn't mind ... but this is to a remote server.
<kagevf> yeah, there's not security that I'm aware of, it's up to your system settings
<kagevf> *no security*
<BrokenCog> right.
<kagevf> I've used that in combination with tramp ... it's pretty nice
<BrokenCog> how do you mean?
<kagevf> so tramp will ssh into your remote so you can access the files
<BrokenCog> oh ... having tramp start the ssh tunnel?
<kagevf> right
zxcvz has quit [Quit: zxcvz]
<kagevf> tramp to do your edits, swank + slime for the repl
<BrokenCog> right. that's what I'm using now.
<kagevf> nice :+1
<BrokenCog> but I needed to start an out-of-band ssh tunnel. I'll try to get putty to do it instead.
<BrokenCog> the problem is for some reason I can only use plink. ssh and putty won't connect.
<BrokenCog> i'm not sure if plnik will create tunnels.
<kagevf> is your local Windows?
<BrokenCog> yes.
<kagevf> ok, I've done that before ...
<kagevf> I remember it was kind of tricky ... I think I had trouble with the path??
dnhester26 has quit [Ping timeout: 256 seconds]
<BrokenCog> if you think of it PM me?? I have to go.
<kagevf> BrokenCog: yeah, I'll send you some DMs
<BrokenCog> thanks!
treflip has quit [Remote host closed the connection]
chiselfuse has joined #commonlisp
anticomputer has joined #commonlisp
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
varjag has quit [Ping timeout: 246 seconds]
dnhester26 has joined #commonlisp
yewscion has joined #commonlisp
jmdaemon has quit [Ping timeout: 268 seconds]
yvm has joined #commonlisp
ym has quit [Ping timeout: 264 seconds]
jonatack has quit [Ping timeout: 246 seconds]
mgl_ has quit [Ping timeout: 260 seconds]
varjag has joined #commonlisp
<paule32> hello
<paule32> how can i make a list of an input string, that the user typed in ?
varjag has quit [Ping timeout: 276 seconds]
yewscion has quit [Ping timeout: 256 seconds]
<yitzi> Like convert a string to a list?
yewscion has joined #commonlisp
rgherdt has quit [Quit: Leaving]
beach` has joined #commonlisp
traidare has quit [Ping timeout: 260 seconds]
beach has quit [Ping timeout: 240 seconds]
<paule32> yes
jladd- has joined #commonlisp
jmdaemon has joined #commonlisp
<yitzi> Try coerce
jladd has quit [Ping timeout: 260 seconds]
<paule32> okay, thx
NotThatRPG has joined #commonlisp
yitzi has quit [Remote host closed the connection]
<NotThatRPG> Anyone know how to use the `cl-docker-images` repos on common-lisp.net gitlab to generate new docker images? These repos seem to be intended for use with some toolchain, but I can't find any indication of what that toolchain is or how to use it.
yewscion has quit [Ping timeout: 246 seconds]
yewscion has joined #commonlisp
mariari has quit [Ping timeout: 264 seconds]
yitzi has joined #commonlisp
<yitzi> NotThatRPG: I submitted some updates to cl-docker-images and got no responses. They seem needlessly complex to me. Instead I just made this https://github.com/yitzchak/archlinux-cl
<ixelp> GitHub - yitzchak/archlinux-cl: Docker Arch Linux image with Common Lisp implementations
yewscion has quit [Remote host closed the connection]
yewscion has joined #commonlisp
<NotThatRPG> yitzi: Yes, I think the image repos were maintained by Eric Timmons, who is no longer able to do this, and AFAICT no one has taken this over. I sort of figured out how to make my own Allegro 11 Express image.
mariari has joined #commonlisp
shka has quit [Ping timeout: 264 seconds]
dra has joined #commonlisp
dra has quit [Changing host]
dra has joined #commonlisp
yitzi has quit [Remote host closed the connection]
triffid has quit [Quit: triffid]
yewscion has quit [Quit: Leaving]
attila_lendvai_ has quit [Ping timeout: 255 seconds]
foomar has joined #commonlisp
triffid has joined #commonlisp
foomar has quit [Remote host closed the connection]
cage has quit [Quit: rcirc on GNU Emacs 29.1]
mgl_ has joined #commonlisp
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
<younder> Hrmf.. remove-if-not is a double negative. It should be collect-if. I mean the function is non-destructive. It doesn't actually remove anything!
tyson2 has quit [Remote host closed the connection]
<Alfr> younder, the destructive ones are named delete instead of remove.
<Alfr> younder, that is only to say, that the use is consistent with that choice.
<Odin-LAP> younder: I believe that's why it's marked deprecated in the spec.
<NotThatRPG> younder: Peter Norvig recommended using `find-all-if` as an alias for `remove-if-not`...
<gilberth> Odin-LAP: I always believed it's deprecated because of COMPLEMENT.
Inline has quit [Quit: Leaving]
<NotThatRPG> Note that I could imagine a case where remove-if-not is really done for removing, but often saying `find-if` is better because it captures the programmer's intentions.
<NotThatRPG> s/find-if/find-all-if/
<younder> (defmacro alias (short long) `(setf (fdefinition (quote,short)) (fdefinition (quote ,long)))) (alias collect-if remove-if not) there!
<NotThatRPG> I don't *think* ALEXANDRIA has a FIND-ALL, does it?
<gilberth> I think KEEP-IF would have been a better name.
<NotThatRPG> (I did mean FIND-ALL, not FIND-ALL-IF)
<NotThatRPG> It's a nuisance to implement FIND-ALL using REMOVE-IF-NOT...
<younder> find is the first occurence. This returns all occurences
<gilberth> Which is not what I want.
<gilberth> I want a new sequence that is the original sequence with only those elements kept that satisfy the test.
<gilberth> Not a set of all elements that satisfy the test.
<NotThatRPG> gilberth: ? Not sure I follow -- you want a *new* sequence, so not DELETE-IF-NOT, but you don't want a set of all elements? What's the difference?
<NotThatRPG> Do you want to maintain the original ordering?
epony has quit [Remote host closed the connection]
<gilberth> Order.
<NotThatRPG> I need to check, but If I recall correctly, REMOVE is not stable
<gilberth> When I read "find all element that are odd", I think that you just want some list of all odd elements. A set.
<zyd> Serapeum has `defalias', in style of the elisp function. Pretty nice for renaming stuff.
<NotThatRPG> Actually gilberth I am wrong: "For all these functions, elements not removed or deleted occur in the same order in the result as they did in sequence."
<zyd> (defalias make-unbound #'makunbound)
<NotThatRPG> So you keep the order if you use REMOVE-IF or -IF-NOT
<gilberth> "For all these functions, elements not removed or deleted occur in the same order in the result as they did in sequence." <https://novaspec.org/cl/f_remove>
<ixelp> remove, remove-if, remove-if-not, delete, delete-if, delete-if-not | Common Lisp Nova Spec
<younder> Maintaining order is always a good thing. Most data is partially sorted and this helps efficiency.
<NotThatRPG> gilberth: So it sounds like these functions do exactly what you want.
<gilberth> NotThatRGP: I was just saying that if that FIND-ALL mentioned is REMOVE-IF-NOT, I don't like the name.
<younder> That's why sort algorithms with sorted data as a worst case are dreadful.
<gilberth> And that I would prefer a name like KEEP-IF. This is more precise than COLLECT-IF as well IMHO.
* Nilby imagines both ordered and chaotic versions in a Lisp with more intrinsic parallelism.
amb007 has quit [Remote host closed the connection]
amb007 has joined #commonlisp
a51 has quit [Quit: WeeChat 4.2.0]
dnhester26 has quit [Remote host closed the connection]
green_ has quit [Ping timeout: 264 seconds]
<gilberth> What I miss from CL two, is a function to partition a sequence. A special case would be to partition into two sequences, one satisfying the test and one that does not. Here a stable and unstable version would actually make sense.
<gilberth> As I catch myself saying things like (let ((the-foos (remove-if-not #'foop list)) (the-other (remove-if #'foop list))) ...).
<gilberth> That's going over the list twice. FOOP might be expensive.
<Mondenkind> (loop for x in list if (foop x) collect x into foos else collect x into not-foos finally ...)
<Mondenkind> ;)
<thuna`> (let (the-foos the-other) (dolist (maybe-foo list) (push maybe-foo (if (foop maybe-foo) the-foos the-other))) ...)
<gilberth> Mondenkind: I prefer using sequence functions.
<Mondenkind> I know you do!
<Mondenkind> hence the ;)
<thuna`> But yes, a partition function would be helpful
<Odin-LAP> Maybe even call it group-by? :p
<younder> My version of partition works for both lists and arrays
<gilberth> I have this toy partition function: <https://termbin.com/jmsg>
<gilberth> And I name it PARTITION. I prefer to name functions by nouns over naming by verbs, if possible.
<Odin-LAP> gilberth: You are aware that it makes no difference in this case, no?
* thuna` .oO(Isn't "to partition" also a verb?)
<gilberth> But spot that ASSOC there. A more clever implementation could use a hash-table if test allows for.
<gilberth> Odin-LAP: I read "group" in GROUP-BY as a verb.
<Odin-LAP> gilberth: I mean that 'partition' is also both.
<gilberth> thua`: It is, indeed. But it also is a mathematical term.
<gilberth> Odin-LAP: Right.
mgl_ has quit [Ping timeout: 264 seconds]
<Odin-LAP> Not to mention that using the standard functions must drive you up the wall.
<gilberth> Odin-LAP: CLIM names drive me up the wall.
<gilberth> Consider MAKE-TRANSLATION-TRANSFORMATION. First, it may not actually make a thing. Second, a translation is a transformation, no? Third, what is returned might not even be a translation proper, that is an object of the TRANSLATION class.
<Odin-LAP> gilberth: print, read, find, replace, remove, sort, open...
<gilberth> Would things in CL be named like that it would have been MAKE-CONS-CELL-OBJECT instead of CONS.
<gilberth> Odin-LAP: Print, read, open are I/O, so it's fine.
<gilberth> And I said: If possible.
<gilberth> In general though, I prefer that functions name what is returned, not how that is computed.
<ixelp> Arcane Sentiment: If Scheme were like Scheme
<gilberth> "Numbers would be portably mutable. Some operations would have destructive versions." What?
Gleefre has quit [Remote host closed the connection]
Inline has joined #commonlisp
dino_tutter has quit [Ping timeout: 240 seconds]
<Mondenkind> what? you don't like mutating numbers?
<Alfr> Mondenkind, don't look so sad, just now e decided to be 3.
<gilberth> Alfr: I still have a copy of that e number.
dnhester26 has joined #commonlisp
<thuna`> gilberth: Was that a deep or shallow copy?
green_ has joined #commonlisp
<gilberth> An imperfect copy as my memory unfortunately is finite.
<thuna`> gilberth: So is your e, now
<gilberth> Doesn't bother me, at least it's mine and mine alone! And Alfr can't mess with it anymore.
Gleefre has joined #commonlisp
<Nilby> in a forthcoming purely modified binary p-adic Lisp, mutable numbers are actually useful since most arithmetic can be tree edits and accretions. *works best with p-adic bignum enabled processors
<Renfield> How do I convert a list of something like (:foo :bar :dud "haha") into ((foo :bar) (dud "haha")) ? That is, gather pairs of elements from the list, and lop off the : from the first item in each pair.
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<aeth> good news and bad news... good news is that LOOP does its own destructuring, bad news in that it doesn't error on invalid input unlike destructuring-bind... soy ou have to use destructuring-bind even in a LOOP
<Renfield> Oh destructuring. I knew I read about this elsewhere. Thanks I can research that. But how about lopping off a colon from a symbol? I know I haven't read about that yet.
<aeth> something like this
<aeth> ,(loop :for l :on '(:foo :bar :baz :quux 42) :by #'cddr :collect (destructuring-bind (first second &rest tail) l (declare (ignore tail)) (list first second)))
<ixelp> (loop :for l :on '(:foo :bar :baz :quux 42) :by #'cddr :collect (destructuring-bind (first second &rest tail) l (declare (ignore tail)) (list first second))) ERROR: (42) can't be destructured against the lambda list (FIRST SECOND &REST TAIL), because it does not contain at least 2 elements.
<aeth> ,(loop :for l :on '(:foo :bar :baz :quux) :by #'cddr :collect (destructuring-bind (first second &rest tail) l (declare (ignore tail)) (list first second)))
<ixelp> (loop :for l :on '(:foo :bar :baz :quux) :by #'cddr :collect (destructuring-bind (first second &rest tail) l (declare (ignore tail)) (list first second))) => ((:FOO :BAR) (:BAZ :QUUX))
<aeth> Notice how it only accepts even lists
<Renfield> Yes, that should be what I give it.
<Renfield> Just need to remove the colon from the first items in each pair.
<aeth> as for the second part of your problem, you want to change the package
<aeth> from keyword
<aeth> that's something like this, although you may want to specify which package: ,(intern (symbol-name :foo))
<ixelp> (intern (symbol-name :foo)) => FOO; NIL
<Renfield> Okay, I'll read about that. Thanks a lot.
azimut has quit [Ping timeout: 255 seconds]
azimut_ has joined #commonlisp
<aeth> you can also do (alexandria:plist-alist '(:foo 42 :bar 43)) => ((:foo . 42) (:bar . 43))
<aeth> but then you'd have to iterate twice because it's a cons cell not a list and the first element isn't processed
<Renfield> Ah, yes.
donleo has quit [Quit: Leaving]
<aeth> that's not too unlike what alexandria:plist-alist would do
<aeth> needing an outer mapcar to get it in the proper form
<aeth> I'm not sure which library has partititon, though
<younder> alexandria
<aeth> (in fact, it'd be near identical, just with cdr instead of cadr, in the lambda)
<aeth> I don't see partition in alexandria
<aeth> I see it as an internal function to the implementation of median
tyson2 has joined #commonlisp