freenode/#lisp - IRC Chatlog
Search
5:12:25
no-defun-allowed
It's not really hypothetical; I just described a case where we got some breakage, and I am saying that for that one case with two seldom used packages, there are dozens of cases with Alexandria and everything that depends on it.
5:12:46
verisimilitude
Thinking about ALEXANDRIA, I'm reminded of some discussion here where it was acknowledged a very inefficient implementation was in-place, where unnecessary.
5:13:19
verisimilitude
It's fine to design a library which isn't intended to be USEd, but to advocate against it entirely is silly.
5:14:24
verisimilitude
An easy solution is to not use a newer version of a library unless you've audited it. This does make the accumulation of dozens of dependencies harder, though.
5:14:57
no-defun-allowed
Sure, I'll name a case where it is useful: in decentralise2, I have a package decentralise-utilities that has parsers and generators for some of my internal formats, and some other macros.
6:27:07
asarch
I read that old-school Common Lisp programmers used to do string operations using symbols
6:41:56
White_Flame
olde timey lisps would break apart symbols into lists of single-character symbols for processing, then intern them back into a single symbol
6:51:27
asarch
For example, the user will input random numbers until he inputs 'q' to exit and do the average of those numbers: http://paste.scsys.co.uk/587907
6:56:19
asarch
I now, even (string=) won't work when you type "1": The value 1 is not of type (OR (VECTOR CHARACTER) (VECTOR NIL) BASE-STRING SYMBOL CHARACTER)
6:56:38
beach
asarch: Also, why do you not call READ in the LET binding, rather than having a default LET binding and then assigning to it?
6:56:39
beach
asarch: And when you expose code, you should make sure it is indented correctly. Common Lisp programmers rely on indentation to see the structure of the code. If you have the wrong indentation, you force people to count parentheses which is not polite.
6:58:34
no-defun-allowed
Copying from the REPL is going to indent it funny, because the first line is "indented" less in the copied text.
6:59:41
beach
asarch: Clearly, you should not use READ if you want to enter things as strings. READ will produce Common Lisp objects, like numbers, symbols, arrays, etc.
7:16:33
beach
asarch: It is considered bad style to use an IF with only one branch. The more specific WHEN and UNLESS should be used then. There is a very general rule in programming, namely "use the most specific construct that will do the trick", so as to inform the person reading your code of your intentions.
7:16:33
beach
asarch: WHEN and UNLESS are more specific than IF, because they say that you are only evaluating the body when some condition holds, AND you are only evaluating it for its side effect rather than for its value.
7:21:49
asarch
Actually I did it. I like to know your opinion about my code because that's the way I learn the "good manners" in Common Lisp
7:25:45
phoe
also I don't think CL can be learned in full in 21 days, it takes a somewhat longer time to do that
7:28:07
asarch
For example, the part about condition gives me 1000 questions instead of show me the conditions in a very precise way
7:28:19
no-defun-allowed
Generally speaking, when you read a book, it is assumed you start at the start, and go through linearly unless you are already familiar with the topics covered.
7:28:19
no-defun-allowed
That is to say, that you are expected to know most of the content covered in the chapters preceding the chapters on classes and generic functions.
7:28:25
verisimilitude
I also find this insistence that using an IF with only one branch is bad style silly.
7:30:58
asarch
Exactly. And the first thing you should learn is: Common Lisp IS NOT C/C++, why? Because most of programmers (if not all of them) come from C/C++
7:31:25
asarch
So, for example, when they want learn Python, they usually compare this from Python with that from C/C++
7:32:19
no-defun-allowed
Or in other other words, you should ensure you understand the concepts presented in the book, before proceeding to read later chapters that will likely refer to those concepts, leaving you confused.
7:32:55
verisimilitude
I learned Common Lisp by reading CLtL2 and then a list of differences with the final standard.
7:33:45
no-defun-allowed
"Lisp can be learnt in a day [citation needed], but if you know C, then it's three days."
7:37:13
no-defun-allowed
verisimilitude: Somehow I think this may lead to a good application of <https://xkcd.com/2270/>.
7:39:42
no-defun-allowed
One can formulate a good style guide and/or learning strategy by ensuring they don't do what you do.
7:40:53
verisimilitude
It's amusing, because looking at the advice shared here gave me some inspiration for that most insidious stupidity to remark against in my style document.
7:41:47
verisimilitude
Have fun being scared of &AUX, USE-PACKAGE, and pretending your CFFI wrapper is a Common Lisp program.
7:42:04
no-defun-allowed
asarch: That's exactly what A Gentle Introduction to Symbolic Computation is.
7:42:57
no-defun-allowed
If you would like to recreate the OpenCL framework and the drivers for my graphics card in Common Lisp, you're more than welcome to.
7:43:30
no-defun-allowed
(And I think the Linux AMD drivers are open source, so you shouldn't have too much trouble with that :)
7:44:07
verisimilitude
I wouldn't mind being paid for such, but I figure you wouldn't actually want to pay for it, and would simultaneously complain when it's AGPLv3.
7:45:21
beach
I can understand why someone would prefer to ignore conventions, but I can't for my life figure out why someone would want to encourage others not to follow conventions.
7:47:33
verisimilitude
Just because this channel is named ``#lisp'' and is on Freenode doesn't make it authoritative, beach, even though some would prefer to think otherwise.
7:47:54
verisimilitude
There's a similar issue with ``the front page of the Internet'' in thinking itself so important.
7:48:39
verisimilitude
None of you would know, but I was the only one who bothered giving any feedback regarding that recent Common Lisp survey; the Reddit users were content to share stupid jokes and vapid praise.
7:48:52
verisimilitude
Ironically, I can't participate in the survey, however, because it requires Google JavaScript.
7:49:15
no-defun-allowed
(The only reason I don't use it, is because my only large project for the last year has been a distributed object system, and I need to be sure that blame doesn't go where blame shouldn't go, namely that node operators don't get in trouble if their nodes download inappropriate content without knowing any better. Oh, and I was doing weirdo licenses before it was cool, even before the CNPL...)
7:49:23
verisimilitude
I told the fellow managing it that he should expect a fairly incestuous turnout, considering he only shared it here and Reddit.
7:54:09
verisimilitude
I was going to share it with my group, but I can't advocate for it, due to these reasons.
7:55:28
verisimilitude
I don't enable JavaScript at all, jdz; considering it's a basic form, there's no reason it should be needed.
7:55:55
verisimilitude
Requiring me to enable a megacorporation's JavaScript just to participate in a survey isn't much for community, in my eyes.
7:56:25
verisimilitude
I really didn't like that it was Google at all, but not even the radio buttons work without JavaScript; it's just a giant mass of <script>.
7:56:49
jdz
I agree with you that you may live your life keeping to your values, but you should not complain about other people having different opinion about them.
7:57:15
verisimilitude
I merely mean this consequently prevents the Common Lispers such as myself from participating, leading to what I deem the ``incestuous'' turnout.
7:57:37
verisimilitude
The medium is the message; the setting of the survey determines who will respond.
7:58:28
verisimilitude
I'm the only one who bothered to send the fellow an email about it, and contributed the idea for several questions he'd not thought of.
10:22:19
aeth
My first reaction was "oh verisimilitude is back, isn't verisimilitude the one with the odd style?" and then I read the text and it's a style debate. Some things never change. :-)
10:23:19
aeth
I guess you can assume most Lispers are unlearning C and/or C++. For a while there there was a very good chance that people might've learned Java instead of C++, but thanks to Oracle's neglect after the Sun acquisition, C++ kind of made a comeback in teaching afaik.
10:25:52
aeth
JavaScript might actually be a "security feature" as in a "don't cheat the survey" feature. Obviously this assumes that it's the worst case, privacy-destroying JS, too, which is probably is. On the other hand, thanks to the recent Nevada Caucuses (last Saturday), we can now say that Google Forms were used for an election so...
10:30:01
aeth
As for USE, IMO you can (probably) safely use exactly one thing other than CL, assuming that it's very unlikely that a conflict will be introduced later on, especially if e.g. it's another one of your own libraries.
10:31:24
no-defun-allowed
To be fair, I was able to repeatedly send a HTTP request to resend my response many times a couple of years ago with Google Forms.
10:32:53
aeth
But I I'm guessing the USE stuff is in response to https://old.reddit.com/r/lisp/comments/f98d1h/modern_functional_common_lisp_myths_and_best/fipyf7u/
11:19:18
phoe
aeth: using exactly one thing other than CL won't be a big issue as long as you are sure to *not* define stuff on the symbols that are used from that package
11:19:51
phoe
and by USEing a package, you allow it to define which symbols of the using package belong to the used package.
11:24:06
phoe
was thinking of e.g. :use :alexandria which is a fully external and independent package
11:24:31
aeth
:use :alexandria is problematic because not enough people do that, so it's really easy to get conflicts, so I'm surprised so many people say it's used so often
11:25:00
aeth
alexandria uses some ultra-generic names where it's likely some other library also tries to solve the same thing
11:26:46
aeth
Although I suppose the issue is when new conflicts are introduced, since known ones can be worked around.
12:16:54
jmercouris
hello everyone, I'm trying to extend cl-webkit bindings http://dpaste.com/2YJ30D6
12:21:29
jmercouris
as you can see I am trying to add a single slot titled navigation-action of type WebKitNavigationAction
12:23:25
jmercouris
You can see the version I've made on this branch: https://github.com/atlas-engineer/cl-webkit/tree/navigation-action
12:23:52
jmercouris
these are the changes I've made: https://github.com/atlas-engineer/cl-webkit/commit/94cfbd961e53eafcac18b0a8b667bd933be9ab72
12:28:42
jmercouris
according to here: https://webkitgtk.org/reference/webkit2gtk/stable/WebKitNavigationPolicyDecision.html#webkit-navigation-policy-decision-get-navigation-action
12:52:14
LdBeth
jmercouris: "Unknown GBoxed type" is signaled when type name can't be found in gobject::*g-type-name->g-boxed-foreign-info*
12:53:15
LdBeth
https://github.com/dmitryvk/cl-gtk2/blob/a3108fbc701dbab93b899e04b9637ded2f813410/glib/gobject.boxed.lisp#L117
16:07:35
jmercouris
is it saying here: https://webkitgtk.org/reference/webkit2gtk/unstable/WebKitNetworkProxySettings.html
16:10:57
Bike
Looks like an array of strings, yes. So you allocate your strings however, and then you allocate an array of char* pointers to them.
16:12:00
jmercouris
I need an array of character pointers which are actually pointing to the first character in each string
16:12:58
Bike
Just wondering what's with the question mark. And yeah, null terminated, and also you need to null terminate the array itself.
16:15:01
Bike
So if you have n strings, you do like (with-foreign-object (array :pointer (1+ n)) ...), where ... setfs a bunch of mem-arefs
16:18:35
jmercouris
there seems to be something here: https://common-lisp.net/project/cffi/manual/cffi-manual.html
16:23:04
Bike
since the other functions in here seem to allocate memory themselves, what i would guess is that it allocates its proxy settings object, and then copies in your ignore_hosts. so you can delete the ignore_hosts immediately. but that's a guess
16:24:44
dlowe
I wonder if there's some way to override malloc() in our lisp image so that it uses the lisp allocator instead.
16:29:03
phoe
in theory, you could allocate an ub8 vector, and then pin it and use its data-pointer when necessary
16:29:29
phoe
that's not covering everything though, you still need some way of keeping track of it when it isn't pinned and used
16:30:24
Bike
I mean think of the performance characteristics here. C programs allocate memory in different ways than lisp ones, and malloc is optimized for C ways
16:30:41
pjb
If foreign-alloc is specified to do it, then you can use it. But otherwise, allocate and fill the foreign stuff yourself.