freenode/lisp - IRC Chatlog
Search
9:19:40
edgar-rft
easye: CLHS ROUND says: round and fround produce a quotient that has been rounded to the nearest mathematical integer; if the mathematical quotient is exactly halfway between two integers, (that is, it has the form integer+1/2), then the quotient has been rounded to the even (divisible by two) integer.
10:45:42
phoe
Online Lisp Meeting #2 starts in 15 minutes. Speaker: Michael Raskin, "Integrating with UNIX from Common Lisp via FS API" - https://www.twitch.tv/TwitchPlaysCommonLisp
10:49:28
phoe
Michael said that now is the best time for him, plus the times are fluid to suit the presenter the best
10:50:26
phoe
Plus, 13:00 CEST seems like a time that can suit the eveningpeople from Australia, afternoon people from Asia, midday people from Europe, and all the poor souls from Americas who need to wake up early
10:51:39
phoe
but, I don't want to stick to a single time - whenever the author says they would like the meeting to be held, I will attempt to hold it
11:47:06
MichaelRaskin
Technically I did not say it is better than Tue 18:00, just the same — but indeed it covers well the people overseas for whom 18:00 CEST was bad.
13:34:59
MajCon
Haha :-). It's a bit early (like 1 month early) but I've been using Racket+Redex for doing my master's thesis on using formal methods for WebAssembly. Is that the kind of stuff you think people would be interested in hearing about?
13:36:25
phoe
this is a Common Lisp place, so we are just slightly off topic; mind if we take it to #lispcafe?
13:57:50
flip214
when using cl-jupyter, only the current result is shown. How can I configure it to have a history, only changing previous cells by explicit intent?
14:30:42
yottabyte
hi all, I'm trying to make a simple executable to test, but when I run "(sb-ext:save-lisp-and-die "hello.exe" :toplevel #'main :executable t)" in slime I get "Cannot save core with multiple threads running."
14:30:46
yottabyte
I was just following this: https://stackoverflow.com/questions/14171849/compiling-common-lisp-to-an-executable
14:37:21
yottabyte
so I can compile a program that accepts a file as an argument and loads and compiles it so I don't have to start a sbcl session to make an executable
14:48:19
jmercouris
however, probably I should launch that in a new thread to avoid blocking, right?
14:50:17
patlv
Hi all, I've been using the Sxql package from Eitaro Fukamachi with great success, now I'm trying to call a stored procedure in mysql with it, it's not documented, anybody knows if it is possible?
15:01:02
jackdaniel
having hooks is clearly better, because you may feed it with something what's already part of the image (i.e climacs or some sed-like repl)
15:05:29
jackdaniel
"says something about quicklisp" is not the same as "does not work on quicklisp", is it?
15:05:58
phoe
jmercouris: yes, it is available on standard quicklisp dist, and the readme of that project explicitly states that
15:29:38
borei
well, after getting some result (doing 3D learning project, linear algebra etc) i started to understand that my approach is not in lisp way. Im using CLOS - it works very well, but starting to read "Let Over Lambda" - pointed me that there is alternative, and that alternative is even more powerful then CLOS, but not easy to understand.
15:32:32
beach
Closures can be used as a poor man's object system, but it is definitely not recommended when you have CLOS.
15:32:43
pjb
Well, it depends on the scope of the project. closures are anonymous objects with one (or very few "methods").
15:33:20
borei
just understanding how they work in connection with lisp macro system will bring me to the higher level
15:33:36
beach
I think #lisp has picked up a habit of contesting everything I say, so I will just shut up.
15:34:00
pjb
beach: it's not contesting everything. It's that everything is gray, and depends on the context.
15:34:26
pjb
OO is good, closures are good. one needs to understand both, and to use them in the right circumstances.
15:35:19
Bike
closures aren't really an alternative to clos. you could implement clos using closures as objects, probably.
15:35:21
borei
so question is very basic, but i can't jump over that problem, i even don't know if my approach is correct
15:36:45
Bike
the binding of X takes place at macroexpansion time, so in the expansion X is unbound.
15:38:16
pjb
borei: the function is defined in the lexical environment where the defnode macro call is expanded from.
15:39:57
borei
need some time, wife is just behind me, breakfast, and she has very heavy argument :-) gimme 10-15
15:40:48
pjb
if it is to generate a function that will return a different value each time it's called, then I would advise against it. Such procedures are not mathematical functions (their results are not computed in function of their arguments), therefore they are difficult to prove, to debug and to test.
15:46:21
jackdaniel
it is as if you were learning a language with tongue twisters: neither they are representative nor complete from the language perspective
15:46:43
jmercouris
as much as i love to disagree with jackdaniel on any topic of any nature, he is wholly correct about this
15:47:46
jackdaniel
jmercouris: you could skip your snarky remarks, I have enough of being personally addressed by you in a way which is impolite
15:47:50
borei
ok, main goal (i know it can be achieved with CLOS, and i can do it pretty easy) - im building pipeline, which is directed acyclic graph, nodes of that pipeline supposed to do very simple operation, for example to do high pass filtering.
15:48:20
Bike
jmercouris: initforms can be whatever and it should be fine. they're not executed if you're loading an object from a fasl for example.
15:48:48
jmercouris
Bike: aha, that.. could be a problem, how do I know what is executed/not-executed when loading from image? that has brought me pain several times
15:49:14
borei
but i still want to modify variables defined lexical environments of the corresponding closures
15:49:48
Bike
yes, you'll need to have other closures that modify the variables, or add messages to your existing closures to let you tell them to modify a lexical variable.
15:56:28
borei
Bike: "yes, you'll need to have other closures that modify the variables, or add messages to your existing closures to let you tell them to modify a lexical variable." - can you give me simple example if possible ?
15:56:50
jmercouris
borei: what is your goal in all of this? I can tell you that you won't be learning lisp
16:04:32
jackdaniel
another analogy with language twisters is that even when you know them all, it won't make you know the language. also speaking in language twisters on daily basis it annoying to others (at best)
16:05:32
MichaelRaskin
jmercouris: I thinh my debugger helper to fight compilers optimising away local variables did more or less this… but yeah, if was not normal code, and if such things are not obvious yet, one should not do them
16:07:56
Josh_2
borei: you see how confusing this gets after a while? https://imgur.com/AHROXd6.png and this example is only trivial. You really should just use CLOS where applicable
16:10:44
kinope
Hey! I was that second person who fell into constructing my classes from closures, gave me a chuckle. The conversation has got me wondering how many people wonder in here bathed in the radiant light of Let Over Lambda
16:12:19
_death
such examples are also given in SICP.. I think it's good to learn, even if the CLOS style often makes sense in practice
16:12:55
TMA
it is neat that it is possible, yet it is not exactly practical (and more suited for scheme, where a decent object system is not standardized in the older revisions of RnRS)
16:13:36
borei
ok, let put in this way - im not looking to build my own CLOS, im looking to build foundation for statefull functions
16:14:22
beach
TMA: Be careful what you say. I said something similar the other day, resulting in an avalanche of utterances contesting what I said.
16:14:58
kinope
Yeah, I think it's worth exploring all of the language constructs even if there are better ways to tackle the common use cases.
16:15:47
TMA
borei: did you look into funcallable instances? http://mop.lisp.se/www.alu.org/mop/concepts.html#funcallable-instances
16:16:36
phoe
I guess that would work, the funcallable instance is a CLOS instance with slots *and* a function at the same time
16:17:43
beach
phoe: The term "CLOS instance" is meaningless. Every Common Lisp object is an instance of some class, so every Common Lisp object would then be a "CLOS instance".
16:17:51
_death
if someone does not know recursion, it makes sense to give exercises in recursion that in practice are solved by other means such as loops.. the same goes for closures
16:18:35
kinope
Rewrote my simple queue closure today as a class and honestly it's much easier to grok
16:19:21
phoe
borei: an advantage of a funcallable instance over closures is that it's much easier to inspect the state in case of debugging.
16:20:01
phoe
like, you literally check the slot values of the funcallable instance, as opposed to using implementation-dependent means to get the values and what else from the places that are closed over
16:20:42
borei
https://pastebin.com/qeTicWt3 <- this form do what im looking for, it points me that i don't understand how does macros works
16:21:21
kinope
I had a look at cl-speedy-queue afterwards and whoa! the performance blew mine out of the water.
16:21:53
TMA
beach: I am trying to be careful. I too have been rebuffed in a similar way on too more ocasions than I care to count.
16:24:28
Bike
borei: compare (macroexpand-1 '(defnode ...)) to that form, and observe whta is different
16:28:16
kinope
Apparently cl-speedy-queue is non-consing. I'm wondering how that works. My queue class operates on lists and I think I have a constant complexity algorithm but it's still very slow. How does one create a data structure that operates faster than consing lists, I thought that the list was as deep as you could go in lisp. Am I making sense?
16:28:41
borei
after macroexpand-1 let form just gone, meaning that there is no lexical environment - is it correct statement ?
16:29:26
jackdaniel
that may require some modulo arithmetic if you want to make it rotary, but either way that should not cons
16:54:51
kinope
Reading the design document for Flexichain now, it seems to tackle a problem that is a bit larger than I need right now. Interesting none the less. If I ever build an application with my framework flexichain seems like a good candidate for text fields and such. I'm going to study the design of cl-speedy-queue for my own edification, but I'm probably going to use it for the message queue for now.
17:02:08
kinope
One has to specify the size of the queue when using speedy-queue, but when I think about it I don't think the message queue needs resizing, or even needs to be so big. Since a stable actor network shouldn't have a queue of unprocessed messages growing however fast or slowly towards infinity anyway. Should be possible to determine the size of queue needed for a given application.
17:26:04
_death
it looks like it represents a queue as a vector with head/tail pointers (and a sentinel for some reason.. maybe related to concurrency?) .. one issue is that it doesn't remove references to values when it dequeues
19:10:37
phoe
(Lisp-Koans #u"https://github.com/google/lisp-koans") (CL-on-Exercism #u"https://exercism.io/tracks/common-lisp")
19:25:32
nwoob
one advice I want from you guys, my problem solving skill is weak. what are the ways to improve them
19:27:11
phoe
nwoob: 1) think, 2) write code, 3) ask for help, 4) adjust code based on review, 5) GOTO 1
19:28:40
selwyn
practise... and after you have solved a problem (any problem) try to think how it could have been solved better, what went well/ what was a waste of time, etc. and use the lessons learnt next time
19:33:22
bhartrihari
It might also be helpful to find some interesting puzzles initially to get you going. Like riddle books by Raymond Smullyan for logical (and chess) puzzles. (He also teaches how to think about certain kinds of problems, and go about solving them).