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>
Guest74 has quit [Quit: Connection closed]
poselyqualityles has quit [Ping timeout: 268 seconds]
dre has joined #commonlisp
dra has quit [Quit: Leaving]
Jing has quit [Remote host closed the connection]
Jing has joined #commonlisp
shka has quit [Ping timeout: 268 seconds]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
s-liao has joined #commonlisp
Oladon has joined #commonlisp
<hobo> so, I wrote a chat program to learn CL, and I currently connect to the server via telnet. One thing I noticed is that if the user is in the middle of typing, and they receive a message, then the input gets broken up.
<hobo> Is there a way to prevent that from happening?
getynge has joined #commonlisp
<semz> that's a problem with your terminal
<hobo> ideally, the incoming message appears above the prompt and their input remains untouched
<hobo> ah, okay.
<semz> running the program through something like rlwrap might be enough to fix that
<ns12> pjb: Regarding defstruct: thank you.
<semz> alternatively you could use something like curses on the Lisp side or output the necessary control codes yourself, but that might go beyond the scope of a beginner project
rotateq has quit [Ping timeout: 250 seconds]
<hobo> i wonder how MUDs do it
<hobo> I remember using telnet to connect to MUDs on *nix and Windows.
<hobo> maybe curses is the next piece of the project :)
elderK has joined #commonlisp
x88x88x has joined #commonlisp
waleee has quit [Quit: WeeChat 3.3]
thomaslewis has joined #commonlisp
<phantomics> hobo: for curses, you should check out the croatoan library
<phantomics> The concept of curses is pretty simple: you can get the dimensions of the screen, move the cursor to a given point and enter characters. What you want to do is keep track of where the user's cursor is, and then when a new message comes in, you rewrite all the text in the chat area above the entry area, then when finished, move it back to where the user had the cursor before the message came in
<phantomics> That way the text entry process feels seamless for the user
<hobo> to be clear, would i need to write a separate curses client, or can I just send the telnet client the screen buffer?
<hobo> i wonder how i'd get the client's screen size.
<phantomics> curses has a method to get the screen size, croatoan exposes it, see: https://github.com/McParen/croatoan/blob/master/test/evolution.lisp
<phantomics> As for buffers, not sure
<phantomics> See the (width) and (height) methods on that page
<hobo> phantomics: thank you for the references.
notzmv has quit [Ping timeout: 268 seconds]
Oladon1 has joined #commonlisp
<phantomics> anytime hobo
phantomics has quit [Quit: Ex-Chat]
Oladon has quit [Ping timeout: 256 seconds]
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
getynge has quit [Quit: Leaving]
akoana has quit [Quit: leaving]
thomaslewis has left #commonlisp [#commonlisp]
Guest74 has joined #commonlisp
poselyqualityles has joined #commonlisp
theothornhill has joined #commonlisp
theothornhill has quit [Ping timeout: 268 seconds]
jpl01 has quit [Remote host closed the connection]
thomaslewis has joined #commonlisp
notzmv has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
poselyqualityles has quit [Ping timeout: 268 seconds]
green__ has joined #commonlisp
thomaslewis has joined #commonlisp
green_ has quit [Ping timeout: 268 seconds]
green__ has quit [Read error: Connection reset by peer]
x88x88x has quit [Ping timeout: 245 seconds]
prxq_ has quit [Ping timeout: 240 seconds]
prxq has joined #commonlisp
phantomics has joined #commonlisp
pdietz has quit [Ping timeout: 256 seconds]
s-liao has quit [Ping timeout: 256 seconds]
pdietz has joined #commonlisp
<hayley> I just got SIMD scanning working in my regex engine. It is now about three times as fast as Hyperscan at finding resolutions in my Xorg.0.log apparently.
<White_Flame> hobo: are you sure you used raw telnet for muds, and not something like tinyfugue?
<White_Flame> because yes, MUDs have the same problem
Jing has quit [Remote host closed the connection]
Jing has joined #commonlisp
<beach> Good morning everyone!
elderK has quit [Quit: Connection closed for inactivity]
<phantomics> Morning beach
<phantomics> Interesting thing I just discovered in LispWorks: (expt 10.0d0 10) gives 1.000000000000004D10, the 4 is not there in other CLs. Causes problems when taking the ceiling of the result
<Nilby> hayley: just don't sell out to intel, or if you do make sure to get a big ask like qpx
<hayley> Nilby: Too late, they already bought Hyperscan in 2013.
<Nilby> I know, I mean your faster code :)
<hayley> Note to self: sell out to AMD.
<phantomics> Is this a CL regex engine? Distinct from cl-ppcre?
<hayley> Right.
<hayley> Not quite as "feature"ful, given that I have to generate a DFA from everything, but it's pretty fast in return, even without SIMD.
<phantomics> Cool, I'll have tackle SIMD at some point for April, I take it the SIMD is using define-vop and only works with SBCL?
<beach> hayley: Congratulations!
<hayley> Thanks!
<hayley> phantomics: Right and right.
s-liao has joined #commonlisp
<semz> phantomics: A program that relies on this exact behavior sounds misdesigned to me, the same way a program using exact FP comparisons would.
<hayley> I guess LispWorks uses another float parsing algorithm?
<phantomics> I guess, I've found a few inconsistencies in its float handling
<phantomics> It also has a tendency to lock up a lot during intensive April computations, maybe it's a problem with the multithreading
<phantomics> I have to do C-c and select (CONTINUE) to get it going again
<hayley> Ouch.
<phantomics> ECL sometimes locks up once or twice when doing the intensive demo test suite, but LW locks up a dozen times or so needing manual restarts. SBCL, CCL, and ABCL get through it fine.
<beach> I think you should report it to LispWorks. I am sure they will appreciate the feedback.
<phantomics> I figured they'd send me a bill for requesting tech support
<beach> I don't think so. Martin Simmons seems like a very reasonable person. At least when we have diner together at ELS. :)
* beach is assuming Martin is still in charge.
s-liao has quit [Ping timeout: 256 seconds]
<phantomics> I'll give them a try then
Devon has quit [Ping timeout: 256 seconds]
qhong has quit [Read error: Connection reset by peer]
Devon has joined #commonlisp
s-liao has joined #commonlisp
Devon has quit [Ping timeout: 240 seconds]
jealousmonk has quit [Quit: ERC (IRC client for Emacs 27.1)]
semz has quit [Ping timeout: 268 seconds]
lisp123 has quit [Remote host closed the connection]
s-liao has quit [Quit: Ping timeout (120 seconds)]
s-liao has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 268 seconds]
semz has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
Oladon1 has quit [Quit: Leaving.]
s-liao has quit [Ping timeout: 256 seconds]
tyson2 has quit [Remote host closed the connection]
poselyqualityles has joined #commonlisp
peterhil has quit [Remote host closed the connection]
peterhil has joined #commonlisp
waleee has joined #commonlisp
poselyqualityles has quit [Ping timeout: 256 seconds]
Oladon has joined #commonlisp
<White_Flame> phantomics: CLHS says that "a floating point approximation might result" for anything but (expt <rational> <integer>)
<phantomics> Makes sense, all other CLs give the same result though
theothornhill has joined #commonlisp
Doraemon has joined #commonlisp
NeoCron has quit [Ping timeout: 260 seconds]
<susam> Good morning, #commonlisp!
<beach> Hello susam.
<susam> Hello beach!
<phantomics> Morning susam
lisp123w has left #commonlisp [ERC (IRC client for Emacs 26.3)]
<susam> Hello phantomics!
theothornhill has quit [Ping timeout: 245 seconds]
theothornhill has joined #commonlisp
theothornhill has quit [Ping timeout: 245 seconds]
<jackdaniel> Guest74: I don't understand what I could help you with
aartaka has joined #commonlisp
<jackdaniel> n.b I'm not "a fan of stable things" - most notably I'm not that cool (a pun towards the word "fan"), but changing stable apis breaks existing code - mind that no common lisp implementation changed nth argument order to match elt, even if someone could have thought that it is a good idea :)
<jackdaniel> or that changing the interface of with-output-to-presentation in a non-backward compatible way would break many preexisting clim applications
gaqwas has joined #commonlisp
pok has quit [Ping timeout: 265 seconds]
<beach> jackdaniel: It would be much easier to parse what you wrote if you would capitalize NTH, ELT, API, and CLIM.
<jackdaniel> duly noted, thanks
<beach> "nth argument order" took me quite some time to figure out.
<jackdaniel> yes, I can tell in hindsight that it could be clearer
pok has joined #commonlisp
pok has quit [Changing host]
pok has joined #commonlisp
attila_lendvai has joined #commonlisp
amb007 has quit [Ping timeout: 245 seconds]
amb007 has joined #commonlisp
rain3 has joined #commonlisp
x88x88x has joined #commonlisp
taiju has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
Oladon has quit [Quit: Leaving.]
taiju has quit [Ping timeout: 256 seconds]
pve has joined #commonlisp
x88x88x has quit [Remote host closed the connection]
s-liao has joined #commonlisp
Alfr has quit [Read error: Connection reset by peer]
Alfr has joined #commonlisp
edgar-rft has quit [Quit: Leaving]
nature has joined #commonlisp
shka has joined #commonlisp
theothornhill has joined #commonlisp
theothornhill has quit [Ping timeout: 250 seconds]
theothornhill has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 240 seconds]
Lord_of_Life has joined #commonlisp
theothornhill has quit [Ping timeout: 265 seconds]
x88x88x has joined #commonlisp
mmk2410 has quit [Quit: ZNC - https://znc.in]
mmk2410 has joined #commonlisp
lisp123w has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
s-liao has joined #commonlisp
pok has quit [Ping timeout: 265 seconds]
cosimone has joined #commonlisp
lisp123w has left #commonlisp [ERC (IRC client for Emacs 26.3)]
<pjb> jackdaniel: beach: would I suggest to use instead 𝐧𝐭𝐡, 𝐞𝐥𝐭, 𝐀𝐏𝐈, 𝐂𝐋𝐈𝐌, given the flame you can get when using upper case?
VincentVega has joined #commonlisp
<hayley> pjb: (I AM NOT SHOUTING THANK-YOU VERY MUCH)
dre has quit [Quit: Leaving]
x88x88x has quit [Ping timeout: 256 seconds]
<pjb> hayley: exactly. You're just using a nice typographical feature.
<pjb> But I've been forced to (setf *print-case* :downcase); I'm traumatised!
aartaka has quit [Ping timeout: 265 seconds]
aartaka has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
random-nick has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 265 seconds]
cage has joined #commonlisp
makomo has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
tyson2 has joined #commonlisp
yewscion has joined #commonlisp
yewscion has quit [Remote host closed the connection]
nckx has quit [Ping timeout: 260 seconds]
<pdietz> phantomics: in SBCL, expt will sometimes give different results on the same arguments depending on whether they appear as variables or constants in the form.
s-liao has joined #commonlisp
<pdietz> (expt -1.0d0 1/2) ==> #C(6.123233995736766d-17 1.0d0)
<pdietz> (funcall (lambda (x) (expt x 1/2)) -1.0d0) ==> #C(0.0d0 1.0d0)
VincentV` has joined #commonlisp
VincentVega has quit [Ping timeout: 240 seconds]
yewscion has joined #commonlisp
theothornhill has joined #commonlisp
theothor` has joined #commonlisp
theothornhill has quit [Remote host closed the connection]
theothor` has quit [Remote host closed the connection]
theothornhill has joined #commonlisp
theothornhill has quit [Remote host closed the connection]
theothornhill has joined #commonlisp
kdlv has quit [Quit: The Lounge - https://thelounge.chat]
kdlv has joined #commonlisp
casionaut has joined #commonlisp
cosimone` has joined #commonlisp
cosimone has quit [Ping timeout: 240 seconds]
s-liao has quit [Quit: Client closed]
casionaut has quit [Quit: o7]
casionaut has joined #commonlisp
theothornhill has quit [Ping timeout: 256 seconds]
tyson2 has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 260 seconds]
waleee has joined #commonlisp
varjag has joined #commonlisp
waleee has quit [Ping timeout: 256 seconds]
waleee has joined #commonlisp
AndrewYu has joined #commonlisp
<AndrewYu> Hey there- I'm here to ask: How feasible would it be to create a Lisp dialect that's as powerful as common lisp, but slightly more elegant (like towards Scheme). An example would be cleaning up the eq equal = eql mess. I'm pretty new, so I'm not sure how many of those pragmatic/syntax comprimises there are. I'd appreciate somehow a list of those weird comprimises. Thanks!
casionaut has quit [Quit: o7]
<frgo> AndrewYu: Well. Difficult to answer. I'm quite happy with the "eq equal = eql mess".
<jackdaniel> AndrewYu: equality is a hard problem :) regarding question of how to make something as powerful as common lisp but more elegant (i.e more tailored for your taste), create a separate package that doesn't USE the package CL and define your own abstractions
x88x88x has joined #commonlisp
<jackdaniel> (i.e with only eql function, without equal, eq, = etc)
<frgo> I do have a question myself. Anybody have a readily running c2ffi (from https://github.com/rpav/c2ffi) on macOS Monterey? (I'm having issues with building it on Monterey and, well, yak shaving ...)
<jackdaniel> AndrewYu: this library is a fine example: https://github.com/rongarret/ergolib
<jackdaniel> AndrewYu: if you look for a different lisp somewhere between scheme and common lisp take a look at eulisp, afaik it has around three implementations, perhaps they even build
<phantomics> Interesting, thanks pdietz
x88x88x- has joined #commonlisp
waleee has quit [Ping timeout: 265 seconds]
x88x88x has quit [Ping timeout: 256 seconds]
waleee has joined #commonlisp
Noisytoot has quit [Read error: Connection reset by peer]
igemnace has joined #commonlisp
paule32 has joined #commonlisp
tyson2 has joined #commonlisp
Noisytoot has joined #commonlisp
waleee has quit [Ping timeout: 256 seconds]
waleee has joined #commonlisp
<pjb> AndrewYu: it wouldn't be too difficult: it's already done. It's called ISO Lisp. There are several implementations. http://christian.jullien.free.fr http://www.islisp.org https://github.com/sasagawa888/eisl etc.
<jcowan> "ISLISP" means "IS LISP". There never has been, and by McCarthy's will never will be, a standard or implementation called just "Lisp" (the Scheme community extends that to "Scheme")
<jcowan> s1/will/Will
<jackdaniel> sure there is, I've made a symlink "lisp" to ecl, so it clearly /is lisp/ ;)
Guest74 has quit [Quit: Connection closed]
Guest74 has joined #commonlisp
<jcowan> But that doesn't change the public world. It is no secret that many U.S. diplomats abroad are spies. But for the U.S. Government to announce "Many of our diplomats abroad are spies" would change the public world hugely. See also the jealous husbands who all shoot their wives on day N after a newcomer arrives, where N = number of jealous husbands.
<jackdaniel> return EDOESNTCOMPUTE;
<beach> jcowan: Er, what?
<jcowan> With every day that passes and no wife shot (that never happens without proof), public knowledge grows, and eventually each husband knows that his wife (and all others) have been adulterous, so they are all shot on the same day
waleee has quit [Ping timeout: 265 seconds]
<jackdaniel> I don't understand, but I have a strong suspiction that it is (pick at least one) 1) nonsense, 2) offtopic
<jackdaniel> or no, pick at least two
<beach> AndrewYu: Your premise is wrong. The equality thing is not a mess. It exists pretty much by necessity, as the page by Kent Pitman explains. The fact that you recognize that you are new, should also perhaps indicate that what you consider "weird compromises" may in fact exit for good reasons.
<beach> *exist
<Guest74> @jackdani
<Guest74> :)
<Guest74> I guess you can't.
<Guest74> it seems any time I try and ask questions related to developing a stable api I get no feedback. I guess I might be weird in trying to develop a comfortable stable api first instead of not changing an api so that it remains stable.
<jcowan> https://en.wikipedia.org/wiki/Induction_puzzles doesn't explain this particular puzzles, but the rest on that page are all of the same type.
<beach> Guest74: Is this the IOCTL API still?
<jackdaniel> I'm not sure how many questions and where you have asked but I agree that starting with an API and only after then implementing is not a good idea unless you have specification
<jcowan> You don't know if it's comfortable until you've actually used it.
<Guest74> I'm a big fan of not writing a specification until you have something that works nicely.
<jackdaniel> sounds cool (another "fan" pun)
<Guest74> beach: ioctl, drawing, x11 utils, etc...
<beach> Guest74: I don't recall seeing a suggested API.
lisp123 has joined #commonlisp
<jcowan> I think almost the opposite: write a spec followed by tests and code, and be prepared to change any of them as you go. At the end they should all agree (modulo inevitable bugs).
<jcowan> I always tell someone implementing one of my specs to complain if something is too hard or Just Wrong, because the fault is most likely in the spec.
<Guest74> i would think the first part of writing a spec would be getting feedback from people in the field, as was done with the common lisp spec.
<beach> Guest74: Did you give links to the suggestions you want feedback on?
lisp123 has quit [Ping timeout: 268 seconds]
<jcowan> Sure. Or proxies in the form of existing implementations.
<_death> you start with something instable and use it in diverse contexts, each time changing it to fit while keeping other desiderata.. with such use, it may become more stable.. writing documentation or tests help because these are very different contexts of "use"
<Guest74> that's what I currently do. Trying to clean everything up now.
<beach> Guest74: I don't understand. Do you want feedback on something that has not yet been suggested?
<jcowan> Oh, the puzzle I mentioned *is* on that page with genders reversed as "Josephine's Problem" with full details and the solution. Nuf sed.
<Guest74> beach: what I was talking about yesterday was representation of linux key symbols.
<jackdaniel> that wasn't a very comprehensible proposal now, was it?
<beach> Guest74: I think you need to write down a fairly complete suggestion and then provide a link to it.
<Guest74> it's a representation of a keysym, how much detail do you need???
<beach> Never mind.
<jackdaniel> a good start would be i.e some context :)
<beach> I was going to say that, but decided to drop it.
<Guest74> I guess nobody uses keysyms in linux.
<beach> Context and issues, pros and cons, stuff like that.
<Guest74> keysyms map key codes, what you get from a keyboard, to a printable or non printable symbol, such as TAB or Keypad-1.
kdlv has quit [Quit: The Lounge - https://thelounge.chat]
<Guest74> you use them for binding keypress to functions or to get support for non standard characters.
<Guest74> under linux, they're the same for the console as x11.
makomo has quit [Quit: WeeChat 3.3]
<frgo> Juist for the record: c2ffi problem solved. I now have a running c2ffi on macOS Monterey.
<jackdaniel> frgo: congrats
<jackdaniel> was it a problem in c2ffi?
kdlv has joined #commonlisp
<beach> Guest74: What does CLX do? Is there something wrong with that?
<frgo> It was the fact that Apple decides to move the installation location of Clang and tools around and also that homebrew installs now in /opt/homebrew/... and no more under /usr/local/homebrew/...
<beach> Guest74: Again, you should write things down on a page an provide a link to it. It should contain existing practice like CLX, CLIM, etc. Also several suggestions with comparisons and pros/cons. Otherwise, I am afraid "feedback" is not meaningful.
makomo has joined #commonlisp
<Guest74> beach: it's not ideal, and part of the difficulty in getting better keyboard support in clx.
makomo has quit [Client Quit]
makomo has joined #commonlisp
<jackdaniel> frgo: I see; if I had a penny each time I hear about some issue due to osx changes I'd be able to buy a lollipop :)
<beach> Guest74: I give up. I have given you all the advice I have.
makomo has quit [Client Quit]
makomo has joined #commonlisp
makomo has quit [Client Quit]
makomo has joined #commonlisp
<Guest74> for example, they use keywords for case dependent keysyms and so erroneously have :c_h eql to :C_H
makomo has quit [Client Quit]
makomo has joined #commonlisp
random-nick has quit [Ping timeout: 265 seconds]
random-nick has joined #commonlisp
<frgo> jackdaniel: A ton of them!
<jackdaniel> :)
waleee has joined #commonlisp
x88x88x- has quit [Ping timeout: 265 seconds]
<etimmons> Monterey broke cl-plus-ssl
<frgo> etimmons: In what way?
anddam has quit [Quit: WeeChat 3.3]
<etimmons> Apple decided that loading the unversioned libcrypto or libssl should abort the process. Then, Monterey introduced a change (seeems to be a bug, but who knows with Apple) such that calling dlopen on a non-existent absolute path will result in the OS "helpfully" searching some standard locations to try and find the lib
<frgo> Ah! Hm. - I have my own way of dealing with things like this: Do not assume any "load paths" within a CFFI library definition. This *has* to be decided by the OS. So I always set my DYLD_LIBRARY_PATH accordingly and have no issues like that.
<etimmons> cl-plus-ssl tries to load the library from a bunch of places to deal with macports/homebrew/fink/pick your poison. If the first one it tries doesn't exist, your process is aborted
anddam has joined #commonlisp
waleee has quit [Ping timeout: 240 seconds]
<etimmons> Yeah, it seems like the solution is going to be similar to what you want. cl-plus-ssl will likely try only the system provided libs. If you want anyother version you have to set it up some other way.
<frgo> Using my approach just solves this kind of issue - putting the burden on the application user or a clever script around the application.
<AndrewYu> beach: True. My problem is with the names---it'd be better to name eq something like 'pointer-equal?', instead of random abbreviations, if i'm right
waleee has joined #commonlisp
<AndrewYu> jackdaniel: That's a fine point! Will dig into that today morning (12AM lol)
<AndrewYu> Thanks :D
tyson2 has quit [Remote host closed the connection]
<jackdaniel> AndrewYu: generally you are right, some names may seem obscure, but in practice this is a superficial problem, they are not harder to memorize than pointer-equal
<jackdaniel> t and nil are a different pair of shoes, because each have multitude of meanings depending on the context, so there is no /distinct/ false and true value
<jackdaniel> but they are not very problematic, mostly from the aesthetic point of view
<_death> AndrewYu: these are the names used for decades by Lisp programmers..
<jackdaniel> Guest74: if the character case is the issue, you could represent them as keywords that have preserved case
<jackdaniel> :|C-h| vs :|C-H}
<jackdaniel> s/}/|/
waleee has quit [Ping timeout: 260 seconds]
<Guest74> which is what my whole question was about, having inconsistency in some symbols having pipes and others not, or going to long form
<_death> Guest74: what does "symbols having pipes" mean?.. the name of the symbol :|C-h| is "C-h"
<_death> you could write :C-\h instead
<jackdaniel> oh, I didn't know I could!
<jackdaniel> cool :)
<AndrewYu> jackdaniel: I just really hate comprimises that seem to be avoidable
<Guest74> _death: then you have to write \ in front of everything.
Oladon has joined #commonlisp
* AndrewYu doesn't appeal to history, _death
<_death> AndrewYu: Common Lisp is a compromise reached by various entities in the 1990s.. if you don't want compromises, write AndrewYuLisp
<AndrewYu> I mean, yeah, people used DOS and Windows since long ago, OpenBSD and Linux only existed since the 1995s/1990s. SO switch to Windows... nah. But you're kinda right
<AndrewYu> lol, that might happen when i get more familiar with the place
<jackdaniel> AndrewYu: it is not really a compromise, it is pragmatism
<AndrewYu> sounds similar to me :)
<jackdaniel> I hope that one day you will fix your hearing
<random-nick> whoops
<Guest74> _death: greek-\i\o\t\a doesn't seem like a good compromise.
<_death> Guest74: so use strings
<_death> Guest74: if you want symbol like properties, you can define an "atom" abstraction
<Guest74> strings could work, you lose eq though.
<beach> AndrewYu: As _death pointed out, these are very old conventions. Are you trying to make Lisp more attractive to newbies who don't know these conventions? I am afraid what you are suggesting then won't work. EQ is not one of the reasons Common Lisp is not more widely used.
<jackdaniel> then use :|greek-iota| if you don't like backslashes
<Guest74> which is what my question was about.
<_death> Guest74: you could also use try readtable-case, modern mode, writing your own reader, etc. I'm not sure what will satisfy you
<Guest74> which is what my whole question was about, having inconsistency in some symbols having pipes and others not, or going to long form
<_death> you should also know that :C-|iota| is the same as :|C-iota| given the default readtable case
<_death> || is just escaping syntax
<AndrewYu> I'll be back in around, ugh, 18 hours... sorry though
<jackdaniel> Guest74: just as _death said, || is not part of the symbol name, so it does not introduce an inconsistency
<jackdaniel> depending on the readtable-case you may be forced to write |EQ| if you want to use this /terrible terrible/ symbol name :)
<phantomics> AndrewYu: have you seen http://cl21.org/? A project to "modernize" CL
<beach> Please, no.
<jackdaniel> well, is it modernized yet? I can't wait to jump the drain ,)
<AndrewYu> Scheme looks more appealing to me in that resp- why am I still awake
* AndrewYu sends SIGSEGV to his brain
<beach> AndrewYu: That's fine, but then you are in the wrong channel.
<Guest74> it is inconsistent as in you have to type it. If you want to use autocomplete to see all greek symbols you can't.
<Guest74> but then again, doesn't seem anybody has a problem with that.
<_death> Guest74: that's a bug in autocomplete
<_death> try (apropos "GREEK-") instead
<Guest74> which probably nobody will fix until judgment day.
<phantomics> In terms of improvements to CL, I might like to see some functions that do similar things condensed into a single function that takes options to work in different ways
<_death> Guest74: you could be the one to fix it.. I'm won't be surprised if it takes <10m
<Guest74> apropos doesn't help when you're typing. Already have a function to display all keysyms in a language set.
<Guest74> I don't know elisp or the emacs system.
<_death> luckily elisp is a lisp, like CL is a lisp
<_death> if you want to move just a bit to the right in the complain-fix scale, I guess there's submitting an issue
sheb has joined #commonlisp
<_death> anyway, maybe it's not a good day for irc ;).. later
<jackdaniel> see you
<beach> phantomics: Common Lisp is not going to change. And such changes would not necessarily be possible to reach consensus with anyway. Do you have an example of what you mean?
Inline has quit [Ping timeout: 268 seconds]
<jackdaniel> well, it changed a few times already. i.e defpackage local nicknames extension, but this is a backward-compatible change
<jackdaniel> (not part of the standard, but it could be considered a consensus)
<dbotton> jackdaniel except I backed out local nicknames from my project since LW doesn't support it
<beach> I think they said it will.
<dbotton> so consensus even when there takes a snails pace
<dbotton> you is in some future build but I recall that was the case a year ago
<beach> And that's a good thing.
<beach> It avoids hasty decisions that we may regret later.
<jackdaniel> it must be said that phoe was very active in the area of prompting people to implement this api back when only sbcl, abcl and ecl had it
<jackdaniel> (and he implemented himself the extension for ccl)
<dbotton> I think an a very good thing even if I am only using CL for less than a year
<dbotton> I like the idea that CL's ability to extend itself "good enough"
<dbotton> (sorry for typos)
<phantomics> beach: For instance, condensing eq, eql, equalp etc. into one function that takes a third parameter to determine the type of comparison
<Guest74> ew, break all the :test functions
<Guest74> Does the amount of symbols in the keyword package present any problems the larger it gets? mines already over 5000
<phantomics> At that level it shouldn't be a problem, but really large numbers of keywords can be a problem
<phantomics> There are DOS attacks involving JSON libraries like Jonathan that create keywords for JSON keys, you can exhaust the heap by sending a service like this big JSON strings with thousands or millions of different keys
<engblom> Is it somehow possible to create a macro inside of function, in the same way as you can with label define functions inside of a function?
<phantomics> engblom: Yes, with (macrolet)
<engblom> phantomics: Thanks!
* engblom is still trying to figure out how to make a recursive setf so that (rsetf some-plist 1 'one :b) would set change some-plist from ('one (:a 2 :b 1) 'two (:a 3 :b 4)) into ('one (:a 1 :b 1) 'two (:a 3 :b 4)).
* engblom is still trying to figure out how to make a recursive setf so that (rsetf some-plist 1 'one :a) would set change some-plist from ('one (:a 2 :b 1) 'two (:a 3 :b 4)) into ('one (:a 1 :b 1) 'two (:a 3 :b 4)).
<engblom> rsetf (recursive-plist value &rest indicators)
<phantomics> If the structure you're changing will only ever by a plist, you can write a macro that builds (setf (getf (getf plist 'one) :b) X)
<phantomics> (defun build-form (value keys &optional output) (if (not keys) `(setf ,output ,value) (build-form value (rest keys) `(getf ,output (first keys)))))
<phantomics> That's more or less how you do it, you pass the key path in as the second arg to that function, and the name of the list i.e. some-plist as the third arg
<phantomics> (defun build-form (value keys &optional output) (if (not keys) `(setf ,output ,value) (build-form value (rest keys) `(getf ,output ,(first keys)))))
<phantomics> corrected
paule32 has quit [Remote host closed the connection]
paule32 has joined #commonlisp
<engblom> phantomics: They will always be plists but of different depts. Some might be only two levels, some 3 or more levels.
<phantomics> Then that function will build the nested (getf) you need, it works recursively with any number of keys
notzmv has quit [Ping timeout: 268 seconds]
<engblom> Thanks!
Algernon69 has joined #commonlisp
Lycurgus has joined #commonlisp
qhong has joined #commonlisp
Lycurgus has quit [Quit: Exeunt]
lisp123 has joined #commonlisp
<lisp123> phantomics: in general, imo its better to have keyword arguments
<phantomics> keyword arguments for what?
<Guest74> so I've noticed some problems with pipes, or vertical bars, when typing at the repl. If you make a mistake while typing you're screwed because of 'unbalanced parantheses'. Is this a paredit only thing, or does it happen with other modes that provide the same functionality.
<lisp123> (like :test). Also equal DOES mean a lot of different things - is it the same object? is it an 'equivalent' object, is something based on a particular criteria for equality
<engblom> phantomics: I rewrote it into a macro so I do not need to quote stuff in the function call. I now have this https://pastebin.com/1pzn6EzE
<lisp123> phantomics: re a third parameter for equal as one function
<engblom> phantomics: Even thou macroexpand-1 shows a correct form, it complains that the plist I pass to it is undefined.
<engblom> What could be wrong?
<lisp123> Guest74: bind 'paredit-mode' to a hotkey so that you can quickly switch between paredit mode on and paredit mode off
<engblom> Oh, now I noticed where my mistake is, I still have build-form even thou the macro got another name
<Guest74> It happens in paredit, i'm wondering if it happens in other modes that provide the same functionality.
<Guest74> I don't remember what any of those packages are called, but i'm guessing somebody here must use something besides paredit.
<lisp123> I don't find any of the other ones as good as paredit to be honest (tried them a few times)
<lisp123> Google search is your friend
<phantomics> Hi engblom, it appears this macro is supposed to work recursively but macros don't work like that, functions do
edgar-rft has joined #commonlisp
<phantomics> You want to use the recursive function inside the macro, use (labels) to set up the recursive function within the macro
<engblom> phantomics: Okay, I will try that!
<hobo> White_Flame: sorry for the late response, but yes, I remember telnetting into Valheru MUD from my high school's windows box in the library that only had telnet on it.
Inline has joined #commonlisp
<hobo> That said, it's very likely I'm mistaken.
<Guest74> oh well, can't even figure out where to report a bug.
cosimone` has quit [Ping timeout: 265 seconds]
<lisp123> Paredit? Good luck contacting the author, he is a mysterious legend. Here is his website: https://mumble.net/~campbell/
<Guest74> yeah, it's where the git is stored with no way to raise issues
<lisp123> It's like god, he gives you the bible / religious document of [insert language], but doesn't want to deal with mortals raising issues ;)
<hobo> White_Flame: logged onto valheru for the first time in 8 years :P
<lisp123> I tried contacting him one to no luck. You probably have a better chance of forking the repo and adjusting it to your needs
<hobo> just now*
<hobo> and it turns out I was mistaken. It actually enters a CRLF, writes message, and then rewrites the prompt.
<Guest74> I'm not concerned about my needs, i'm concerned how my stuff works on everybody elses machine.
<lisp123> Then you should definitely fork it, amend it to your requirements and include that as part of your delivery mechanism
<Guest74> at least I've determined constants over keywords.
<Guest74> I do not think bundling emacs stuff with a common lisp library is a good thing.
<lisp123> that's why you should learn (Mc)CLIM
<Guest74> no thank you.
<Guest74> which uses the same broken model as clx.
<lisp123> *shrugs* good luck
Guest74 has quit [Quit: Connection closed]
Algernon69 has quit [Ping timeout: 265 seconds]
<White_Flame> hobo: huh, that's an interesting compromise, but it would break the input-buffering clients like mudlet or tf
<White_Flame> unless the server detects telnet vs not
lisp123 has quit [Ping timeout: 256 seconds]
theothornhill has joined #commonlisp
<engblom> Is it somehow possible to use strings as keys in property lists?
<engblom> If I have something like ("a" (:A 1 :B 2) "b" (:A 3 :B 4)) I get nothing with (getf my-plist "a")
<rain3> engblom why not use :|keyWoRDS| ?
<White_Flame> alists are more flexible
<White_Flame> at least in terms of support functions
<engblom> rain3: The key will actually be a string that I will have to use. Keywords are converted to upper case.
<rain3> engblom: use | |
<rain3> (let ((my-plist '(:|a| "a's value" :|A| "A's value")))
<rain3> (list (getf my-plist :|a|) (getf my-plist :|A|)))
<White_Flame> there is reader conversion, but (intern "FooBar" (find-package "KEYWORD")) => :|FooBar|
<rain3> ;=> ("a's value" "A's value")
<White_Flame> however, that means that you'll also need to search the plist with an interned symbol, too
ec has joined #commonlisp
aartaka has quit [Ping timeout: 265 seconds]
aartaka has joined #commonlisp
<engblom> White_Flame: And how would I convert the other way, from keyword to string?
<White_Flame> symbol-name
<White_Flame> which is just a field accessor of the symbol
<rain3> 3(string :|keyWORD|)
<White_Flame> but, if it makes more sense to keep things strings, then use alists instead of plists
<engblom> This is the beginning of one of the plists I have: https://pastebin.com/JsN5Wqmv
ec has quit [Ping timeout: 276 seconds]
<engblom> White_Flame: Does it make sense to make this an alist?
ec has joined #commonlisp
tyson2 has joined #commonlisp
<engblom> It was for plists like this I needed to write the recursive forms of getf/setf.
waleee has joined #commonlisp
<White_Flame> alists allow you to use :key, :test, etc
<White_Flame> and it's easier to use plain list operators on alists than plists, because on alists there's a 1:1 correspondence between list entries and alist mappings. With plists it's 2:1 and can get funky
<White_Flame> depending onthe size of your tables, you might want to consider hashtables as well
<engblom> White_Flame: Is it possible to nest alists, like I have done in the pasted example? Or would you keep the inner list as a plist?
<White_Flame> plists are legacy
<White_Flame> but key=>value is just data. the outer container doesn't care what's inside the value slots
<White_Flame> however, I think the one advantage that plists have is that you can (setf (getf ...) ..), which I don't think you can do as simply with alists
<White_Flame> but can do as easily with hashtables
<engblom> White_Flame: The lists will be around 100 pairs long, so hastables are probably overkill. Besides, the lists are actually are actually handwritten in a configuration file and then read in by read-from-file
<White_Flame> that handwritten form doesn't need to be the canonical format at runtime, though. You can read it in as an easy-to-hand-edit list, and then store it in another format, too
<White_Flame> optimize the former for editing, and the latter for runtime access
<engblom> doplist from alexandria seems to be able to loop over a plist with string keys, so it should be easy to convert it to a hash table by inserting each key and value.
<engblom> Or would there be a better way to convert this plist to a hash table?
<engblom> Clojure has this nice syntax for hash maps: {:key1 1, :key2 2}. Is there something similar I could directly read in from a file with common lisp?
<yitzi> engblom there are hash-table to plist conversion functions in Alexandria.
<yitzi> There are also various packages which define a reader macro character for hash tables. Or you could just define your own.
etiago has quit [Ping timeout: 256 seconds]
etiago has joined #commonlisp
cosimone has joined #commonlisp
etiago has quit [Ping timeout: 265 seconds]
etiago has joined #commonlisp
<borodust> Xach: about bodge-host: did you nuke only bodge-host cache or everything?
<borodust> i've updated bodge-host stable tag to latest commit
<borodust> hopefully, that won't break anything
etiago has quit [Ping timeout: 245 seconds]
etiago has joined #commonlisp
shka has quit [Ping timeout: 265 seconds]
paule32 has quit [Quit: Leaving]
danieli has quit [Quit: Alpine Linux, the security-oriented, lightweight Linux distribution]
danieli has joined #commonlisp
notzmv has joined #commonlisp
waleee has quit [Ping timeout: 265 seconds]
rain3 has quit [Ping timeout: 265 seconds]
waleee has joined #commonlisp
Guest74 has joined #commonlisp
ec has quit [Remote host closed the connection]
nckx has joined #commonlisp
cjb has joined #commonlisp
esb has joined #commonlisp
attila_lendvai has quit [Remote host closed the connection]
esb is now known as parjanya
cage has quit [Quit: rcirc on GNU Emacs 27.1]
attila_lendvai has joined #commonlisp
parjanya has left #commonlisp [Using Circe, the loveliest of all IRC clients]
attila_lendvai has quit [Ping timeout: 265 seconds]
x88x88x has joined #commonlisp
nature has quit [Ping timeout: 265 seconds]
dre has joined #commonlisp
Algernon69 has joined #commonlisp
<pjb> engblom: I already explained to you that you that plists used only EQL to compare the keys!
<pjb> engblom: (let* ((plist '("a" (:A 1 :B 2) "b" (:A 3 :B 4))) (keys (loop for (k) on plist by 'cddr collect k))) (loop for k in keys collect (getf plist k))) #| --> ((:a 1 :b 2) (:a 3 :b 4)) |#
<pjb> engblom: but (eql "a" "a") #| --> nil |#
<pjb> engblom: (let ((k "a")) (eql k k)) #| --> t |#
<pjb> engblom: err, sorry, not eql, but EQ.
<pjb> (eql "a" "a") #| --> nil |# (let ((k "a")) (eql k k)) #| --> t |#
Algernon69 has quit [Ping timeout: 265 seconds]
<pjb> (eq "a" "a") #| --> nil |# (let ((k "a")) (eq k k)) #| --> t |#
<pjb> but note that (let ((k 42)) (eq k k)) may return nil or t depending on the implementatioin!
<pjb> so while you can find the actual string used as keys, and find them with get or getf (they use EQ to compare the keys), if the keys are numbers, you can't even be sure to be able to retrieve them!
<pjb> engblom: if you want to be able to specify the test function, then use a-lists! assoc and rassoc take a :test argument!
<pjb> engblom: or a hash-table, with :test 'equal or 'equalp.
akoana has joined #commonlisp
dra has joined #commonlisp
Doraemon has quit [Quit: Leaving]
ec has joined #commonlisp
NeoCron has joined #commonlisp
aartaka has quit [Ping timeout: 265 seconds]
<engblom> pjb: I think hash table will be the best solution as then I only once need to specify the test function and the code will be easier to read.
varjag has quit [Ping timeout: 250 seconds]
<pjb> engblom: but equal or equalp are very coarse. Good for strings, but for other keys (eg. vectors or arrays), you may want a more specific test.
Guest74 has quit [Quit: Connection closed]
tyson2 has quit [Remote host closed the connection]
<engblom> pjb: As alexandria:plist-has-table does not recurse into the lists deeper in, it is not a problem. All the first level keys will be strings.
<engblom> plist-hash-table I meant to write
dra has quit [Remote host closed the connection]
scymtym_ has quit [Ping timeout: 265 seconds]
kevingal has joined #commonlisp
scymtym has joined #commonlisp
theothornhill has quit [Ping timeout: 245 seconds]
slyrus has quit [Quit: Leaving]
ec has quit [Ping timeout: 276 seconds]
Inline has quit [Remote host closed the connection]
NeoCron has quit [Quit: Leaving]
taiju has joined #commonlisp
gaqwas has quit [Ping timeout: 256 seconds]
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
tyson2 has joined #commonlisp
kdlv has quit [Ping timeout: 265 seconds]
jeosol has quit [Remote host closed the connection]
theothornhill has joined #commonlisp
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
theothornhill has quit [Ping timeout: 265 seconds]
scymtym_ has joined #commonlisp
scymtym has quit [Ping timeout: 256 seconds]
yewscion has quit [Ping timeout: 256 seconds]
igemnace has quit [Remote host closed the connection]
Guest74 has joined #commonlisp
gaqwas has joined #commonlisp
kevingal has quit [Remote host closed the connection]
VincentV` has quit [Remote host closed the connection]