Xach 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>
<dieggsy> does allegro CL have a strptime equivalent ?
<edgar-rft> what does strptime do?
<dieggsy> edgar-rft: it's like strftime, the other way around. e.g. if you give it "2018-12-01" and "%Y-%m-%d" it would spit out a date time object
<dieggsy> as opposed to giving it some date time object and the format to spit out a string
<dieggsy> idk why i've suddenly taking to using "spit out" instead of return, it's rather icky sorry lol
<edgar-rft> don't know about allegro but local-time might have such a thing -> https://www.cliki.net/local-time
<dieggsy> edgar-rft: hmm, thanks, i'll take a look
<dieggsy> i try to avoid using extra deps where possible but good grief do we need a proper date/time handling library
<dieggsy> we have a bunch of hacked together ways of detecting and converting date formats across several files and it's .... less than ideal
<dieggsy> hmmm, it doesn't seem to i guess
<edgar-rft> I also try to keep external dependencies as low as possible but writing your own time/date handling rather quickly becomes an enterprise in itself :-)
<dieggsy> yeah, it's awful
<dieggsy> there's multiple functions that do the same things, none doing it particularly well or strictly validly lol
akoana has left #commonlisp [#commonlisp]
<edgar-rft> another fun is that in most networks every computer uses its own built-in hardware clock for the time and the clocks are rather seldom synchronized with each other
<dieggsy> we're normally working on the timescale of days
<dieggsy> but i've been doing some tests and who knows how allegro is interpreting (date-time "20-800") lol. "20-200" is the 200th day of 2020...800 ... wraps around maybe? lol
<Nilby> There was a good date/time string parser on old lisp machines, but it's much much harder to do now, since you have to know and allow locale and language and cultural specific formats, calendars, etc, and also things like do you allow things like 2 leap seconds?
<mfiano> There is a Common Lisp book dedicated to calendrical calculations on my bookshelf I've been meaning to read.
<dieggsy> Lol, so "20-800" is doing 800 mod 365 and using that as the year day
<dieggsy> this appears undocumented
<dieggsy> er, that number* as the day
hisacro has quit [Ping timeout: 264 seconds]
<mfiano> Here it is. Well, apparently there is a newer edition now, but I don't know what is different: https://www.amazon.com/Calendrical-Calculations-Nachum-Dershowitz/dp/0521702380
<mfiano> One review: "However, some of the calculations are very complicated and it was difficult to translate these from the LISP listings in the book into PHP or Javascript."...
<jcowan> Just handling the Gregorian calendar and its near relatives is hard enough. Mayan, fuggedaboudit.
<jcowan> To say nothing of Martian
Bike has quit [Quit: Lost terminal]
CptKirk23 has quit [Ping timeout: 256 seconds]
CptKirk has quit [Ping timeout: 264 seconds]
<Nilby> It's quite a bit of work to parse "2021年 9月 28日 火曜日" and "mar. 28 sept. 2021" and "Tue 28 Sep 2021" and "22 صفر 1443"
hisacro has joined #commonlisp
waleee has quit [Ping timeout: 246 seconds]
tyson2 has quit [Read error: Connection reset by peer]
waleee has joined #commonlisp
karlosz has quit [Quit: karlosz]
<jcowan> Date parsing is the hardest part, but date formatting is no joke either
<dieggsy> 🤦 we have is-someformat-date and also someotherformat-date-p
<jcowan> THere are just so *many* parameters, some of which are locale-specific, others situation-specific. The U.S. is an m-d-y locale, but there are many ways to write it: September 28, 2021 or Seo, 28, 2021 or 9/28/2021 or 9/28/21 or 9-28-21 ...
<jcowan> also 9 or <space>9
<jcowan> s/9/09
Psybur has quit [Remote host closed the connection]
<mfiano> See period delimiters on occasion, too.
<seok-> could someone teach me what semaphores are, or point me to a resource please
<seok-> are they like locked variables
<seok-> oh I thought this was #clschool
<seok-> sorry, my bad
<hayley> A semaphore can be used as a mutex (but not a very good mutex).
<seok-> nice, a resource came up when I looked up mutex
<seok-> thank you
<hayley> It can be used to count the number of some resource available, and have threads wait until resources are available.
<seok-> resource as in, threads ?
<seok-> I'm confused about these terms
<hayley> Well, a lock prevents concurrent access to one "resource", like a shared database. You could use a semaphore for more "resources", like elements in a queue.
<mfiano> anything that is accessed with multiple processes
Qwnavery has joined #commonlisp
<seok-> Can I understand semaphores as just a thread-safe integer variable which counts the number of threads working on a function ?
<mfiano> Not really
<mfiano> A semaphore is more abstract than that.
<hayley> Sort of, but the operations are more limited.
<mfiano> A binary semaphore is like a mutex
<mfiano> Infact they are the same, but their use is different
<hayley> You can release a resource and increment the counter, or acquire by trying to decrement the counter if it is positive, or waiting if it is not.
<seok-> what use case is there for semaphores over thread-locking variables ?
<hayley> As I said, you can handle multiple resources, like multiple elements in a thread-safe queue, with a semaphore.
<mfiano> a thread-locked variable is a concrete use of an abstract binary semaphore
<seok-> ah
<seok-> so the difference would be that, locking a variable will apply only to that one resource
<seok-> wheras semaphores can be used to make a whole function thread-safe ?
<mfiano> which is also a mutex, but a semphore is more general, because in a mutex for example, only the thing that locked a resource should unlock it
<mfiano> a semaphore can be how one implements a software mutex
<seok-> mfiano: oh, that is true
<seok-> so you can have multiple threads accessing a semaphore, and it is still thread-safe
<mfiano> Sure, afaik.
* mfiano doesn't do much multi-threaded programming these days, and when i do, i cheat and reach for lparallel, or "hardware mutex" atomics.
<hayley> I've only really used semaphores indirectly through thread-safe queues, and occasionally I do nitty-gritty concurrent stuff.
CrashTestDummy2 has joined #commonlisp
CrashTestDummy3 has quit [Ping timeout: 245 seconds]
waleee has quit [Ping timeout: 245 seconds]
<akater[m]> Is there a codified Lisp indentation style guide? In particular, I'm interested in line splits. E.g. there is a practice of keeping “then” on the same line as “if” sometimes but it's sort of unofficial. I can't find any document that would consistently describe various Lisp indentation practices.
<hayley> I know in the SICL style there is a linebreak in (loop for x in xs <linebreak> do ...) but it is not mentioned in the Specification.
ad-absurdum has joined #commonlisp
<moon-child> akater[m]: line splits are a matter of personal style, and the complexity of the expressions in question
<moon-child> if the condition and the true branch of an if are simple and short, I would put them on the same line. If either is complex or contains many terms, I would put them on different lines
<moon-child> (and if all are quite simple, put the else branch on the same line as well. Ditto the body of a loop, contra hayley's note re sicl style guide)
<hayley> (Also, this is in contrast to (loop for x in xs do <linebreak> ...))
<akater[m]> moon-child: I still wonder if there's any text describing Lisp indentation practices. There is personal style but there also is accumulated experience.
<akater[m]> Keeping forms concise both horizontally and vertically by using whitespace wisely seems to be recognized as a virtue — again, only informally.
perrierjouet has quit [Quit: WeeChat 3.2.1]
<moon-child> fair enough. I don't know of any such text
lottaquestions has joined #commonlisp
<White_Flame> akater[m]: it kinda depends if the implementation does:
<White_Flame> (def* if (test then &optional else) ...), or
<White_Flame> (def* if (test &body then-and-else) ...)
<White_Flame> the &body form will indent only 2 spaces or so, while the non-&body tends to indent in line with the 2nd element of the list (eg, the test)
lisp123 has joined #commonlisp
<White_Flame> regarding linebreaks, the major thing is that open parens shouldn't end a line, and closing parens shouldn't begin a line
<White_Flame> but that's just pervasive tribal knowledge
lisp123 has quit [Ping timeout: 250 seconds]
gko has joined #commonlisp
prxq has quit [Ping timeout: 252 seconds]
prxq has joined #commonlisp
doyougnu has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
hirez- has joined #commonlisp
hirez has quit [Quit: Later]
<beach> Good morning everyone!
<mfiano> I would urge against putting a loop clause at the end of a line, such as DO. That just makes reading harder.
<beach> I agree. LOOP keywords should start the lines.
<mfiano> Yes, keywords. Sorry, it's late.
<White_Flame> if I have multiple WITH or FORs, I often do (loop <nl> for ... <nl> for ... ) to keep the header forms aligned
<mfiano> But here the second "..." is at the end of the line, so it's fine, assuming "..." doesn't end in a keyword.
<beach> White_Flame: Why would they not be aligned without the newline?
<mfiano> Oh I see. Yeah I don't like that style.
<mfiano> I would prefer to have binding form variables aligned for easy scanning.
<beach> SLIME indentation does a good job on LOOP indentation.
<beach> Er, slime-indentation I think the contribution is called.
<hayley> I put the first loop clause on the first line of a LOOP form, so (loop for ... <nl> for ... <nl> ...) The number of possible LOOP styles is huge.
<mfiano> It even indents :when/:do and similar things that indicate nesting, assuming some SLIME variable is set, and you use keyword-interned keywords.
<hayley> It works if you use any symbols with the appropriate names, from experience.
<mfiano> Oh yes it does. I'm thinking of something else.
<mfiano> What I was thinking of, is it will align the ":" of keyword-interned symbols on adjacent lines, with some lisp-mode variable set.
<mfiano> Which is handy for LOOP, with keyword-interned symbols, to be more readable, like a property list with keyword symbol keys.
<White_Flame> hm, this must have changed in recent years
<mfiano> I forget what that variable is called, or if it is now set by default (it's been like 10 years since I know for a fact it was not the default)
<White_Flame> beach: and yeah, I have code that did not align without the newline
<White_Flame> where every loop keyword within the form is &body-indented, not aligned to the (loop <term> ...) term
<White_Flame> (if/else/when/etc does bump the indentation though)
<beach> White_Flame: All that works right with slime-indentation.
<White_Flame> yep, it does now
<beach> But, yes, I agree, for other constructs I sometimes need to add a newline to get things to line up, mostly due to the brokenness of the Emacs indentation algorithm.
<White_Flame> probably had different setups, manual slime installation, etc going on before
<mfiano> As mentioned, using keyword-symbol LOOP keywords does help Emacs' lisp-mode indentation algorithm in certain situations.
karlosz has joined #commonlisp
semz has quit [Ping timeout: 252 seconds]
<dieggsy> i was leaning towards FFI anyway but i've not actually used CFFI so it certainly expedites things to find someone's already had your exact idea lol
yewscion has quit [Ping timeout: 265 seconds]
semz has joined #commonlisp
<mfiano> dieggsy: You would be losing a lot of the benefits of Common Lisp by punting to foreign code.
<dieggsy> mfiano: ? for the isolated case of turning date strings into unix time?
<dieggsy> there's no built-in way to do it. there's a periods library that has a strptime but it's weirdly too permissive
<mfiano> Yes. You can no longer guarantee that a conforming program will run N decades from now, or currently on other operating systems, such as Mezzano. Instead, use local-time.
<dieggsy> I could certainly try and write my own CL strptime but that feels even more like reinventing the wheel
<dieggsy> mfiano: local-time doesn't handle custom string formats, unless i missed that part of the docs
<dieggsy> parsing* custom string formats
<mfiano> How many do you need? Parsing into the canonical form is an option.
<dieggsy> mfiano: it's not about amount - i have strings like "YY.DDD" that I need turned into some lisp time object or unix time
<dieggsy> as far as i can tell local time doesn't have the option for custom formats
<mfiano> Seems straightforward.
<dieggsy> mfiano: Sure, I could regexp it
<dieggsy> there are other formats
<dieggsy> it's exactly the sort of thing strptime is for lol
<dieggsy> I was already writing a bunch of regex to handle all the cases, but i also have to validate the dates etc.
<dieggsy> "write your own date parsing library" is historically a pretty solid way of shooting oneself in the foot though
<dieggsy> so I was just looking at other options. perhaps strptime through CFFI isn't a good option then. but i always like to look at "short of writing it myself, what's the best alternative"
<mfiano> Well lazy is easy until it has to be rewritten when foreign dependencies change.
<mfiano> Or support more hosts
<mfiano> Common Lisp as a host-agnostic image is the language's greatest feature!
<mfiano> Stop being lazy and write code to do what you want and save yourself some time.
<dieggsy> Respectfully, I disagree that it's "lazy" to not write everything yourself/investigate the alternatives, especially given that I mentioned I was already going down that path
<dieggsy> What kind of an engineer would I be if i couldn't make the best use of the tools at my disposal, heh. Write my own tools too, sure. But they're not mutually exclusive
<mfiano> I and many others make an effort to ensure no transitive dependency is using needless foreign code. You do what you wish though.
phossil has joined #commonlisp
<dieggsy> you make a good point about portability though so that's certainly something to consider
<dieggsy> At the same time, there is FAR too much code in our codebase where someone went "i'll just do it myself" and it's a hot mess so
<dieggsy> inb4 "just don't suck at coding" jajaja
<mfiano> Good architecture is another issue altogether.
<dieggsy> good implementation, even
<mfiano> Take a look at projects like beach's SICL some time.
<mfiano> For inspiration on good code and conforming, portable Common Lisp.
jealousmonk has quit [Quit: ERC (IRC client for Emacs 27.1)]
tophullyte has quit [Ping timeout: 252 seconds]
<dieggsy> this codebase is FAR past that jajaja
<dieggsy> i'm doing my best to steer us right though, and i think i agree haphazardly introducing an FFI dependency doesn't do that so
<dieggsy> consider me convinced-ish
ggoes has quit [Remote host closed the connection]
taiju has quit [Ping timeout: 252 seconds]
<mfiano> Sure. It just pains me when people _needlessly_ use foreign code. It only hurts the Lisp ecosystem and annoys the purists (read: most of us :)). I'm sure beach and others will chime in with more reasons when they've had their coffee.
<dieggsy> Well, i'm certainly more of a pragmatist than a purist, but you can be one and the other, and in some cases you have to be one to be the other
<mfiano> I've been working on a game engine for approximately 10 years now, and if I had to use foreign code, I would probably just use C, heh.
<dieggsy> I enjoy hearing opinions in any case, even (especially?) those I might not initially be inclined to agree with. I've no real ego about my programming lmao
ggoes has joined #commonlisp
<mfiano> This isn't to say that foreign code isn't useful at times, though.
<dieggsy> Of course it is
<dieggsy> As a chicken schemer at heart, foreign code is one of the major selling points there
<dieggsy> I'm aware this ain't chicken though
<dieggsy> I've done some CL too
<mfiano> For example, in my domain, game development, whenver I interface with the OS for I/O I must use C at some level, whether it's a syscall, or some hardware abstraction layer. In my case, the only foreign code I use is SDL, and it's largely unavoidable mostly due to GPU manufacturers releasing binary blob drivers.
<moon-child> mfiano: you don't need sdl necessarily; there is e.g. clx
<mfiano> This does limit the machines that can run my code, but SDL is pretty widespread and touches everything that has a GPU driver available for it anyway, so I don't mind. It does mean though that I am at the mercy of the project unless I write an abstraction layer.
taiju has joined #commonlisp
<moon-child> (though obviously gl you need to touch foreigns for)
<mfiano> Which I actually have in testing, where I can switch to eg; glop
<mfiano> Sadly, clx is not useful to me as X itself does not provide some things needed.
<mfiano> It was also buggy and crashed my X server with my driver the last time I tried it.
<moon-child> because _clx_ is buggy the x _server_ crashed?
<moon-child> :D
<mfiano> Yes, it happened reliably when I dragged a window, and my X server usually runs for months at a time without an issue. :)
<mfiano> I admit I haven't tried in about a year, but I don't really have a reason to anyway.
<dieggsy> The other thing is you don't always have full control over your code, e.g. we depend on proprietary databases etc. anyway
ggoes has quit [Ping timeout: 264 seconds]
<mfiano> I hope it's Franz's stuff :)
<dieggsy> some of it is
phossil has quit [Quit: Leaving]
<beach> The only thing I can add, or rather emphasize, is that FFI solutions tend to benefit only the individual, whereas if that individual spent a little bit more time to create or add to a pure Common Lisp library, we would collectively benefit.
dec0d3r has quit [Remote host closed the connection]
dec0d3r has joined #commonlisp
<mfiano> Ah, yes, well put.
ggoes has joined #commonlisp
<mfiano> I suppose sometimes an individual is a team, in which case, the decision to depend on foreign code should be more carefully weighed, and knowledge of the entire team's working environment and compatibility/issues with said foreign library in that environment.
rgherdt has joined #commonlisp
karlosz has quit [Ping timeout: 246 seconds]
<mfiano> and of course, the same considerations for the customer's environment!
<mfiano> Whereas with a pure solution, none of that needs to be taken into account.
notzmv has quit [Ping timeout: 246 seconds]
ggoes has quit [Ping timeout: 245 seconds]
lisp123 has joined #commonlisp
dec0d3r has quit [Remote host closed the connection]
dec0d3r has joined #commonlisp
yewscion has joined #commonlisp
yewscion_ has joined #commonlisp
CrashTestDummy3 has joined #commonlisp
CrashTestDummy3 has quit [Read error: Connection reset by peer]
karlosz has joined #commonlisp
CrashTestDummy3 has joined #commonlisp
yewscion has quit [Ping timeout: 264 seconds]
dec0d3r has quit [Remote host closed the connection]
CrashTestDummy2 has quit [Ping timeout: 245 seconds]
dec0d3r has joined #commonlisp
<beach> mfiano: Indeed.
sndr has joined #commonlisp
sander has quit [Ping timeout: 252 seconds]
sndr is now known as sander
ggoes has joined #commonlisp
ad_absurdum has joined #commonlisp
ad-absurdum has quit [Ping timeout: 245 seconds]
yewscion_ has quit [Ping timeout: 264 seconds]
Cymew has joined #commonlisp
ggoes has quit [Ping timeout: 246 seconds]
<lisp123> If anybody wants an Emacs shortcut to re-run the expression entered into the SLIME REPL (useful for re-running tests), you can use this (thanks pjb for parts of the code): https://pastebin.com/NJ7CE4Lx
<lisp123> s/the expression/the last expression
<beach> What's wrong with M-p?
contrapunctus has left #commonlisp [#commonlisp]
<lisp123> M-p is from within the REPL, this can be used from any buffer (so saves having to switch to the REPL and back) -- I may be mistaken though and there is some other way
<beach> I see.
ggoes has joined #commonlisp
karlosz has quit [Ping timeout: 268 seconds]
contrapunctus has joined #commonlisp
shka has joined #commonlisp
gaqwas has joined #commonlisp
pve has joined #commonlisp
amb007 has quit [Ping timeout: 246 seconds]
amb007 has joined #commonlisp
cosimone has joined #commonlisp
tophullyte has joined #commonlisp
karlosz has joined #commonlisp
igemnace_ has joined #commonlisp
igemnace has quit [Read error: Connection reset by peer]
notzmv has joined #commonlisp
dec0d3r has quit [Remote host closed the connection]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
lotuseater has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
gaqwas has quit [Ping timeout: 264 seconds]
hendursa1 has joined #commonlisp
dec0d3r has joined #commonlisp
elderK has quit [Quit: Connection closed for inactivity]
karlosz has quit [Quit: karlosz]
selwyn has joined #commonlisp
hendursaga has quit [Ping timeout: 276 seconds]
adabsurdum has joined #commonlisp
ad_absurdum has quit [Ping timeout: 246 seconds]
Jach has quit [Remote host closed the connection]
dre has quit [Ping timeout: 265 seconds]
MatrixTravelerbo has quit [Quit: Bridge terminating on SIGTERM]
loke[m] has quit [Quit: Bridge terminating on SIGTERM]
luis` has quit [Quit: Bridge terminating on SIGTERM]
dieggsy has quit [Quit: Bridge terminating on SIGTERM]
rudi has quit [Quit: Bridge terminating on SIGTERM]
bitspook[m] has quit [Quit: Bridge terminating on SIGTERM]
alphapapa[m] has quit [Quit: Bridge terminating on SIGTERM]
saltrocklamp[m] has quit [Quit: Bridge terminating on SIGTERM]
katco has quit [Quit: Bridge terminating on SIGTERM]
akater[m] has quit [Quit: Bridge terminating on SIGTERM]
dualinverter[m] has quit [Quit: Bridge terminating on SIGTERM]
icepic1984[m] has quit [Quit: Bridge terminating on SIGTERM]
santiagopim[m] has quit [Quit: Bridge terminating on SIGTERM]
hayley has quit [Quit: Bridge terminating on SIGTERM]
Gnuxie has quit [Quit: Bridge terminating on SIGTERM]
bhyde[m] has quit [Quit: Bridge terminating on SIGTERM]
Duuqnd has quit [Quit: Bridge terminating on SIGTERM]
etimmons has quit [Quit: Bridge terminating on SIGTERM]
Bi[m] has quit [Quit: Bridge terminating on SIGTERM]
Mrtn[m] has quit [Quit: Bridge terminating on SIGTERM]
happy-dude has quit [Quit: Bridge terminating on SIGTERM]
CodeBitCookie[m] has quit [Quit: Bridge terminating on SIGTERM]
yitzi has quit [Quit: Bridge terminating on SIGTERM]
loke[m] has joined #commonlisp
luis` has joined #commonlisp
katco has joined #commonlisp
Mrtn[m] has joined #commonlisp
happy-dude has joined #commonlisp
santiagopim[m] has joined #commonlisp
alphapapa[m] has joined #commonlisp
etimmons has joined #commonlisp
yitzi has joined #commonlisp
saltrocklamp[m] has joined #commonlisp
Bi[m] has joined #commonlisp
dieggsy has joined #commonlisp
MatrixTravelerbo has joined #commonlisp
hayley has joined #commonlisp
dualinverter[m] has joined #commonlisp
Gnuxie has joined #commonlisp
CodeBitCookie[m] has joined #commonlisp
Duuqnd has joined #commonlisp
bhyde[m] has joined #commonlisp
icepic1984[m] has joined #commonlisp
akater[m] has joined #commonlisp
bitspook[m] has joined #commonlisp
rudi has joined #commonlisp
lotuseater has quit [Remote host closed the connection]
mmk2410 has quit [Quit: ZNC - https://znc.in]
mmk2410 has joined #commonlisp
mmk2410 has quit [Remote host closed the connection]
mmk2410 has joined #commonlisp
mmk2410 has quit [Quit: ZNC - https://znc.in]
mmk2410 has joined #commonlisp
mmk2410 has quit [Client Quit]
mmk2410 has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
adabsurdum has quit [Ping timeout: 264 seconds]
scymtym has quit [Ping timeout: 245 seconds]
scymtym has joined #commonlisp
mindlessmaniac has quit [Ping timeout: 245 seconds]
mindlessmaniac has joined #commonlisp
dec0d3r has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 245 seconds]
amb007 has joined #commonlisp
random-nick has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
selwyn has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
tyson2 has joined #commonlisp
Qwnavery has quit [Quit: WeeChat 3.3]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
CrashTestDummy2 has joined #commonlisp
CrashTestDummy3 has quit [Ping timeout: 245 seconds]
jeosol has quit [Quit: Ping timeout (120 seconds)]
igemnace_ has quit [Quit: WeeChat 3.2.1]
<lisp123> pjb: Is there a way to use both IBCL & CL-STEPPER together? I tried it and it seems to work, but I have to resolve some conflicts during the ASDF load process (which may just be some incorrect setup on my end)
Bike has joined #commonlisp
waleee has joined #commonlisp
Psybur has joined #commonlisp
aeth has quit [Ping timeout: 246 seconds]
aeth has joined #commonlisp
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
rudi has quit [Ping timeout: 240 seconds]
bhyde[m] has quit [Ping timeout: 268 seconds]
tyson2 has joined #commonlisp
ad-absurdum has joined #commonlisp
CptKirk has joined #commonlisp
andreyorst has quit [Ping timeout: 245 seconds]
Posterdati has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
jealousmonk has joined #commonlisp
doyougnu has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
andreyorst has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
cosimone` has joined #commonlisp
cosimone has quit [Ping timeout: 245 seconds]
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
tyson2 has joined #commonlisp
waleee has quit [Quit: WeeChat 3.3]
hendursa1 has quit [Ping timeout: 276 seconds]
hendursa1 has joined #commonlisp
<Fade> aaaaand Bell has a transit hiccup.
rudi has joined #commonlisp
<beach> Who is "Bell"?
bhyde[m] has joined #commonlisp
<edgar-rft> Hells Bells
<Fade> Bell is the conglomeration of telecommunications companies (the baby bells) that resulted from the US federal government breaking up AT&T
cage has joined #commonlisp
<beach> Most of the world probably doesn't care.
<Fade> they share a lot of deep infrastructure, still.
<Fade> anyhow, I was just commenting on the network resets that cascaded through the channel.
<beach> Ah, I see now.
<beach> Though, I didn't see any such resets.
<Fade> perhaps your client ignores the messages. they can get quite noisy, but I usually enable them.
<beach> Or maybe I am far away from any Bell.
<edgar-rft> Let's ask on ##astronomy what they know about the Bell transit and its hiccups
waleee has joined #commonlisp
<Fade> i suspect backbone architecture is out of scope for #commonlisp, so I'll shaddap now.
ec has joined #commonlisp
frgo has quit [Remote host closed the connection]
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
Nilby has quit [Ping timeout: 245 seconds]
cosimone` has quit [Remote host closed the connection]
cosimone has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
ec has quit [Remote host closed the connection]
srhm has joined #commonlisp
arcsech[m] has joined #commonlisp
arcsech[m] is now known as Arcsech
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #commonlisp
ad-absurdum has quit [Quit: Leaving]
<pjb> lisp123: indeed, since CL-STEPPER replaces CL, and IBCL shadows some symbols from CL, and replaces CL too, (but in a hidden manner), you would have to make an IBCL-STEPPER package that chooses carefully its symbols from one or the other. And since there are some collisions, eg. DEFUN you will have to merge the functionalities by definiting our own IBCL-STEPPER:DEFUN (similarly, DEFGENERIC, DEFMETHOD, etc).
<pjb> lisp123: note: if you wanted to use CLIM, you'd also have to merge the behaviors, CLIM shadows CL:defclass and CL:defmethod…
doyougnu has quit [Remote host closed the connection]
<beach> pjb: Did you mean for that to go in #clschool?
<pjb> No, here, lisp123 asked it here at <14:15:21>.
<beach> OK.
<pjb> And it's rather advanced, for a beginner ;-)
eddof13 has joined #commonlisp
<lisp123> pjb & beach: Thanks :) Yes asked it here as its useful for all imo too :)
<pjb> lisp123: It looks nice.
<lisp123> pjb: Thanks!
rotateq has joined #commonlisp
CrashTestDummy2 has quit [Quit: Leaving]
CrashTestDummy has joined #commonlisp
lisp123_ has joined #commonlisp
lisp123_ has quit [Client Quit]
Cymew has quit [Ping timeout: 245 seconds]
lisp123 has quit [Ping timeout: 264 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jeosol has joined #commonlisp
<saltrocklamp[m]> eric: thanks for doing that!! i also managed to get c2ffi working in the meantime
eddof13 has joined #commonlisp
<rotateq> saltrocklamp[m]: oh for what's c2ffi? :) i just know cffi
<rotateq> thanks
<rotateq> and of course i know the nickname of something else, c2mop ^^
eddof13 has quit [Remote host closed the connection]
<rotateq> So I remembered today how to escape when (setq *read-base* 36) was accidentally written.
ahlk has quit [Ping timeout: 264 seconds]
CptKirk has quit [Ping timeout: 256 seconds]
<Arcsech> And how is that?
<rotateq> shall I say it now or do you want to try first?
<rotateq> Arcsech: and nice nickname btw :)
<kagevf> pjb: and lisp123: that command would be even more useful if it got the last command from the currently active repl ... exercise left for the user, I guess :) it's a good start, though :)
<etimmons> salt rock lamp: Nice! I had some issues getting c2ffi working, but can't remember them at the moment
<rotateq> hmm salt rock lamp, sounds like a variation of the game scissors, paper, rock, lizard, spock
<pjb> rotateq: || and .
<rotateq> pjb: heh!
<pjb> (|SETF| |*READ-BASE*| 10.)
<rotateq> i wanted to let him try first :P
<Arcsech> Thanks rotateq :)
<pjb> Oops. You should have announced a quizz.
<Arcsech> I couldn't figure it out but I'm newish to CL
<Arcsech> :p
<rotateq> it's even possible with (|SETF| *read-base* 10.) for me in SBCL
<saltrocklamp[m]> rotateq: it's one of these :) https://i.ebayimg.com/images/i/262430307343-0-1/s-l1000.jpg
<rotateq> Arcsech: oh nice
<pjb> Indeed. since *…-…* is not number syntax.
<rotateq> saltrocklamp[m]: beautiful, like lava lamps
<pjb> You can also escape a single letter: (\Setf *read-base* 10.)
<rotateq> pjb: we had this some weeks ago in #lispcafe and gilberth told me the thing with 10. vs 10.0
<rotateq> ah right, like ever more than one possibility
<rotateq> there was another thing I couldn't escape but I can't remember now
<Arcsech> Are the reader things CL supports by default (e.g. `|symbol name|`, `#xdeadbeef`, etc) in the hyperspec anywhere? I can't find them
<rotateq> Arcsech: with the pipes around you can type your symbols like you want
<Arcsech> Sure, yeah, but I'm bad at remembering things and would like a list I can reference of the built in "reader macros" or special reader symbols or whatever they're called
<rotateq> oh me too
<rotateq> and yes wait a moment ...
<pjb> Arcsech: it's described in detail in the chapter 2.
* rotateq has to be careful not pasting his local clhs links
<Arcsech> Much appreciated, I think I was having difficulty b/c they're not in the symbol index (...because they're not symbols AIUI, but still)
<rotateq> Arcsech: so it's opens the eyes when you realize that ", ;, (, ), ... are readmacros. but maybe you first want to learn way simpler dark magic :)
<pjb> Arcsech: indeed, don't forget to read the sections before the symbols in each chapter ;-)
<rotateq> yes right, they expand to something before the compiler sees anything
<pjb> indeed, the only hardwired lisp syntax is for integer, floats, and symbols. And even that could be shadowed by writing reader macros on all the characters.
<rotateq> yes many are free to simulate other language's syntax
<rotateq> or other useful things
<Arcsech> To ask what is perhaps a silly question, why don't you see a lot more of that? e.g. with Racket, one can write a prolog clone in Racket with completely different syntax (not s-exp based), then call prolog-clone code from Racket and vice-versa. Seems like that should be possible with CL as well, but I don't recall any instances of having seen it
<rotateq> oh don't worry, i ask silly questions all the time
notzmv has quit [Ping timeout: 246 seconds]
<Arcsech> I mean more from a technical standpoint than an architectural one BTW
<rotateq> the first step writing the macros you need to have prologish things, like described in "On Lisp"
<rotateq> not just possible, but natural
aeth has quit [Ping timeout: 265 seconds]
tyson2 has joined #commonlisp
aeth has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
<Arcsech> Well, that was on the list of books to read already, so I guess I'll get there :p
<rotateq> it's one of the good intro books, especially to get a good fundament with macros
jkordani has joined #commonlisp
<rotateq> like ANSI Common Lisp that is written by Paul Graham too
<akater[m]> arcsech: M-x hyperspec-lookup-reader-macro
<Arcsech> I've read most of Practical Common Lisp (though a bit ago now), currently reading Programming Algorithms in Lisp. I think a macro book is probably next
<Arcsech> Thanks akater
<rotateq> oh PAiL is the newer book by Vsevolod
karlosz has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
<Arcsech> Yeah, that one. Pretty good so far but I'm only through the chapter on arrays
ahlk has joined #commonlisp
<Arcsech> It's definitely on the more casual end of algo textbooks but does a good job of showing how Lisp makes implementations pretty clean and easy to understand
notzmv has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
CptKirk has joined #commonlisp
amb007 has quit [Ping timeout: 265 seconds]
amb007 has joined #commonlisp
mindlessmaniac has quit [Quit: Leaving]
<paule32> hello
<rotateq> hi paule32 :)
<paule32> i which form it is better, to describe a ic - in a list or a array or defun
<rotateq> you mean integrated circuit?
<paule32> in context, yes, of more than 1 port
<rotateq> maybe the components as classes and then combining them with s-exprs
<rotateq> this is one thing i thought about too sometime
<paule32> give it more?
<rotateq> ahh okay so with an array when you imagine the circuit from above with fields and some are empty
karlosz has quit [Quit: karlosz]
<paule32> also, i would be describe a ic - and its internal build
<rotateq> yes maybe writing a simple digital simulation program where you can put circuits with wires in McCLIM
<paule32> then, i would add ports for io
<rotateq> yes, one step at a time
<paule32> mcclim, a library ?
<rotateq> it's for building powerful graphical interfaces declaratively
lisp123 has joined #commonlisp
<rotateq> with a defined protocol like in MOP and special capabilities
<paule32> free ?
<rotateq> it features 100% less C or foreign libs
<rotateq> and yes, McCLIM is an open version of CLIM2
<paule32> ok
<paule32> but i dont understand at the moment, how ic can be describe
<rotateq> so one of your superclasses could be (defclass circuit () ())
CptKirk has quit [Ping timeout: 256 seconds]
karlosz has joined #commonlisp
<paule32> and the properties are slots ?
<rotateq> yes if it makes sense, sometimes you have properties better in methods
<paule32> and classes can be derivated
<rotateq> like when you do (defclass triangle (shape) (x y z)) so you store the three defining points, but for example the area is computed by a method
X-Scale` has joined #commonlisp
X-Scale has quit [Ping timeout: 252 seconds]
<rotateq> yes right, multiple inheritance
X-Scale` is now known as X-Scale
CrashTestDummy2 has joined #commonlisp
CrashTestDummy has quit [Ping timeout: 245 seconds]
Yehowshua has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
tyson2 has quit [Ping timeout: 245 seconds]
amb007 has joined #commonlisp
<rotateq> pjb: oh now I learned that even something like #b101/10 is allowed :)
<rotateq> okay makes sense, I imagine the #b, #x, #o, #r work internally in a way to set the *read-base* temporarily to the one the specify
amb007 has quit [Ping timeout: 245 seconds]
amb007 has joined #commonlisp
MarsIronPI has joined #commonlisp
MarsIronPI has quit [Client Quit]
gaqwas has joined #commonlisp
CptKirk has joined #commonlisp
Yehowshua has quit [Ping timeout: 256 seconds]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
semz has quit [Ping timeout: 246 seconds]
lottaquestions has quit [Ping timeout: 250 seconds]
<lisp123> kagevf: Hmmm good question :) Something like this should do the trick (will leave parts of it unsolved for the reader :) ) --> (let* ((buffer-names (loop for buffer in (buffer-list) collect (buffer-name buffer))) (new-buffer-list (remove-if-not [slime-repl-buffer-p] buffer-names))) (with-current-buffer (car (sort new-buffer-list #'string-greaterp.....
Yehowshua has joined #commonlisp
CptKirk has quit [Quit: Client closed]
CptKirk has joined #commonlisp
ec has joined #commonlisp
<kagevf> lisp123: that's elisp, right?
Yehowshua has quit [Quit: Client closed]
<lisp123> Yes (although it has a mistake it but pretty easy to figure it out once one tries). Let me know if you want me to write it out fully
<kagevf> lisp123: would it be (easily) possible to get the list of slime connections from the *slime-connections* buffer? then one could parse for the active one ...
MarsIronPI has joined #commonlisp
<kagevf> I don't think your elisp actually determines which connection is the active one, but maybe it would be easy if it's possible to grab the same list used to render *slime-connections*
<lisp123> kagevf: Have a look at the SLIME code and see if its possible, its pretty well documented
scymtym has quit [Ping timeout: 252 seconds]
<kagevf> I haven't gotten into elisp much at all, so sorry if these are obvious questions
<kagevf> hmmm ... maybe there's a command to get it already ...
<lisp123> kagevf: Yes, but I think its relatively trivial (that was the error), your buffer-list variable in Emacs should be already sorted so that the active one will be the earliest (so basically remove the SORT in the code above)
doyougnu has joined #commonlisp
<lisp123> No worries, I think learning SLIME is a good thing. I will send you the updated code in a few days in any case, glad you brought it up because this way it can be made implementation independent too (the earlier one was hardcoded to SBCL)...will think of the best way to do it
MarsIronPI has quit [Ping timeout: 252 seconds]
<kagevf> lisp123: oh, really? oh, nice ... thank you for the snippet .... I'll play around with it and see how far I can get :)
<kagevf> lisp123: and looking forward to that update ... that would be a nice way to take something you've been experimenting with and get it quickly into your actual code buffer ... great idea!
<lisp123> kagevf: Great :) Enjoy! Yes, I'm loving this function. Now I want to add 'clear Slime REPL' as well and some other ones so that no more switching to the REPL and back
<kagevf> lisp123: btw, I just checked the output of (loop for buffer in (buffer-list) collect (buffer-name buffer)), and it appears to sort by most recently accessed
<kagevf> so, IOW, if I have to slime buffers opened 1 and 2, and 1 is the active one and 2 is some other random one, if I access slime-2 then run that code, slime-2 will be at the top
<kagevf> * I have 2 slime buffers
<kagevf> my goal would be to have the repl that's connected to C-c C-z (slime-switch-to-output-buffer)
<kagevf> even if it's not the slime repl you last accessed
<lisp123> Lets chat on #slime to avoid adding too much elisp here :)
tyson2 has joined #commonlisp
cosimone has quit [Ping timeout: 245 seconds]
jkordani has quit [Quit: Client closed]
<pjb> rotateq: and (list #C(1/2 3/4) 'and #C(#7r10/3 #12rA/5)) #| --> (#C(1/2 3/4) and #C(7/3 2)) |#
shka has quit [Ping timeout: 250 seconds]
frgo has joined #commonlisp
pve has quit [Quit: leaving]
<rotateq> yes
frgo has quit [Ping timeout: 260 seconds]
<rotateq> hm till now I'm not so fit with the extra parameters in the format directives ~d, ~b, ~x, ...
<rotateq> pjb: do you know from memory how I can print a number as binary with four groups and underscore, namely for example 0110_1110_0000_0110 ? :)
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
<mfiano> Not builtin
<rotateq> mfiano: oh but wait
<rotateq> i can call a custom function too, right?
<mfiano> ~/
<rotateq> Nilby told much about format magic some months ago.
<mfiano> an octet vector can be printed similarly on SBCL but is non-standard behavior: (format nil "~b" #(10 122 102 84))
<rotateq> haha okay, many will think of UNIX home dir
<rotateq> then better first nothing impl specific
<pjb> (format nil "~,,'-,4:B" (random (expt 2 32))) #| --> "101-1011-1010-0110-0010-1011-0111-1001" |#
<pjb> rotateq: ^^
<rotateq> you should teach all that stuff :)
<pjb> (format nil "~48,'_,',,4:B" (random (expt 2 32))) #| --> "_________1011,1010,1100,1111,0010,0111,1111,1011" |#
<pjb> It's just written down in the clhs…
<rotateq> uii
<mfiano> Oh I see. Yes, I stand corrected.
<rotateq> okay where? i was on the examples page
<rotateq> mfiano: ah don't worry, we're here for exchange
<pjb> section 22.3.2.* -> 22.3.2.2
<rotateq> oki
<mfiano> But what about zero padding?
<pjb> rotateq: go to format, and follow the link to 22.2
<pjb> (format nil "~48,'0,',,4:B" (random (expt 2 32))) #| --> "0000000001100,1101,0001,0101,0010,0000,0000,1110" |#
<pjb> mfiano: ;-)
<mfiano> Uhh
<pjb> (format nil "~{~A~^,~}" (group-by (format nil "~48,'0B" (random (expt 2 32))) 4)) #| --> "0000,0000,0000,0000,1111,0001,1110,0011,1110,1001,1000,0110" |#
<pjb> with com.informatimago.common-lisp.cesarum.sequence:group-by
<mfiano> better, but not confined to the DSL
<pjb> Post an issue to (group-by :from-end t)
<mfiano> Which is why I thought you couldn't zero pad nibbles with pure FORMAT
<pjb> mfiano: indeed, format specifier are often limited like that.
<pjb> and you're right, it's not done for zero-pad, but for padding the field with spaces or * or # etc…
<mfiano> Yes
<pjb> For example: (format nil "~10,'0D" -123) #| --> "000000-123" |# ;-)
<mfiano> Right. I use it often for rendering purposes
<mfiano> I would like there to be a generic function protocol for a FORMAT compiler.
<rotateq> okay thanks again. I'm now about going to sleep :) see you
<rotateq> mfiano: afaik SICL wants to provide extensibility
<mfiano> I think it would be nice to build up a string with a series of generic function calls, with each step being a method that could be specialized by the user to change/augment its behavior
<mfiano> It would no longer be a terse DSL though.
rotateq has left #commonlisp [ERC (IRC client for Emacs 27.2)]
<mfiano> THis is half me wanting to be able to extend FORMAT for cases like the above, and half me never remembering the different directives and their parameters.
<mfiano> With the latter being a side-effect of me usually not being able to easily understand a format string at a quick glance, with such a compressed DSL
<mfiano> Would like a more human-readable/extendable solution
<mfiano> I know I am alone, so end rant.
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
<Arcsech> You could always write your own :p
akoana has joined #commonlisp
scymtym has joined #commonlisp
<lisp123> mfiano: I agree with you, format and regexs are so hard to follow at times
<mfiano> Yes, regex is similar. IIRC there was a simple solution to that in Sussman's recent book
<mfiano> I guess it's just preference. I often care much more about human-readable code and extensibility, than playing some sadistic form of obfuscated code golf
<pjb> mfiano: well, either ~/ or indeed, write a format-2.0 and (defpackage … (:use "CL") (:shadowing-import-from "FORMAT-2.0" "FORMAT") …)
<pjb> mfiano: or take the opportunity to design a more lisp format specifier language.
<pjb> more lispy and richer.
ahlk has quit [Read error: Connection reset by peer]
<mfiano> The problem is in the "time" part
<pjb> (and why not, add localization >:-}~)
<mfiano> My back burner has back burners
<pjb> as always.
<mfiano> Fractasl sotve all the way down
ahlk has joined #commonlisp
<mfiano> Fractal*
<mfiano> Ugh I can't type today
semz has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ is now known as Lord_of_Life
attila_lendvai has quit [Ping timeout: 252 seconds]
Qwnavery has joined #commonlisp
tyson2 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
tophullyte has quit [Ping timeout: 268 seconds]
lisp123 has joined #commonlisp
gaqwas has quit [Ping timeout: 260 seconds]
lisp123 has quit [Ping timeout: 252 seconds]
CrashTestDummy3 has joined #commonlisp
CrashTestDummy2 has quit [Ping timeout: 252 seconds]
santiagopim has joined #commonlisp
tophullyte has joined #commonlisp
dec0d3r has joined #commonlisp
rgherdt has quit [Ping timeout: 245 seconds]
azimut has joined #commonlisp
lisp123 has joined #commonlisp
azimut_ has quit [Remote host closed the connection]
taiju has quit [Ping timeout: 264 seconds]
taiju has joined #commonlisp
igemnace has joined #commonlisp
waleee has quit [Ping timeout: 245 seconds]
lisp123 has quit [Ping timeout: 245 seconds]
waleee has joined #commonlisp
dre has joined #commonlisp
asarch has joined #commonlisp
hendursaga has quit [Remote host closed the connection]
hendursaga has joined #commonlisp
igemnace has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
igemnace has joined #commonlisp
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
lisp123 has quit [Ping timeout: 245 seconds]
tophullyte has quit [Quit: Leaving]
tyson2 has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]