bitmapper has quit [Remote host closed the connection]
bitmapper has joined #lisp
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Bit_MCP has quit [Ping timeout: 260 seconds]
bitmapper has quit [Ping timeout: 246 seconds]
wxie has joined #lisp
efm has quit [Ping timeout: 246 seconds]
EvW has quit [Ping timeout: 260 seconds]
efm has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
akoana has left #lisp ["Leaving"]
orivej has quit [Ping timeout: 264 seconds]
GuerrillaMonkey has joined #lisp
<kinope>
Good almost afternoon from australia
renzhi has joined #lisp
Jeanne-Kamikaze has quit [Ping timeout: 265 seconds]
ebrasca has quit [Remote host closed the connection]
<kinope>
I stopped by yesterday under the name Decs. I program just as a hobby. I hope it's cool if I can pop by in the future if I have questions, not sure if I personally have much to offer others just yet in that capacity though.
<kinope>
I do have a question about closures. I'm working on a project where I made my object classes from closures (experimenting with material from Let Over Lambda). I was informed that it's unusual to do that, and to use the standard class facilities presest in Common Lisp. Is this a matter of aesthetics or is it rooted in practicality or performance considerations. I'm genuinelly curious as I don't understand the parts at play
<kinope>
in this space.
pjb has quit [Ping timeout: 272 seconds]
ecraven- has joined #lisp
parisienne__ has joined #lisp
eschatologist_ has joined #lisp
seisatsu_ has joined #lisp
swflint_away has joined #lisp
jackhill has quit [*.net *.split]
zagura has quit [*.net *.split]
eschatologist has quit [*.net *.split]
swflint has quit [*.net *.split]
parisienne_ has quit [*.net *.split]
larme has quit [*.net *.split]
kim\ has quit [*.net *.split]
hydan has quit [*.net *.split]
dnm has quit [*.net *.split]
ecraven has quit [*.net *.split]
seisatsu has quit [*.net *.split]
ecraven- is now known as ecraven
swflint_away is now known as swflint
dlowe has quit [Ping timeout: 246 seconds]
dlowe has joined #lisp
femi has quit [Ping timeout: 264 seconds]
katco has quit [Ping timeout: 240 seconds]
unl0ckd has quit [Ping timeout: 240 seconds]
Gnuxie[m] has quit [Ping timeout: 244 seconds]
infra_red[m] has quit [Ping timeout: 260 seconds]
MrtnDk[m] has quit [Ping timeout: 252 seconds]
notzmv has quit [Ping timeout: 246 seconds]
camlriot42 has quit [Ping timeout: 252 seconds]
LdBeth has quit [Ping timeout: 252 seconds]
sputny[m] has quit [Ping timeout: 240 seconds]
sammich has quit [Ping timeout: 240 seconds]
DavdL[m] has quit [Ping timeout: 244 seconds]
cairn has quit [Ping timeout: 244 seconds]
deselby has quit [Ping timeout: 256 seconds]
fountainpen[m] has quit [Ping timeout: 260 seconds]
zagura has joined #lisp
userself has quit [Ping timeout: 256 seconds]
no-defun-allowed has quit [Ping timeout: 260 seconds]
kim\ has joined #lisp
larme has joined #lisp
smazga has joined #lisp
femi has joined #lisp
ebrasca has joined #lisp
stoneglass has quit [Quit: stoneglass]
Bike has quit [Quit: Lost terminal]
smazga has quit [Ping timeout: 256 seconds]
sammich has joined #lisp
unl0ckd has joined #lisp
<fe[nl]ix>
froggey: are you around ?
MrtnDk[m] has joined #lisp
katco has joined #lisp
monok has joined #lisp
hydan has joined #lisp
gaqwas has quit [Ping timeout: 260 seconds]
gaqwas has joined #lisp
Gnuxie[m] has joined #lisp
mono has quit [Ping timeout: 256 seconds]
LdBeth has joined #lisp
<beach>
Good morning everyone!
<beach>
kinope: The language has no particular tools for inspecting closures, whereas there is a rich set of tools for standard objects. Dispatch is slow/sequential with closures, and you have to do it manually. with generic functions, dispatch is fast and built in. With a closure, all "method" must appear in the same source code, whereas with standard classes, they can be spread out. Generic functions have features such as auxiliary
<beach>
methods and method combinations. Standard classes have (multiple) inheritance,
DavdL[m] has joined #lisp
pjb has joined #lisp
sputny[m] has joined #lisp
infra_red[m] has joined #lisp
fountainpen[m] has joined #lisp
shifty has joined #lisp
libertyprime has quit [Ping timeout: 256 seconds]
renzhi has quit [Ping timeout: 256 seconds]
userself has joined #lisp
shifty has quit [Ping timeout: 244 seconds]
efm has quit [Ping timeout: 258 seconds]
deselby has joined #lisp
ak5 has joined #lisp
ak5 has quit [Client Quit]
ak5 has joined #lisp
libertyprime has joined #lisp
wxie has quit [Ping timeout: 256 seconds]
<kinope>
beach: Thanks for that information, it's very helpful. Now I'm interested to see if the runtime overhead of my project can be reduced by making the switch.
no-defun-allowed has joined #lisp
<beach>
It is probably hard to see any difference in performance for small projects.
<ebrasca>
beach: Morning!
jesse1010 has quit [Ping timeout: 265 seconds]
<beach>
kinope: Consider the features more important than performance.
ak5 has quit [Client Quit]
ak5 has joined #lisp
Bit_MCP has joined #lisp
pjb has quit [Ping timeout: 256 seconds]
<kinope>
I run a test that queues up 10 million messages and then dispatches them all sequentially right after usually takes between 2-2.5 minutes. I would totally switch out those components just to satisfy my curiosity. But don't worry the other features are not lost on me either.
efm has joined #lisp
<beach>
I see, so you do have a significant execution time.
<beach>
What implementation are you using?
<kinope>
beach: Although right now I am a bit partial to having the methods all heaped together visually, I can see that as the classes get bigger they will get unwieldy.
<kinope>
beach: ECL
<beach>
You may want to try SBCL to see whether that makes a difference.
<kinope>
I have considered blowing the dust of my laptop to see it running on sbcl but right now I am constrained to use the implementation that will run inside termux on my android phone.
<beach>
Oh, right. I seem to remember reading that.
<kinope>
I'm not super concerned over performance right now though, it's just a toy framework at this stage.
<kinope>
I don't forsee any application I build with it needing even that sort of throughput.
<beach>
So what plan of action do you derive from those facts?
libertyprime has quit [Ping timeout: 246 seconds]
ak5 has quit [Quit: WeeChat 2.8]
slyrus_ has joined #lisp
ak5 has joined #lisp
<kinope>
I have yet to use the facilities provided by CLOS, so in the interest of growing my knowledge and also in the interest of not taking pride in being unorthodox without reason, I'm going to rewrite my closure classes as standard ones. Any performance improvements will be a bonus.
<beach>
Sounds good.
slyrus__ has quit [Ping timeout: 258 seconds]
kamid has joined #lisp
zaquest has quit [Quit: Leaving]
<kinope>
beach: Thank you, this was productive.
slyrus__ has joined #lisp
<beach>
Great!
pjb has joined #lisp
zaquest has joined #lisp
slyrus_ has quit [Ping timeout: 246 seconds]
dddddd has quit [Ping timeout: 265 seconds]
libertyprime has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Bit_MCP has quit [Quit: Leaving]
libertyprime has quit [Quit: leaving]
pjb has quit [Ping timeout: 272 seconds]
ak5 has quit [Quit: WeeChat 2.8]
pjb has joined #lisp
Lycurgus has quit [Remote host closed the connection]
efm has quit [Ping timeout: 272 seconds]
Bourne has joined #lisp
holycow has joined #lisp
efm has joined #lisp
karswell_ has quit [Ping timeout: 240 seconds]
kamid has quit [Ping timeout: 256 seconds]
holycow has quit [Quit: Lost terminal]
kamid has joined #lisp
shka_ has joined #lisp
GuerrillaMonkey has quit [Ping timeout: 246 seconds]
narimiran has joined #lisp
gravicappa has joined #lisp
wxie has joined #lisp
sdumi has quit [Ping timeout: 246 seconds]
wxie has quit [Quit: wxie]
voidlily has quit [Ping timeout: 260 seconds]
voidlily has joined #lisp
rgherdt has joined #lisp
corpix has quit [Remote host closed the connection]
sdumi has joined #lisp
corpix has joined #lisp
logicmoo has joined #lisp
dmiles has quit [Ping timeout: 256 seconds]
logicmoo is now known as dmiles
jprajzne has joined #lisp
matijja``` has joined #lisp
matijja has quit [Ping timeout: 260 seconds]
Bourne has quit [Read error: Connection reset by peer]
Bourne has joined #lisp
shifty has joined #lisp
Bourne has quit [Remote host closed the connection]
Bourne has joined #lisp
sdumi has quit [Read error: Connection reset by peer]
shka_ has quit [Ping timeout: 258 seconds]
lalilulelo has joined #lisp
ebrasca has quit [Read error: Connection reset by peer]
pve has joined #lisp
ebrasca` has joined #lisp
ebrasca` has quit [Remote host closed the connection]
ebrasca has joined #lisp
Archenoth has quit [Read error: Connection reset by peer]
<Posterdati>
hi
<phoe>
heyyy
Cymew has joined #lisp
<beach>
Hello Posterdati.
kaftejiman has joined #lisp
<Posterdati>
I found a problem in antik...
<Posterdati>
hertz definition is wrong, try (antik:make-pq 1d0 'hertz)
ralt has joined #lisp
<Posterdati>
hertz = 1/s not rad/s
<beach>
True. But radians are not real units. It is sometimes convenient to think of them as such, but they really aren't.
<no-defun-allowed>
I got #_6.283185307179586d0_rad/s, which is 1 cycle/second.
ech has quit [Ping timeout: 246 seconds]
<phoe>
6.28... is 2 * pi
<phoe>
which is one cycle, as no-defun-allowed said
<Posterdati>
beach: no, try (antik:make-pq 1d0 'hertz)
<Posterdati>
beach: the result is wrong
<Posterdati>
rad/s is not 1/s
<Posterdati>
frequency is not an angle over time
<Posterdati>
frequncy means how many times an event occur in a given time
<no-defun-allowed>
"But radians are not real units."
<beach>
Posterdati: But if you multiply a value by 2*pi, does it change the unit? Like if you have a distance of 2km and multiply it by 2*pi, do you now have km*rad/cycle?
<Posterdati>
no-defun-allowed: again try (antik:make-pq 1d0 'hertz)
<no-defun-allowed>
Posterdati: Read the backlog. I did, and I got 6.283... rad/s, or 2π rad/s, or 1 cycle/s
<Posterdati>
beach: that's the point, in formulas involving f the results are wrong
<beach>
OK, fine.
<Posterdati>
beach: you always have a 2pi constant which is not the case, look for example at the formula for the eddy current loss there is f not omega!
<Posterdati>
f is not omega
<beach>
I should be quiet. I don't know enough about antik to say more.
<Posterdati>
no-defun-allowed: again 1 hertz != 6.28... rad/s, frequency is not angular velocity
* easye
waves to beach and no-defun-allowed .
arbv has quit [Ping timeout: 246 seconds]
<no-defun-allowed>
o/
<easye>
Guess I will go with HALF_EVEN Rounding mode to round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor.
bfig_ has joined #lisp
frgo has joined #lisp
arbv has joined #lisp
davsebamse has quit [Quit: leaving]
<phoe>
internal operations? what do you mean?
bfig has quit [Ping timeout: 265 seconds]
<easye>
I'm try to the code that gives a double-float from a ratio for values between least-positive-normalized-double-float and least-positive-double-float in java. Need to pick a rounding algorithim.
<easye>
s/try to the/trying to fix the/
<easye>
Upon further rubber ducking of my question, I don't think it would be covered in ANSI Common Lisp.
kaftejiman has quit [Remote host closed the connection]
<easye>
HALF_EVEN is the IEEE 754R default
gaqwas has quit [Changing host]
gaqwas has joined #lisp
__jrjsmrtn__ has joined #lisp
Bourne has quit [Ping timeout: 246 seconds]
pjb has quit [Ping timeout: 272 seconds]
ArthurStrong has quit [Ping timeout: 246 seconds]
SGASAU has quit [Remote host closed the connection]
SGASAU has joined #lisp
<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.
<edgar-rft>
...if that's what you're looking for
<easye>
edgar-rft: thanks. that helps.
Bourne has joined #lisp
orivej has joined #lisp
random-nick has joined #lisp
pjb has joined #lisp
jesse1010 has joined #lisp
scymtym has quit [Remote host closed the connection]
anticrisis has quit [Read error: Connection reset by peer]
davsebamse has joined #lisp
marcoxa has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
jeosol has quit [Ping timeout: 245 seconds]
ljavorsk has joined #lisp
ebrasca has quit [Remote host closed the connection]
efm has quit [Remote host closed the connection]
efm has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
<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
hineios has quit [Ping timeout: 246 seconds]
hineios7 has joined #lisp
<beach>
Oh, they are no longer in the evening?
<phoe>
Michael said that now is the best time for him, plus the times are fluid to suit the presenter the best
<beach>
Got it. Thanks!
<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
<phoe>
a local optimum of sorts
<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
Bourne has quit [Read error: Connection reset by peer]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ is now known as Lord_of_Life
milanj has joined #lisp
amerlyq has joined #lisp
scymtym has joined #lisp
ggole has joined #lisp
JohnMS_WORK has joined #lisp
pjb has quit [Ping timeout: 260 seconds]
__jrjsmrtn__ has quit [Ping timeout: 256 seconds]
Bike has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
karayan has quit [Ping timeout: 260 seconds]
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
dddddd has joined #lisp
papachan has joined #lisp
<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.
terpri_ has joined #lisp
pjb has joined #lisp
terpri has quit [Ping timeout: 260 seconds]
ljavorsk has quit [Ping timeout: 260 seconds]
__jrjsmrtn__ has joined #lisp
orivej has quit [Ping timeout: 246 seconds]
<froggey>
fe[nl]ix: I'm here
avoo22 has quit [Ping timeout: 272 seconds]
gko has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
<jackdaniel>
because it is so unsafe without a valid certificate!
<jackdaniel>
at least that's what my web browser said
madnificent has joined #lisp
<phoe>
I know, right
karayan has joined #lisp
grewal has quit [Ping timeout: 264 seconds]
grewal has joined #lisp
orivej has joined #lisp
grewal has quit [Ping timeout: 246 seconds]
grewal has joined #lisp
cosimone has joined #lisp
EvW has joined #lisp
efm has quit [Ping timeout: 260 seconds]
<dlowe>
it's just to prevent there from being time to crack the private key
<dlowe>
it doesn't become unsafe at any particular point
<dlowe>
(well, any known particular point)
Archenoth has joined #lisp
ralt has joined #lisp
zaquest has quit [Quit: Leaving]
cosimone has quit [Quit: Quit.]
cosimone has joined #lisp
wsinatra has joined #lisp
CrazyEddy has quit [Ping timeout: 265 seconds]
MajCon has joined #lisp
<MajCon>
f
<MajCon>
phoe:Hi! Are you the person responsible for the Online Lisp Meeting series?
<beach>
He is.
<phoe>
MajCon: oh gods they found me
* phoe
runs for cover
<phoe>
MajCon: sure, it's me! what's up?
<jackdaniel>
hand your wallet and report none of it to the police - we know your address
* phoe
hands over the wallet with 384 MB worth of conses
<jackdaniel>
clearly you use sbcl and you did not type anything in the repl yet!
<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?
Bourne has joined #lisp
<phoe>
MajCon: yes please
<phoe>
this is a Common Lisp place, so we are just slightly off topic; mind if we take it to #lispcafe?
<MajCon>
Just need to register this name, be there in a bit
smazga has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
<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?
<flip214>
Oh, I need to click "+" (insert cell) every time...
zaquest has joined #lisp
pfdietz has joined #lisp
<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."
<yottabyte>
in the directory where my hello.lisp is?
<yottabyte>
or do I load the file?
<dlowe>
start sbcl in a terminal, load your code, then save your image
<yottabyte>
neat! a hello-world is 45 megabytes. is that okay?
rpg has joined #lisp
<dlowe>
it doesn't go up by much when you write a big program
<dlowe>
your hello world also includes an IDE :)
<dlowe>
well, minus the editor :p
<pve>
yottabyte: you can use ":compression t" if you want
<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
lucasb has joined #lisp
patlv has joined #lisp
<dlowe>
sure, just sbcl -eval '(load "hello.lisp")
Bourne has quit [Ping timeout: 256 seconds]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
<dlowe>
-eval '(sb-ext:save-lisp-and-die ...)'
<phoe>
yottabyte: also turn on core compression, you'll get 11 MB rather than 45 MB
bhartrihari has joined #lisp
<phoe>
oh, pve alredy said it
grewal has quit [Ping timeout: 265 seconds]
grewal has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
bitmapper has joined #lisp
<jmercouris>
I'm trying to make something like $EDITOR support for Next
<jmercouris>
the first thing that I think about is UIOP:RUN-PROGRAM
<jmercouris>
however, probably I should launch that in a new thread to avoid blocking, right?
<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?
grewal has joined #lisp
rogersm has joined #lisp
rogersm has quit [Client Quit]
<jmercouris>
THATS UNBELIEVABLE!
<jmercouris>
they thought of everything!
<jmercouris>
phoe: thanks
<Bike>
i don't think many implementations put effort into ed any more, and it might block
<Bike>
might be worth a shot, i guess
<jmercouris>
even if it blocks, it is very explicit
<jmercouris>
I can still pop it into a new thread
<jmercouris>
hmm, doesn't work on my machine
<jmercouris>
"Don't know how to ED /Users/jmercouris/Downloads/file.txt"
<jackdaniel>
so you may put there anything, i.e emacs
<jackdaniel>
ecl afair uses the EDITOR env variable value
<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)
<jmercouris>
it is available on standard quicklisp dist
<phoe>
...this is a portability library for cl:ed
<jmercouris>
that's exactly what it is, but it also respects $EDITOR
<jmercouris>
supposedely
<jackdaniel>
does the readmy state, that it is not available on ql?
<jackdaniel>
readme°
<jmercouris>
says something about quicklisp
<Bike>
it says you can get it from quicklisp but recommends ultralisp.
<jmercouris>
ultralisp
<jmercouris>
I looked at the source
<phoe>
"Install via Quicklisp, which updates distro about once a month."
<jmercouris>
it does respect $EDITOR
<jmercouris>
if you have CCL or SBCL
<jackdaniel>
"says something about quicklisp" is not the same as "does not work on quicklisp", is it?
<phoe>
"For the daily updates track, install via Ultralisp."
<jmercouris>
LIES!
<jmercouris>
yes, I was overzealous
<phoe>
jmercouris: yes, it is available on standard quicklisp dist, and the readme of that project explicitly states that
<jmercouris>
:'-(
<jmercouris>
Yes
Cymew has quit [Ping timeout: 264 seconds]
MajCon has quit [Ping timeout: 260 seconds]
<jmercouris>
I don't know if this is worth a dependency
<jackdaniel>
also: does it *not* respect EDITOR variable on other implementations?
<jmercouris>
it doesn't explicitly add support for them
<jmercouris>
effectively yes
rippa has joined #lisp
<phoe>
no idea
<phoe>
there's only SBCL and CCL getenv in there
pjb has quit [Ping timeout: 272 seconds]
<phoe>
probably could be made better via uiop's getenv
<jmercouris>
Yes
<jmercouris>
That was my thinking
<jmercouris>
also I was thinking that the scope is wrong, why eval text gotten from ed?
<jmercouris>
why not just load it into string?
bfig_ is now known as bfig
<jmercouris>
also, why do we need to write it to a file?
<jmercouris>
I guess we must use a temporary file, this is Unix after all...
borei has joined #lisp
<borei>
hi all
<jmercouris>
hello borei
<borei>
finally getting back on my lisp learning curve, last months were just killing me
sjl_ has joined #lisp
pjb has joined #lisp
<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.
<beach>
And what is that alternative?
EvW has quit [Ping timeout: 256 seconds]
<beach>
Don't tell me it's "closures".
<borei>
hi beach: :-)
<beach>
Generic functions and standard classes provide way more flexibility than closures.
<borei>
yeah it closures
<beach>
You are the second person in the past few days to have fallen into that trap.
<borei>
i can be wrong, im not experienced yet, mayb i just need to understand it deeper
ralt has quit [Quit: Connection closed for inactivity]
<beach>
Closures can be used as a poor man's object system, but it is definitely not recommended when you have CLOS.
<jmercouris>
OO is certainly one of the most powerful paradigms, even if itsn't as cool
<pjb>
Well, it depends on the scope of the project. closures are anonymous objects with one (or very few "methods").
<pjb>
Often you don't need more.
<beach>
OK, here we go again.
<pjb>
And a bunch of functions in CL prove it (reduce, mapcar, etc)
<borei>
just understanding how they work in connection with lisp macro system will bring me to the higher level
<jmercouris>
no, practice will bring you to a higher level
<beach>
I think #lisp has picked up a habit of contesting everything I say, so I will just shut up.
<jmercouris>
solving artificial problems doesn't make you better
<borei>
so now it's very academic and learning approach
<jmercouris>
beach: seid nicht so sauer! neimand hat dass gesagt
<pjb>
beach: it's not contesting everything. It's that everything is gray, and depends on the context.
<beach>
borei: Good luck with your closures.
<borei>
:-)
<borei>
im trying
<pjb>
OO is good, closures are good. one needs to understand both, and to use them in the right circumstances.
_jrjsmrtn has joined #lisp
<borei>
yep, that is my final goal
<pjb>
If you make the wrong choice, you get overly complex code.
<Bike>
closures aren't really an alternative to clos. you could implement clos using closures as objects, probably.
<borei>
so question is very basic, but i can't jump over that problem, i even don't know if my approach is correct
<jmercouris>
Bike: that sounds like an exercise in frustration
<Bike>
i don't think it would be a great idea, no
__jrjsmrtn__ has quit [Ping timeout: 256 seconds]
<borei>
(defmacro defnode (name)
<borei>
`(defun ,name()
<borei>
(incf x)
<borei>
(format t "Hello, from Macro~%")
<borei>
(let ((x 0))
<borei>
(format t "New X: ~a~%" x))))
<jmercouris>
borei: please, use a pasteservice
<Bike>
please use a pastebin service if you're going to put in more than one line.
<borei>
yep yep, really forgot about paste service
<Bike>
the binding of X takes place at macroexpansion time, so in the expansion X is unbound.
<jmercouris>
while Bike is correct, I don't think borei will get it
<borei>
yep
<borei>
function is defined in lexical environment - should it has an access to varaibles ?
<pjb>
borei: no it is not.
<borei>
i can't find answer
<pjb>
borei: the function is defined in the lexical environment where the defnode macro call is expanded from.
<pjb>
borei: Read what Bike said!
<Bike>
The function defined by DEFUN doesn't have X in its local environment.
<pjb>
borei: since your code is erroneous, it's difficult to guess what you want to do…
<Bike>
The code that DEFNODE expands into will need to bind X itself.
<pjb>
borei: so you should first write down in English what it is you're trying to achieve.
<borei>
need some time, wife is just behind me, breakfast, and she has very heavy argument :-) gimme 10-15
<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.
<beach>
pjb: So even the fact that I am contested was contested.
<beach>
I think I get the idea.
<pjb>
beach: sorry about that. :-)
grewal has quit [Remote host closed the connection]
<jackdaniel>
let over lambda is a very bad book for a beginner in common lisp
<Josh_2>
^
dnm has joined #lisp
jackhill has joined #lisp
X-Scale` has joined #lisp
<jmercouris>
anything wrong with having UIOP:GET-ENV in a slot initform?
<jackdaniel>
it is as if you were learning a language with tongue twisters: neither they are representative nor complete from the language perspective
<jmercouris>
as much as i love to disagree with jackdaniel on any topic of any nature, he is wholly correct about this
<jackdaniel>
jmercouris: you could skip your snarky remarks, I have enough of being personally addressed by you in a way which is impolite
<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.
<jmercouris>
jackdaniel: ebenso
X-Scale has quit [Ping timeout: 246 seconds]
X-Scale` is now known as X-Scale
<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.
<borei>
so i decided to try to use closure as a foundation for nodes definition
<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
<jackdaniel>
"likewise" would be appropriate if I did that at least once, which I did not.
<borei>
but i still want to modify variables defined lexical environments of the corresponding closures
<jmercouris>
Bike: I'll read, thanks
<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.
<Bike>
with CLOS you can just use accessor functions. it's easy.
<Bike>
jmercouris: basically, you can customize it pretty much entirely.
<jmercouris>
that's pretty cool
<jmercouris>
OK to use UIOP's with-temporary-file?
<jmercouris>
that is what I plan to pass to ED to edit, and then grab the results from that
<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 ?
<jmercouris>
borei: what is your goal in all of this? I can tell you that you won't be learning lisp
<Bike>
No, because I told you about this complication to encourage you to use CLOS instead.
<jmercouris>
nobody would ever write such a program in the manner described
<jmercouris>
unless it was strictly an exercise in masochism
<Bike>
let over lambda should cover that kind of thing. if it doesn't, you are not prepared
shifty has quit [Ping timeout: 260 seconds]
<borei>
that is true, i'm not tat that level ... yet
whiteline has quit [Remote host closed the connection]
<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)
shangul has joined #lisp
<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
<jmercouris>
MichaelRaskin: yes :-)
<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
marusich has joined #lisp
<_death>
borei: On Lisp has a basic chapter about network represetation by closures
<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
<Josh_2>
From what I have seen in here Let Over Λ has some controversial takes
<Josh_2>
I've read 4 chapters
<kinope>
I've seen some of the controversy in the past too
<kinope>
around the web
<_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
<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)
<borei>
ok, let put in this way - im not looking to build my own CLOS, im looking to build foundation for statefull functions
EvW has joined #lisp
<beach>
TMA: Be careful what you say. I said something similar the other day, resulting in an avalanche of utterances contesting what I said.
<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.
<beach>
Closures are essential, but mostly for other things.
<phoe>
I guess that would work, the funcallable instance is a CLOS instance with slots *and* a function at the same time
<borei>
nope, i didn't know about them till now
<phoe>
you can use that to have a function that stores its own state "inside itself".
<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".
<_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
<kinope>
Rewrote my simple queue closure today as a class and honestly it's much easier to grok
<phoe>
thanks as well
<phoe>
borei: an advantage of a funcallable instance over closures is that it's much easier to inspect the state in case of debugging.
<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
<borei>
https://pastebin.com/qeTicWt3 <- this form do what im looking for, it points me that i don't understand how does macros works
<kinope>
I had a look at cl-speedy-queue afterwards and whoa! the performance blew mine out of the water.
<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.
<phoe>
that's a closure
<Bike>
borei: compare (macroexpand-1 '(defnode ...)) to that form, and observe whta is different
<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?
<borei>
after macroexpand-1 let form just gone, meaning that there is no lexical environment - is it correct statement ?
<jackdaniel>
kinope: you can define an array
<jackdaniel>
with a fill pointer
<jackdaniel>
then you simply fill the array
gko has quit [Ping timeout: 260 seconds]
<jackdaniel>
that may require some modulo arithmetic if you want to make it rotary, but either way that should not cons
<jackdaniel>
(I don't know how the library is built)
<jackdaniel>
or you can of course cons a large list and make it circular
<beach>
Or you could use Flexichain which is designed for this kind of situation.
<kinope>
jackdaniel: Okay thanks, I'll look into that
<borei>
why let gone ???
<kinope>
Flexichain huh, alright I'll give that a squiz too.
luckless has quit [Remote host closed the connection]
luckless has joined #lisp
<bfig>
-part
bfig has left #lisp [#lisp]
<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.
smazga has joined #lisp
shangul has quit [Quit: Leaving]
<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.
papachan has quit [Quit: Leaving]
shinohai has quit [Remote host closed the connection]
shinohai has joined #lisp
ech has joined #lisp
<_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
rogersm has joined #lisp
<_death>
also, it's a no-seat-belts library (safety 0)
madnificent has quit [Ping timeout: 256 seconds]
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rpg has joined #lisp
madnificent has joined #lisp
kaftejiman has joined #lisp
sauvin has quit [Ping timeout: 256 seconds]
patlv has quit [Quit: Leaving]
bitmapper has quit [Remote host closed the connection]
bitmapper has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
bitmapper has quit [Remote host closed the connection]
bitmapper has joined #lisp
rogersm has quit [*.net *.split]
infra_red[m] has quit [*.net *.split]
unl0ckd has quit [*.net *.split]
Gnuxie[m] has quit [Ping timeout: 240 seconds]
userself has quit [Ping timeout: 252 seconds]
sputny[m] has quit [Ping timeout: 256 seconds]
sammich has quit [Ping timeout: 252 seconds]
LdBeth has quit [Ping timeout: 244 seconds]
MrtnDk[m] has quit [Ping timeout: 246 seconds]
no-defun-allowed has quit [Ping timeout: 246 seconds]
deselby has quit [Ping timeout: 260 seconds]
fountainpen[m] has quit [Ping timeout: 260 seconds]
DavdL[m] has quit [Ping timeout: 260 seconds]
katco has quit [Ping timeout: 260 seconds]
akoana has joined #lisp
unl0ckd has joined #lisp
rogersm has joined #lisp
unl0ckd has quit [Ping timeout: 244 seconds]
gravicappa has quit [Ping timeout: 240 seconds]
Lycurgus has joined #lisp
gravicappa has joined #lisp
midre has quit [Ping timeout: 246 seconds]
midre has joined #lisp
ebrasca has joined #lisp
ArthurStrong has joined #lisp
nwoob has joined #lisp
<nwoob>
is there something like leetcode where common lisp is supported
<phoe>
that's copied from the topic over at #clschool
<nwoob>
yes but those are not much and not problem solving questions like leetcode
<phoe>
I'm sadly not aware of more resources
<scymtym>
advent of code is language independent and usually really good
<phoe>
I was about to suggest that, or Project Euler
Lycurgus has quit [Remote host closed the connection]
heisig has quit [Quit: Leaving]
amnesic[m] has joined #lisp
hyuke has joined #lisp
<nwoob>
thanks phoe scymtym
<nwoob>
one advice I want from you guys, my problem solving skill is weak. what are the ways to improve them
rogersm has quit [Quit: Leaving...]
midre has quit [Ping timeout: 244 seconds]
<phoe>
nwoob: 1) think, 2) write code, 3) ask for help, 4) adjust code based on review, 5) GOTO 1
<phoe>
#clschool might be helpful if you decide to do that in Lisp
<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
ArthurSt1ong has joined #lisp
<phoe>
oh right! the four first steps can be applied in any order
<nwoob>
cool, thank you! :)
ArthurStrong has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
<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).
orivej_ has joined #lisp
<marcoxa>
Bye guys... Good night.
orivej has quit [Ping timeout: 272 seconds]
marcoxa has quit [Quit: Bed time.]
pfdietz has quit [Remote host closed the connection]
midre has joined #lisp
jw4 has quit [Read error: Connection reset by peer]
gaqwas has quit [Remote host closed the connection]
jw4 has joined #lisp
nwoob_ has joined #lisp
midre has quit [Ping timeout: 240 seconds]
nwoob has quit [Ping timeout: 240 seconds]
midre has joined #lisp
xsperry has joined #lisp
karayan has quit [Remote host closed the connection]
karayan has joined #lisp
EvW has joined #lisp
no-defun-allowed has joined #lisp
userself has joined #lisp
unl0ckd has joined #lisp
infra_red[m] has joined #lisp
katco has joined #lisp
LdBeth has joined #lisp
MrtnDk[m] has joined #lisp
DavdL[m] has joined #lisp
camlriot42 has joined #lisp
sputny[m] has joined #lisp
cairn has joined #lisp
sammich has joined #lisp
Gnuxie[m] has joined #lisp
deselby has joined #lisp
fountainpen[m] has joined #lisp
ralt has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
eschatologist_ is now known as eschatologist
pierpal has quit [Ping timeout: 246 seconds]
EvW has quit [Ping timeout: 256 seconds]
nwoob_ is now known as nwoob
nwoob has quit [Changing host]
nwoob has joined #lisp
EvW has joined #lisp
hyuke has quit [Ping timeout: 246 seconds]
rogersm has joined #lisp
pierpal has joined #lisp
wsinatra has quit [Quit: WeeChat 2.8]
hyuke has joined #lisp
pierpal has quit [Ping timeout: 272 seconds]
narimiran has quit [Ping timeout: 260 seconds]
theseb has joined #lisp
cairn has quit [Quit: authenticating]
cairn has joined #lisp
Lycurgus has joined #lisp
jw4 has quit [Quit: tot siens]
jw4 has joined #lisp
Aurora_v_kosmose has quit [Quit: brb]
SGASAU has quit [Remote host closed the connection]
SGASAU has joined #lisp
rogersm has quit []
jw4 has quit [Quit: tot siens]
jw4 has joined #lisp
pve has quit [Quit: leaving]
shka_ has quit [Quit: Konversation terminated!]
ggole has quit [Quit: Leaving]
ahungry has quit [Remote host closed the connection]
EvW has quit [Ping timeout: 260 seconds]
Lycurgus has quit [Remote host closed the connection]
zmt01 has joined #lisp
ebrasca has quit [Remote host closed the connection]
zmt00 has quit [Ping timeout: 260 seconds]
rgherdt has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 246 seconds]
nikkal has joined #lisp
EvW has joined #lisp
Aurora_v_kosmose has joined #lisp
nikkal has quit [Ping timeout: 258 seconds]
rpg has quit [Ping timeout: 246 seconds]
rpg has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
anticrisis has joined #lisp
<nwoob>
I learned recursion from little schemer and there is not return statement while calling recursive function but in other languages I have to add return statement before recursive call why?
<phoe>
in Lisp and Scheme, the value of the last form of an implicit progn is returned
<phoe>
so (lambda () 1 2 3 4 5) is going to return 5, since 5 is the last form in the body
<nwoob>
phoe: can I show you JS code?
<nwoob>
and from that could you guide me?
luna_is_here has joined #lisp
<phoe>
nwoob: I cannot, since I am going to sleep right now
<phoe>
but maybe #clschool will be able to
<nwoob>
ok np
jeosol has joined #lisp
pierpal has joined #lisp
pierpal has quit [Ping timeout: 260 seconds]
hyuke has quit [Ping timeout: 258 seconds]
SGASAU has quit [Ping timeout: 256 seconds]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
orivej_ has quit [Ping timeout: 252 seconds]
Lord_of_Life_ is now known as Lord_of_Life
orivej has joined #lisp
nwoob has quit [Quit: Lost terminal]
cosimone has quit [Ping timeout: 256 seconds]
pierpal has joined #lisp
theseb has quit [Quit: Leaving]
bitmapper has quit [Remote host closed the connection]
bitmapper has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pjb has quit [Ping timeout: 260 seconds]
rpg has quit [Read error: Connection reset by peer]
choegusung has joined #lisp
gko has joined #lisp
random-nick has quit [Ping timeout: 265 seconds]
stepnem_ has quit [Ping timeout: 260 seconds]
bitmapper has quit [Remote host closed the connection]
efm has joined #lisp
bitmapper has joined #lisp
kaftejiman has quit [Remote host closed the connection]