freenode/#lisp - IRC Chatlog
Search
19:06:52
Xach
cgay: i think for open source lisp stuff it is pretty common, but not so common for lispworks and allegro users
19:12:12
sjl_
https://github.com/informatimago/lisp/blob/master/common-lisp/com.informatimago.common-lisp.asd#L40
19:14:40
fouric
cgay: well, you said something about "stealing" ideas, and that you weren't doing anything in lisp
19:14:50
anamorphic
group-by https://paste.ofcode.org/d4YZ6HVGWBzd5ApXMmFiDa Probably a bad name, though that's what Clojure calls it (I think)
19:15:16
sjl_
Just to be clear: quickdocs is just a random site that programatically generates documentation for everything in quicklisp, it's not maintained by the same people (person) as quicklisp, doesn't have a way to customize/redirect what gets shown, etc.
19:16:09
sjl_
anamorphic: might be worth letting it take a :test arg to speficy the test of the resulting hashtable
19:18:06
Xach
cgay: That doesn't seem too likely, but it's possible. I never seriously looked into Dylan. For a while I worked with Andrew Shalit and he of course is one of the authors of the reference manual.
19:19:24
cgay
I can link you. :) But I'm not giving you one of my precious copies unless you do some Dylan work.
19:19:25
Xach
I have nothing against dylan but don't want to discuss it in #lisp - there is sometimes a tendency of people working on their own language or language tools to come here and discuss their own things and only thinly disguise it as CL discussion. or not even attempt the disguise...
19:20:31
Xach
7 ago today nikodemus and I and a few others were in a late night chip shop in amsterdam trying to think of a name for a new project, and settled on sharplispers
20:22:17
phoe
Of all the people mentioned on https://common-lisp.net/project/alexandria/ I only know beach. And Attila, but I haven't seen him around for a while.
20:52:55
pjb
cgay: phoe: yes, currently it's not in quicklisp, because new sbcl releases detect compilation errors in it, and I'm not paid by sbcl to update my software each time they issue new releases. I'm not against correct it, but it takes time that I don't have.
21:02:57
aeth
phoe: That looks to me like the Gitlab syntax highlighting mistakes, where it will highlight types like that no matter where they appear.
21:03:41
aeth
Of course, CL is a Lisp-2 and types, like functions and variables, are one of those 2 namespaces, so you're free to use type names wherever.
21:04:26
aeth
oni-on-ion: It's the exact same issue in Gitlab syntax highlighting (which appears to be done through a rubygem)
21:05:06
oni-on-ion
i would think github had things for collab/social editing, like edit right in page and submit pull/issue
21:05:34
aeth
oni-on-ion: I'm talking about e.g. the variable "type" here: https://gitlab.com/zombie-raptor/zombie-raptor/blob/e88adefb0f14976ef30ee598c5ea81afe738b3c8/data/generate-glsl.lisp#L91-97
21:06:42
aeth
oni-on-ion: You can replace the hash with "master" and it will work for now, it just won't be permanent
21:08:28
aeth
Anyway, the proper way to write in a Lisp-2 is to use the Lisp-2ness of it. A variable of type symbol should be called symbol if there's only one. (So glsl-name a few lines down is probably a better example of this.)
21:09:06
aeth
But people who write syntax highlighting probably are using Foo-1s where Foo is their language family
21:10:02
aeth
I wouldn't be surprised if it also highlights if/let/etc. incorrectly when using that as a variable (could happen in macros)
21:11:22
slightlycyborg
Hello. I setf *standard-output* but it keeps getting reset to swank. What gives?
21:11:29
aeth
Basically, it takes keyword arguments in the name if there are any, so (define-function (foo :inline t) ...) instead of (declaim (inline foo)) (defun foo ...)
21:11:52
aeth
And it combines the type declarations in with the lambda-list in a very similar way to the classes in defmethod (the main difference is it supports keyword and optional, but defmethod does not)
21:12:48
aeth
oni-on-ion: It uses keywords because it's basically a destructuring-bind with a &key. (Not quite that because it has to handle the case of (define-function foo ...) as well as (define-function (foo ...) ...))
21:13:26
aeth
If I didn't support the flat version, I could just put the keywords in the macro lambda-list directly.
21:18:01
oni-on-ion
i dont fully quite understand yet why i dont like keywords, actively figuring this out
21:40:51
sebboh
function all-maxed returns T or nil. It's the answer to the question "are all these maxed out?" Do I named it all-maxed-p or all-maxedp ?
21:43:00
sebboh
I figured it would come down to feelings. :) I invite further feedback. yeah I like -p over p. But listp...
21:43:33
aeth
oni-on-ion: If you consistently write foo-p then there's no issue with foo-bar-p vs. foo-barp
21:44:27
aeth
sebboh: the standard in the standard is to have foop if it's one word and foo-bar-p if it's two words, with some rare edge cases where the prefix modifies it in such a way that foo-barp makes more sense
21:45:43
aeth
But... if you consistently use "-p" even for one word you never have to think about the edge cases.
21:46:59
oni-on-ion
also, https://stackoverflow.com/questions/15640953/why-does-the-predicate-naming-convention-differ-between-different-functions
21:47:55
aeth
sebboh: but a minority style (and it's probably 60/40 so only a slight minority) that simplifies all of this is to consistently write "foo-p". Then everything ends in "-p" and there are no edge cases.
21:48:06
sebboh
I fear clicking those links because I am happy with all-maxed-p. ...damn, how many minutes have I been picking the name? I should have wrote the defun while I had it in mind and named it afterwards.
21:48:38
oni-on-ion
the main answer is basically as aeth says, if its one word than P, if its multi than -P
21:50:36
aeth
Personally I use "foo?" most of the time and "foo-p" almost every other time. The most recent "foop" I wrote was actually the edge case I was talking about, three-zerop, which is just (defun three-zerop (a b c) (and (zerop a) (zerop b) (zerop c)))
21:52:08
aeth
If I'm trying to be very idiomatic I'll use "-p" consistently, even for "foo-p" and if I'm already writing code people will complain about (e.g. using define-function) I'll just go ahead and use foo? most of the time. I use foo? in variable names that hold booleans even in idiomatic code.
21:53:20
aeth
I also tend to consistently use define-foo instead of the deffoo/define-foo-bar divide that the standard usually (but not entirely, see define-condition) uses.
21:54:09
cgay
I've always liked the -p convention better than the ? convention because occasionally I want to have a verbal conversation about some code and saying foo-pee is clearer than saying "foo" with question intonation. I freely admit this is not a strong argument.
21:54:10
aeth
Consider the case of syntax highlighters. (foo-p 1 2) and (foo? 1 2) could highlight the function names if you chose to do so for some reason. (foop 1 2) cannot be highlighted unless it's a known special case, so that would only happen to a big list of predicates in the package CL
21:54:46
cgay
I guess I could say "foo-q" though. Is saying "foo-q" a thing in the Scheme community? :)
22:03:38
cgay
English questions are basically mandarin second tone. I just don't think it works very well verbally.
22:04:27
cgay
But since I've never been ensconsed in the Scheme community and there basically is no Dylan community it's mostly a problem I made up in my head.
1:05:20
didi
I recently needed to format integers with `\,' as a separator of groups of digits (for latex). If you find it useful, the monstrosity I wrote is at https://paste.debian.net/hidden/a17da2fe
1:13:00
jcowan
challenge for a formatter: correctly commatize large numbers in Indian style, where 1 crore = 10^7 is written 1,00,00,000
1:19:51
sebboh
What is happening here? Why is 'picks' changing between the top and the bottom of this defun? Is it because I am using pop, which is destructive? ... But I'm not using it on 'picks', I'm using it on temp... https://paste.debian.net/1048712/ ??
1:22:33
sebboh
jcowan: knowing nothing of the history of that number format, I don't like it. I hope this isn't culturally insensitive. Note I'm not worried about it being *perceived* as culturally insensitive, I'm hoping that it isn't *actually* ibid of me, 'cause.. I'm not going to start liking that number format just because. :/
1:25:57
sebboh
Bike, ok, I tried this: https://paste.debian.net/1048714/ .. but picks is still destroyed. This is some by-reference vs by-value thing, right? how do I make a 'copy' of my list?
1:27:08
sebboh
May I make an actual copy of the list? Or are lists like strings in java--there's only one of each. ?
1:28:25
sebboh
ok, I will try reverse, but I fear that if my code worked (for the print part) when I was destroying my list unknowingly, I probably don't understand the code and it works accidentally.. :/
1:30:15
jcowan
sebboh: Western commas reflect Western number names: thousand, million, billion, .... Indian commas reflect Indian number names: thousand, lakh, crore, ...
1:31:30
sebboh
I am enumerating a set of thing, proceeding through all the possible combinations of the thing in an orderly fashion, assigning a numeric index to each. From that I'll 'do it backwards', then I'll have a function that returns the nth thing for any given integer over some range.
1:34:15
Bike
it takes a list of numbers and a number. it pops the end of the list, and if it's less than the max, adds one to it, puts it back, and recurses. otherwise it returns the element with the end popped.
1:35:21
jcowan
So if you have 67890000000000, which is "sixty-seven trillion eight hundred and ninety billion", then the easiest way to see that right off is to punctuate it 67,890,000,000,000. But if you are reading it as "sixty-seven lakh, eighty-nine thousand crore", then it makes more sense to punctuate it as 67,89,000,00,00,000.
1:36:25
sebboh
Bike, I think the thing I'm doing is a thing that is commonly done but maybe I don't know how to describe it. I could easily draw a picture. run the function with '(1 2 3) 10 as arguments, and you'll see it print 1 2 3, 1 2 4, 1 2 5, 1 2 6, ... 1 2 10. Another function increments the 2 to 3 and sets the last number to 4, so this one can then produce 1 3 4, 1 3 5, 1 3 6, etc. In this way, I cover the whole
1:39:23
Bike
so it prints all 3-long combinations of integers between 1 and 10, and prints each combination as smallest to largest?
1:43:51
sebboh
that would never be passed by the driver program. 'Cause, it would pass 2 5 6, then 2 6 7. 2 5 7 is one of the outputs of this function... only certain values are inputs, because this function only increments the last number.. another function increments the second to last number. I'm working on getting it to 'walk' down the whole list.
1:48:21
sebboh
What about when I pass 4 10, under your suggestion? that could be 1 2 4 or 1 3 4 or 2 3 4.
1:49:48
sebboh
oh, you're thinking about the driver program. yeah, I just pass it 3 10. It builds a list of three members ( 1 2 3) and moves up from there. The function I pasted is just one. I'd paste the whole thing but like, I think it's time for me to get back to work on it instead. :)
1:50:32
sebboh
no, 1 2 3 4 isn't a valid member of the set that includes 1 2 3. The number of members is a thing.
1:51:23
sebboh
yeah, yeah. you got it. ok I promise I'll pastebin the whole thing when I'm done or when I quit, whichever comes first.
1:51:35
Bike
(loop for i from 1 to 10 do (loop for j from i to 10 do (loop for k from j to 10 do (print (list i j k))))) is how i'd write it for 3 specifically
1:54:37
sebboh
so like I'd .. call it, and my break-out-of-recurse is just (if (< 0 n) and my call recurse is just passes (- n 1), so it only goes n deep. Pardon my off by one, but I think I get it.
1:59:10
sebboh
Somewhere in the back of my head my junior highschool math teacher is scowling at me. I think there is a straigh-up algebraic solution to this, but I'm not sure how to approach it. I figure if I run the enumberation a bit and look at the output maybe it will come to me.
2:02:03
Bike
yeah, i'm sure. it's just annoying because you can't just have the 389th element be 3 8 9 because there are no repeats.
2:24:15
gendl
So yeah, I got all excited about Roswell the other night, and it's quite nice as far as it goes, but of course still rough around the edges
2:24:56
gendl
and only on Mac & Linux so far (didn't try on Windows yet cause my Windows VM can't see the internet).
2:25:37
gendl
I'll put a few Issues on its repo but I should hold off on putting too much before i can look into it myself and offer some actual pull requests.
2:26:08
gendl
Nobody can expect a single person to maintain a project with an inventory like that. It needs to be a real community effort somehow.
2:26:53
gendl
One thing which would be nice would be to pull down binary impls for platforms other than what you're running on at the moment.
2:28:01
gendl
Also I managed to wedge an internal cl-engines repo that we keep under git control - Roswell's ccl-bin comes down with a .git in it (which I didn't notice)
2:28:32
gendl
I used Magit to push it into our cl-engines repository, and apparently magit "helpfully" turned it into a sub-module for me.
2:29:19
gendl
There are whole walls of text talking about how to get rid of a sub-module from your repo once you have one.
2:29:43
aeth
gendl: A lot of the problems with Roswell are the parts written in C. I understand that they don't want to have any initial CL dependency, but something written in pure CL that *did* depend on CL would be fine imo. A lot of people have at least 1 CL available and just want to run other CLs or want to run a newer version of that CL.
2:31:13
gendl
aeth: Right. I'm not really seeing how having a C dependency for bootstrapping is so much better than a CL dependency.
2:32:08
gendl
if you want to build Roswell from source, it goes through a whole C make process which forces you to have a C build-essential environment installed
2:32:11
aeth
At least from a Linux perspective, every distro probably has at least one. Fedora has SBCL, ECL, and CLISP. And from a Windows/macOS perspective, it's probably not that hard to find one binary. It's the managing of a dozen that's tricky and that could be done better through a tool like Roswell.
2:33:16
gendl
It's already being delivered as a prebuilt C binary, especially for Windows where you wouldn't want to try building the C code from source
2:33:38
gendl
so if it's gonna be distributed with a bootstrapping binary anyway why not just have it be an SBCL or CCL one
2:34:06
aeth
The one platform where you don't want a binary (Linux) is the one where it's trivial to bootstrap through your distro's package manger's Lisp
2:35:04
gendl
Why wouldn't you want a binary on Linux? Just on principle and because of convention? Or because of dependencies on certain GLIBC versions etc?
2:36:16
gendl
Anyway, it's easy for us to sit here and have armchair discussions about it. I'll talk more about it after I've actually studied it a bit more (which hopefully can be soon).
2:36:46
aeth
gendl: It's too hard to deliver a binary on Linux because there's... 2 major types of package managers (.deb and .rpm) and a bunch of others, as well as 3 different ways to deliver a sandboxed app (lke Flatpak), and the traditional install script route.
2:37:31
aeth
Would just be easier to tell people to run: sbcl --no-initform --non-interactive --load foo.lisp --eval "(foobar:main)"
2:38:06
aeth
Your distro probably has SBCL, just an old one. It might not have some of the more exotic ones like CMUCL or Clasp or ABCL, and it probably doesn't have the current SBCL. That's where the value of something like Roswell comes in
4:11:58
gendl
I wise man once told me that the hours of sleep before midnight are worth more than those after 4am.
4:12:10
beach
My parents took a second job delivering newspapers, because they were awake at 4am anyway.
4:38:01
beach
gendl: You change input modes in Emacs to iso-accents-mode. Then you can use ` as a prefix.
4:40:30
beach
gendl: I mean, when I type "asf" followed by space or punctuation, it automatically expands to "(admittedly small) family".
4:43:05
gendl
I've heard people talk about abbrevs as if they're some kind of gift from God. But I always thought "meh. M-/ is good enough for me"
4:45:49
gendl
(i can look it up but i want to make sure i'm using the same package everyone here uses)
4:49:44
gendl`
Hi, i'm here through emacs now. I'm not sure why my nick has a backtick at the end now.
4:51:37
LdBeth
IRC only allows one nick name login in one place, so ERC automatically appends ` to conflicted nicks