freenode/#lisp - IRC Chatlog
Search
6:56:53
beach
It may have been small stuff like one saying "the consequences are undefined" and the other one that "an error is signaled".
7:11:20
no-defun-allowed
I don't think whoever came up with the spam bot programmed it to explain itself, sadly.
7:12:04
beach
I am not looking for an explanation. I am looking for the absence of one, so that I don't have to follow the link.
7:13:31
White_Flame
LdBeth: one interesting use of &aux that I've found is computing derived struct slot values in the declared BOA constructor without needing a function body
7:17:31
loke
Wow. I didn't know that was possible. And even though I now know about it, I don't think I'll ever use it.
7:19:27
White_Flame
ACTION likes shortcuts when possible and fits the intent. Plus, with Lisp it's pretty easy to unroll into "full form" if it gets past the scope of the shortcut
10:51:24
jmercouris
Ok, so yesterday we established that we can't do FFI to C++ because the ABI is not standard in C++ world
11:43:06
no-defun-allowed
Standardise the C++ ABI? That would be half-polite of the – well, sure. No good if you want to use Qt though.
11:45:03
beach
But I will be quiet now because I am not adding anything new that I haven't already said.
11:48:53
no-defun-allowed
I agree life is much simpler if you are able to avoid FFI completely or avoid it as much as possible, or if you grow vegetables; but there may be reasons one wants to use Qt.
11:51:34
no-defun-allowed
My favourite reason is to use the Qt WebEngine to load documents off a CL server, and implement the UI in HTML/CSS/JavaScript. Then use your favourite C->JavaScript transpiler to run Qt in the browser, and repeat until you get bored.
11:55:24
no-defun-allowed
But seriously, it may be less effort per individual to bite the bullet and work with Qt than to test/port/develop/&c a CL toolkit, even though all the time taken to accomodate for foreign code would probably add up to more than enough required to make that toolkit work.
13:18:29
beach
I am convinced we represent an instance of the prisoner's dilemma. The optimal solution is to collaborate to create Common Lisp solutions to our collective software needs, but individually, it is better to take the FFI route.
13:18:31
beach
As a result, everybody pays the price of increased development and maintenance burden. Except those who can and do choose to work on something that can be done entirely in Common Lisp.
13:22:09
beach
FFI solutions require a different kind of maintenance, namely catching up with moving targets, like Qt versions, LLVM versions, Gnome versions.
13:28:44
Xach
I wrote pure lisp stuff for gifs and pngs because I was frightened by the thought of foreign code crashing my long-running server.
13:31:09
_death
I didn't write OpenCV in pure lisp because it would require tens of thousands of man hours or more..
13:33:11
beach
Anyway, having identified the reason for the state of things, I now understand much better what is going on, and I know that it would usually be futile to try to influence someone's choice.
13:33:45
_death
beach: but you could also flip it, so that the utilitarian solution is to use the language where most effort has already gone to, and the choosing Lisp is the egoistic individual choice
13:36:06
beach
That might have been true if the "utilitarian solution" were effortless or nearly so. The many questions and problems related to FFI solutions that are discussed here suggest otherwise.
13:41:26
_death
there is reason, but it is an egoistic reason.. I like CL better than C++, so I don't mind putting effort into making the rest of the world work with CL.. only a small group of people may benefit from this choice
13:41:52
beach
_death: You don't need an excuse to choose the FFI solution ("tens of thousands of man hours or more"). Like I said, it is perfectly clear to me now why this solution is optimal to the individual.
13:45:40
beach
_death: I think that is a very good idea, i.e. create a Common Lisp "wrapper" for an existing foreign library. However, what I usually observe is a badly documented wrapper library that requires the user to understand both the foreign library, the foreign language it is written in, *and* the undocumented code of the wrapper.
13:45:41
beach
I am not saying this is the case with yours of course. I haven't looked at it at all.
13:47:31
_death
beach: I definitely agree with this observation.. I think it's difficult to design good interfaces, and the Lisp standard is a high one.. it's much easier to ape the foreign library's existing interface.. in the past I did that, but also did the harder work at times
13:49:34
_death
beach: it also has to do with means and ends.. if utilization of this library is just a means to an urgent end, then it's likely the initial solution would involve less thought about the interface
13:50:22
beach
Yes, but then it is not really usable by a wide audience. And we are back to the prisoner's dilemma.
15:53:23
Shinmera
Speaking of UI, though, here's another brief demo for Alloy I put together today https://youtu.be/oLRBZrdzJS0
16:07:38
Kabriel
Shinmera: that looks like plotting. Excuse my ignorance, but is this part of McCLIM or based on it, or something else?
18:15:33
phoe
I have been working with MIT LOOP for a moment now and I am somewhat puzzled at https://gitlab.common-lisp.net/ansi-test/ansi-test/commit/60cb6583156fa625925a24f16153da44a59e6371
18:16:52
phoe
does anyone on #lisp know which part of the standard specifies the rationale for these tests? In particular, that X is not supposed to be set anywhere outside (INTEGER 1 5)?
18:18:03
pfdietz
"In an iteration control clause, the for or as construct causes termination when the supplied limit is reached. That is, iteration continues until the value var is stepped to the exclusive or inclusive limit supplied by form2."
18:19:16
White_Flame
phoe: the definition of stepping says that the variable itself is updated in anticipation for the next iteration
18:19:33
White_Flame
by that, X would legitimately be 6, and the declaration of (integer 1 5) is wrong
18:20:00
Bike
"For these clauses, iteration terminates when a local variable reaches some supplied value or when some other loop clause terminates iteration." is in 6.1.2.1, too
18:20:18
specbot
The for-as-arithmetic subclause: http://www.lispworks.com/reference/HyperSpec/Body/06_abaa.htm
18:22:17
White_Flame
"is reached" is problematic with those examples, if taken to be "is equal to". The examples clearly show overshooting the target "to 10" value, not reaching it exactly
18:23:06
White_Flame
the first paragraph does say that the variable is stepped after each iteration, with no exemption for the final iteration
18:24:39
White_Flame
in 6.1.2.1.1: (let ((x 1)) (loop for i from x by (incf x) to 10 collect i)) => (1 3 5 7 9)
18:26:15
pjb
(let ((x 1)) (loop for i from x by (incf x) to 10 collect i into is finally (return (values is i)))) #| --> (1 3 5 7 9) ; 11 |#
18:27:23
phoe
(loop for i from 1 by 2 to 10 collect i into is finally (return (values is i))) is equivalent
18:27:25
pjb
I cannot find where it says that the loop variables scope covers the finally expressions…
18:27:35
White_Flame
to my reading of the spec, regarding the definition of stepping (that it affects the variable itself), and that stepping happens at the end of each iteration, yes the test is wrong
18:28:54
White_Flame
within pretty much every LOOP clause but FINALLY, the variable is in (integer 1 5), but it does go past that after the final iteration
18:29:50
White_Flame
if each loop clause had (locally (declare ((integer 1 5) x)) ...) that would be another thing
18:30:32
phoe
pjb: clhs 6.1.7.2 has some info, http://www.lispworks.com/documentation/HyperSpec/Body/06_agb.htm
18:30:47
phoe
and the epilogue is described in 6.1.1.4 at http://www.lispworks.com/documentation/HyperSpec/Body/06_aad.htm
18:31:13
phoe
LOOP is expanded into bindings and block and tagbody, and inside this there is a prologue, body, and epilogue
18:31:25
phoe
this means that the epilogue is inside the bindings, which implies that the variables are accessible
18:34:03
pjb
Note that 6.1.2.1 says that: Stepping assignments are made in the loop body BEFORE any other forms are evaluated in the body. and Stepping assignments are made in the loop body BEFORE any other forms are evaluated in the body.
18:34:06
phoe
6.1.2.1.1 states "iteration continues until the value var is stepped to the exclusive or inclusive limit supplied by form2."
18:34:57
phoe
so if I loop for x below/to most-positive-fixnum, then x can be set to most-positive-fixnum but must never exceed it
18:35:31
pjb
Therefore one could expect (if (= x last) (loop-finish) (incf x)) and x being 5 in the epilog. Of course, this would require x to be initialized to -1, so the type would still be broken.
18:36:23
White_Flame
pjb: but again, there are examples where it overshoots and never exactly matches the "to" clause, yet still halts
18:37:06
White_Flame
I don't think the tests happen anywhere outside the clauses such as for/while/until
18:37:08
jackdaniel
one could argue, that do doesn't have such problems thanks to intelligible specification ;) good night and good luck
18:38:25
pjb
White_Flame: But we can test: (if (<= x (- last increment)) (incf x increment) (loop-finish))
18:39:08
pjb
the spec doesn't specify the order between the test and the step. (incf x increment) is my step.
18:44:38
phoe
what if you test after the last iteration but before the next iteration - is this permitted by the spec?
18:45:13
phoe
because then you could check that the next X is going to pass the boundary, and do not pass GO, do not collect $200, go straight to epilogue
18:46:51
pjb
so you can test first, and not execute the body. Then you must not increment. This shows that x should never be 6.
18:50:54
phoe
do we have a conclusion now, because my brain is fuzzy after discussing this on #ccl #ecl and now here
18:52:44
phoe
pfdietz: as for LOOP.1.41, I've created https://gitlab.common-lisp.net/ansi-test/ansi-test/issues/14 since this one seems somewhat less troubling
18:55:29
White_Flame
pjb: semantically, in order to get the result I think you want, you'd have to test the current value (in case its equal), test the hypothetical value that it would take on if it were stepped, and then step if that hypothetical value was still in range