libera/#commonlisp - IRC Chatlog
Search
7:49:56
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 :)
7:51:03
jackdaniel
or that changing the interface of with-output-to-presentation in a non-backward compatible way would break many preexisting clim applications
8:06:03
beach
jackdaniel: It would be much easier to parse what you wrote if you would capitalize NTH, ELT, API, and CLIM.
11:25:08
pjb
jackdaniel: beach: would I suggest to use instead 𝐧𝐭𝐡, 𝐞𝐥𝐭, 𝐀𝐏𝐈, 𝐂𝐋𝐈𝐌, given the flame you can get when using upper case?
13:16:29
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.
15:10:45
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!
15:13:36
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
15:14:48
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 ...)
15:15:45
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
15:45:40
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.
15:49:25
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")
15:53:54
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.
15:57:30
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
15:58:13
jackdaniel
I don't understand, but I have a strong suspiction that it is (pick at least one) 1) nonsense, 2) offtopic
16:00:38
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.
16:04:26
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.
16:05:01
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.
16:05:37
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
16:06:07
Guest74
I'm a big fan of not writing a specification until you have something that works nicely.
16:07:41
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).
16:09:04
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.
16:10:46
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.
16:13:49
_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"
16:15:30
beach
Guest74: I don't understand. Do you want feedback on something that has not yet been suggested?
16:16:01
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.
16:18:14
beach
Guest74: I think you need to write down a fairly complete suggestion and then provide a link to it.
16:22:36
Guest74
keysyms map key codes, what you get from a keyboard, to a printable or non printable symbol, such as TAB or Keypad-1.
16:23:18
Guest74
you use them for binding keypress to functions or to get support for non standard characters.
16:23:51
frgo
Juist for the record: c2ffi problem solved. I now have a running c2ffi on macOS Monterey.
16:25:17
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/...
16:26:25
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.
16:27:18
Guest74
beach: it's not ideal, and part of the difficulty in getting better keyboard support in clx.
16:27:53
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 :)
16:30:18
Guest74
for example, they use keywords for case dependent keysyms and so erroneously have :c_h eql to :C_H
16:37:38
etimmons
<https://github.com/cl-plus-ssl/cl-plus-ssl/issues/138> and the later comments on <https://github.com/cl-plus-ssl/cl-plus-ssl/issues/114>
16:39:57
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
16:41:23
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.
16:41:51
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
16:43:03
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.
16:43:31
frgo
Using my approach just solves this kind of issue - putting the burden on the application user or a clever script around the application.
16:45:21
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
16:47:00
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
16:47:59
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
16:50:16
jackdaniel
Guest74: if the character case is the issue, you could represent them as keywords that have preserved case
16:53:15
Guest74
which is what my whole question was about, having inconsistency in some symbols having pipes and others not, or going to long form
16:53:43
_death
Guest74: what does "symbols having pipes" mean?.. the name of the symbol :|C-h| is "C-h"
16:56:23
_death
AndrewYu: Common Lisp is a compromise reached by various entities in the 1990s.. if you don't want compromises, write AndrewYuLisp
16:56:30
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
16:57:57
random-nick
https://libera.ems.host/_matrix/media/r0/download/matrix.org/lOcqjVoqhLPYRUmpdZgtsZLt/Screenshot%20from%202021-11-28%2009-47-28.png
17:00:44
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.
17:01:30
_death
Guest74: you could also use try readtable-case, modern mode, writing your own reader, etc. I'm not sure what will satisfy you
17:02:25
Guest74
which is what my whole question was about, having inconsistency in some symbols having pipes and others not, or going to long form
17:03:01
_death
you should also know that :C-|iota| is the same as :|C-iota| given the default readtable case
17:05:23
jackdaniel
Guest74: just as _death said, || is not part of the symbol name, so it does not introduce an inconsistency
17:06:02
jackdaniel
depending on the readtable-case you may be forced to write |EQ| if you want to use this /terrible terrible/ symbol name :)
17:09:56
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.
17:13:45
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
17:13:59
Guest74
apropos doesn't help when you're typing. Already have a function to display all keysyms in a language set.
17:16:06
_death
if you want to move just a bit to the right in the complain-fix scale, I guess there's submitting an issue
17:19:50
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?
17:21:08
jackdaniel
well, it changed a few times already. i.e defpackage local nicknames extension, but this is a backward-compatible change
17:22:44
dbotton
jackdaniel except I backed out local nicknames from my project since LW doesn't support it
17:24:35
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
17:34:01
phantomics
beach: For instance, condensing eq, eql, equalp etc. into one function that takes a third parameter to determine the type of comparison
17:35:36
Guest74
Does the amount of symbols in the keyword package present any problems the larger it gets? mines already over 5000
17:36:08
phantomics
At that level it shouldn't be a problem, but really large numbers of keywords can be a problem
17:37:22
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
17:37:24
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?
17:41:09
engblom
ACTION 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)).
17:41:30
engblom
ACTION 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)).
17:59:18
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)
18:01:41
phantomics
(defun build-form (value keys &optional output) (if (not keys) `(setf ,output ,value) (build-form value (rest keys) `(getf ,output (first keys)))))
18:02:17
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
18:02:41
phantomics
(defun build-form (value keys &optional output) (if (not keys) `(setf ,output ,value) (build-form value (rest keys) `(getf ,output ,(first keys)))))
18:09:51
engblom
phantomics: They will always be plists but of different depts. Some might be only two levels, some 3 or more levels.
18:10:27
phantomics
Then that function will build the nested (getf) you need, it works recursively with any number of keys
18:45:58
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.
18:46:07
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
18:46:17
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
18:47:08
engblom
phantomics: Even thou macroexpand-1 shows a correct form, it complains that the plist I pass to it is undefined.
18:47:32
lisp123
Guest74: bind 'paredit-mode' to a hotkey so that you can quickly switch between paredit mode on and paredit mode off
18:48:10
engblom
Oh, now I noticed where my mistake is, I still have build-form even thou the macro got another name
18:48:21
Guest74
It happens in paredit, i'm wondering if it happens in other modes that provide the same functionality.
18:49:38
Guest74
I don't remember what any of those packages are called, but i'm guessing somebody here must use something besides paredit.
18:50:38
lisp123
I don't find any of the other ones as good as paredit to be honest (tried them a few times)
18:52:05
phantomics
Hi engblom, it appears this macro is supposed to work recursively but macros don't work like that, functions do
18:52:40
phantomics
You want to use the recursive function inside the macro, use (labels) to set up the recursive function within the macro
18:53:06
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.
18:55:03
lisp123
Paredit? Good luck contacting the author, he is a mysterious legend. Here is his website: https://mumble.net/~campbell/
18:56:39
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 ;)
18:57:22
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
18:58:28
hobo
and it turns out I was mistaken. It actually enters a CRLF, writes message, and then rewrites the prompt.
18:58:35
Guest74
I'm not concerned about my needs, i'm concerned how my stuff works on everybody elses machine.
18:59:27
lisp123
Then you should definitely fork it, amend it to your requirements and include that as part of your delivery mechanism
19:05:43
White_Flame
hobo: huh, that's an interesting compromise, but it would break the input-buffering clients like mudlet or tf