binghe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language <http://cliki.net/> logs:<https://irclog.whitequark.org/lisp, http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.0, CMUCL 21b, ECL 16.1.3, CCL 1.11.5
kozy has quit [Remote host closed the connection]
kozy has joined #lisp
wxie has quit [Ping timeout: 256 seconds]
varjagg has quit [Quit: ERC (IRC client for Emacs 25.2.1)]
nowhere_man has joined #lisp
nowhereman_ has quit [Ping timeout: 268 seconds]
terpri has joined #lisp
Chream_ has quit [Read error: Connection reset by peer]
Chream_ has joined #lisp
kdridi has quit [Remote host closed the connection]
Chream_2 has joined #lisp
borei has joined #lisp
rumbler31 has joined #lisp
Chream_ has quit [Ping timeout: 256 seconds]
terpri has quit [Ping timeout: 276 seconds]
porky11 has quit [Quit: Leaving]
marusich has joined #lisp
rumbler31 has quit [Ping timeout: 276 seconds]
jstypo has quit [Ping timeout: 240 seconds]
marusich has quit [Ping timeout: 268 seconds]
marusich has joined #lisp
pierpa has joined #lisp
stacksmith has quit [Read error: Connection reset by peer]
attila_lendvai has quit [Quit: Leaving.]
stacksmith has joined #lisp
kdridi has joined #lisp
krwq has quit [Remote host closed the connection]
makomo has quit [Ping timeout: 248 seconds]
arescorpio has joined #lisp
arescorpio has quit [Max SendQ exceeded]
fisxoj has joined #lisp
jstypo has joined #lisp
Baggers has quit [Remote host closed the connection]
python476 has quit [Ping timeout: 260 seconds]
vultyre has joined #lisp
kdridi has quit [Remote host closed the connection]
python476 has joined #lisp
arescorpio has joined #lisp
kdridi has joined #lisp
hel-io has joined #lisp
milanj has joined #lisp
terpri has joined #lisp
cranix has joined #lisp
<cranix> hello
<cranix> i would like to make many declaration of global variables in a loop using defparameter
<cranix> so i will have variables of names say r0 r1 r2 .. r31
<cranix> wihout 32 (defparameter rn 0)
<cranix> i am trying to make a macro
<cranix> that will run it inside a loop
<cranix> but without success
<cranix> i'm googling about loops in macros
<cranix> but i find only things about a macro called loop
<cranix> i do not want to use array
<cranix> i have a function that gernates symbol
<cranix> and i have a macro that will generate one defparameter
<cranix> but i can not put it inside a loop
<cranix> i mean it compiles
<cranix> but i do not have anything new defined
<cranix> and i have no idea why
<cranix> macroexpand does not help me
<cranix> i see that it has expanded properly
<cranix> i tried quoting/unqotin in all possible ways
<stylewarning> cranix: (macrolet ((f (n) `(progn ,@(loop for k below n collect `(defparameter ,(intern (format nil "r~D" k)) nil)))) (f 32))
hel-io has quit [Remote host closed the connection]
<cranix> i'm reading about macrolet
<stylewarning> You can replace the macrolet with defmacro
<cranix> i tried
<stylewarning> My macrolet?
learning has joined #lisp
<cranix> i'm redaing what it does
<cranix> i would like to understand what i have done wrong
<cranix> i have macro for defparameter
<cranix> and tried to put it inside a loop in all possible ways
<learning> been coding a project in python. it's crazy how differently i think about programming after doing only lisp for a long time.
<cranix> this macro calls function that uses intern with format in similar fasion to what You wrote
<cranix> learning: please write more, i'm curious
wheelsucker has joined #lisp
<cranix> and why You have used collect in this loop?
<learning> like i used to think about objects like some sort of abstract idea. now they just look like variables that have their own namespace that you can add variables on to. to be more concrete, i had a problem that required that i "override" (not sure what it's called in python when you define a function that's already been defined). the example solution created a new class in order to override. i wanted to do it in a more st
<learning> raight forward way. so i looked up how to just redefine the function. it's actually a really bad way to do it because of a memory issue, but it was just about doing it for the learning experience. i would have never done that before lisp.
<learning> instead of just seeing the solution to my problem and not understanding how it works, i not only understand how the solution works but i actually have this driving curiosity to figure out how to code it in a different way
rumbler31 has joined #lisp
hel-io has joined #lisp
<learning> of course i learned recursion from doing lisp and that's prolly the biggest game changer
<learning> and getting away from "solve everything by making more types" i think helped me a lot
<cranix> when i use collect it works
<cranix> stylewarning: thanks :)
<cranix> but why there has to be collect
<cranix> not do?
<stylewarning> cranix: because you need to generate code, not execute it
<stylewarning> in a macro
hel-io has quit [Client Quit]
<cranix> and collect will return all results of iteration
<cranix> right
<cranix> thanks a lot :)
<stylewarning> Using do won’t actually generate any code to run
<stylewarning> Yes that’s right
rumbler31 has quit [Ping timeout: 252 seconds]
<learning> i laughed when i learned that python doesn't have multiline anonymous functions. so you have to name functions even if they're only going to be called once. that's something i wouldn't even have thought about before. anonymous functions have become my bread and butter.
<learning> you can see the difference in mentalities just from the design of the programming languages. like clearly the person who invented python wasn't using lambdas when he created the language.
<learning> when i started learning lisp it was definitely on the promises that "it makes you a better programmer even if you never use lisp again" and i'm glad that i can come back to this irc channel and say that i'm now one of those people who got better from learning lisp
<GreaseMonkey> if `from __future__ import braces` is anything to go by i think it would be really, really hard to actually get multiline anonymous functions working
marusich has quit [Ping timeout: 248 seconds]
<learning> i dont think they'll ever add it to the language
<stylewarning> learning: not even multiline; you can’t express arbitrary Python code in there
<GreaseMonkey> it'd have to be a "python 4" where guido somehow reneges and adds braces... which is a shame because python's possibly the most popular programming language that has the machinery required for you to provide a macro transformer (AST parser and compiler + lets you hijack the import machinery)
marusich has joined #lisp
<cranix> thanks for help, i have to go
cranix has quit [Quit: leaving]
<learning> i mean i dont think it's important to have unnamed functions. it's more about having the mentality to write those functions in the first place. having to name something isn't that big of a deal to me.
learning has quit []
learning has joined #lisp
vultyre has quit [Ping timeout: 256 seconds]
EvW has quit [Ping timeout: 265 seconds]
Patternmaster has quit [Quit: leaving]
smokeink has joined #lisp
python476 has quit [Ping timeout: 248 seconds]
markong has quit [Ping timeout: 248 seconds]
smasta has quit [Ping timeout: 256 seconds]
kotrcka_ has quit [Remote host closed the connection]
Cthulhux has quit [Ping timeout: 240 seconds]
Cthulhux has joined #lisp
kdridi has quit [Read error: No route to host]
kdridi has joined #lisp
Cthulhux has quit [Changing host]
Cthulhux has joined #lisp
epony has joined #lisp
kdridi_ has joined #lisp
kdridi has quit [Read error: Connection reset by peer]
pagnol has quit [Ping timeout: 265 seconds]
emacsomancer has quit [Ping timeout: 248 seconds]
kdridi_ has quit [Remote host closed the connection]
kdridi has joined #lisp
kdridi has quit [Ping timeout: 268 seconds]
smurfrobot has joined #lisp
emacsomancer has joined #lisp
thallia has quit [Ping timeout: 252 seconds]
d4ryus1 has joined #lisp
papachan has quit [Quit: WeeChat 2.0.1]
thallia has joined #lisp
d4ryus has quit [Ping timeout: 248 seconds]
emacsomancer has quit [Read error: Connection reset by peer]
emacsomancer has joined #lisp
smurfrobot has quit [Remote host closed the connection]
dddddd has quit [Remote host closed the connection]
arescorpio has quit [Excess Flood]
nullman has quit [Ping timeout: 248 seconds]
<stacksmith> learning: just in case you are for real - it is extremely important to have unnamed functions. Otherwise it requires a human to name functions. Lambdas can be generated programmatically. It would be a tragedy if you had to name them - pollution of the package, avoiding duplication, not to mention - why name things that need no name?
nullman has joined #lisp
heurist_ has quit [Ping timeout: 248 seconds]
heurist_ has joined #lisp
<whoman> naming stuff is probably the main problem in all of linguistics, speech, communication, programming ...
orivej has quit [Ping timeout: 256 seconds]
vultyre has joined #lisp
fisxoj has quit [Quit: fisxoj]
<mfiano> 2 hard problems in CS
<whoman> gensym to me is a terribly hacky solution
<whoman> when i see this, it feels something is not right
<mfiano> in general or is there some code I'm not seeing?
<dmh> the hardest problem in CS is why modern websites hide scrollbars
bmgxc9 has joined #lisp
bmgxc9 has quit [Max SendQ exceeded]
bmgxc9 has joined #lisp
Chream_2 has quit [Read error: Connection reset by peer]
Chream_ has joined #lisp
<whoman> mfiano, in general
<whoman> dmh, ugh! and my scrollwheel is broken !! so many many many sites these days, have dynamic content, where the scroll nub jumps around and changes size. its a terrible situation
<mfiano> whoman: You need to actually learn why it is /very/ important
<dmh> haha
<whoman> although to be fair, keyboard or mouse is NO MATCH for touch screen for scroll and zoom
<whoman> mfiano, well i do know why =) its just harder to track for me, mentally
<dmh> i hate touch screen
<dmh> so idk
<mfiano> I mean how would you implement the ONCE-ONLY macro otherwise, or most correct macros that don't unintentionally capture?
dieggsy has quit [Ping timeout: 252 seconds]
<whoman> mfiano, i know =( special cases. is there a clean way to provide prefix on gensym? instead of say (gensym (concat ...)) ?
<mfiano> CONCAT is not even a Common Lisp operator.
<learning> gensym is fine, it's just you need something on top of it so that you don't have to do it by hand
<learning> it's hacky because it's too low level
<mfiano> I think that's the point
<whoman> pseudocode :|
<learning> don't we want the low level thing so we can just build it ourselves?
<mfiano> whoman: But what are you even trying to concatenate?
<mfiano> I think maybe you are confused what gensym is used for given your pseudocode
Oladon has quit [Quit: Leaving.]
<learning> it's not some complicated thing right. gensym's are just used to avoid two things being named the same thing, yeah?
jason_m has joined #lisp
<learning> i wonder how bad it would be to just define a function that creates multiline anonymous functions from a string lol
<learning> pretty sure it wouldn't work at all
<learning> prolly issues with variable lookup
<stacksmith> learning: what language are you talking about?
<k-hos> eval?
<stacksmith> Lisp does not do 'variable lookup' or care about 'multiline'
whoman has quit [Quit: Leaving]
whoman has joined #lisp
wxie has joined #lisp
<stacksmith> learning: All lisp function are lambdas. The Lisp implementation creates 'anonymous functions' from a string, and if needed, attaches them to symbols. may I suggest #clnoobs?
<learning> may i suggest passing the irc environment to your typing function, because you're missing some context
<learning> why am i laughing at such a dumb joke
<learning> i was talking about python
<stacksmith> May I suggest noticing that this is #lisp?
<learning> im pretty sure you can get the logs from the topic and read the whole convo
KarlDscc has quit [Remote host closed the connection]
<stacksmith> Sadly I did
<learning> instead of telling me to fuck off in 10 dif ways
<learning> you could just read
<mason> learning: Snark is more satisfying when one's at loose ends.
<stacksmith> You are still off-topic, troll.
<learning> dont come at me on irc if you dont know what the word troll means
<stacksmith> shitlisted.
<learning> millenials using netscape era vocab
<mason> stacksmith: If either of you is making the channel less pleasant, it's you. Please realize that whatever is bothering you has nothing to do with learning's rambling comparison.
<stacksmith> shitlisted.
<learning> XD
<mason> Also, clean up your foul language.
<mason> learning: For context, stacksmith feels like he's an old hand, having come in with his desperately important beginners questions in 2014, from what I can see.
<learning> oh he's fine
<learning> better that we have someone who's trying to drop knowledge than utter silence
<whoman> whoaaa
<whoman> phoe ?
<mfiano> May I suggest to you all to use this forum for proper questions and discussions regarding Common Lisp instead of putting people down. Thank you.
<learning> triggered
<learning> is that worth reading or only a jest
<whoman> the first paragraph is a nice little story; beyond that is up to you
<learning> like lisp, it will be what i make it
<beach> Good morning everyone!
<learning> good morrow cuz
Tobbi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wxie has quit [Quit: AtomicIRC: The nuclear option.]
safe has joined #lisp
nika has joined #lisp
smurfrobot has joined #lisp
vultyre has quit [Quit: Leaving]
damke_ has quit [Ping timeout: 264 seconds]
Pixel_Outlaw has joined #lisp
schoppenhauer has quit [Ping timeout: 240 seconds]
smasta has joined #lisp
schoppenhauer has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
Fare has quit [Ping timeout: 256 seconds]
smurfrobot has quit [Remote host closed the connection]
Naergon has joined #lisp
<Naergon> Hi. I dont know anything about lisp yet, but im looking for a language with this property: i can read a value from a file and use this value as an operation such as + * < etc? Without writing a hundred if-else, simply storing the value of whatever lisp considers a + ?
krwq has joined #lisp
smasta has quit [Ping timeout: 240 seconds]
<whoman> Naergon: yep!!
<Naergon> Yay
<Naergon> Usual answer is 'why do you even need this'
<whoman> especially with Lisp, with the 'read' function =) its a common thing to do stuff like that
<whoman> ^_^
<Naergon> Perfect, thank you =)
ludston_ has joined #lisp
ludston has quit [Ping timeout: 260 seconds]
ak5 has quit [Ping timeout: 256 seconds]
<learning> it'll be simpler too because of prefix notation
pierpa has quit [Quit: Page closed]
<learning> you won't have to worry about replacing shit like 1 + 2 + 5. it'll just be (+ 1 2 5) and you can use a variable like (my-var 1 2 5) where my-var will be set to + after reading the file
<Naergon> Perfect, variable as a operation is what i wanted
<Naergon> and the same but with more stuff like branches, cycles, jumps in code are also possible the same way, being read from a file?
Oladon has joined #lisp
<smokeink> of course
<beach> learning: It can be done of course, but not the way you show it.
<Naergon> and one more thing, what is expected 'build' time for a new code being read from a file and to the execution? seconds?
<learning> yes. oversimplification.
<Naergon> (Assuming several kb of code)
<stacksmith> Naergon: Lisp is a great language for metaprogramming - Lisp is designed to operate on code or data using Lisp.
<beach> Naergon: It is very fast.
<smokeink> Naergon: while developing, you don't have to recompile your whole application, you can just recompile the functions you modified.
<learning> lisp was made to be ran on really shitty computers. so it's really fast on modern ones.
<learning> compared to java/python
<beach> learning: Java and Python are very different cases.
<learning> yes but we're just talking about speed differences
<beach> Java execution is very fast, because a lot of effort has been put into optimizing the compiler. Python, on the other hand, is not that great.
<whoman> tangents. can we update topic for SBCL version? ^_^
<beach> So they are very different cases.
<learning> java is still slow in comparison
<learning> a car is much faster than a bike or walking
kark has joined #lisp
<whoman> ehe
<learning> yes a bike and walking are very different things
<learning> but the point is to show how fast the car is
<learning> not get into a philisophical argument about bikes and wlaking
kark has left #lisp ["WeeChat 2.0.1"]
sjl has quit [Ping timeout: 248 seconds]
smasta has joined #lisp
<Naergon> What about REPL (read-execute-print-loop) type of usage, where i want my code to be updated in text editor often, can it work at about 1 second for this task for small project? (so i start a script, it reads the code, executes programm, prints it output, and returns to text editor)
<learning> yes
thallia has quit [Ping timeout: 256 seconds]
<learning> you should develop in real time if you are capable of building or using the tools to do so imo
<Naergon> Perfect, thank you
kark has joined #lisp
<beach> Naergon: We don't use the term "script". You are constantly in communication with your Common Lisp system, and you can incrementally modify the code in that system, by hitting a few keys in your text editor or by loading a file containing definitions.
<learning> it's not that hard to hack together a solution if you know how to make hotkeys
<White_Flame> the only thing you need to concern yourself about hot edits is make sure your functions actually exit or call each other; any "main loop" function will still keep running old code even if you replace the implementation with a new version
<Naergon> Yes, i found a vim plugin for it
<whoman> White_Flame: good point. side note: unless CLOS?
quotation has joined #lisp
<White_Flame> yes, that would be a specific case of "make sure your functions call each other" instead of being monolithic in a single function that doesn't return
<beach> Naergon: Also notice that modern Common Lisp systems compile on the fly, so that a function definition that you type at the REPL or that you load from a file will be compiled to native code automatically.
<learning> is that true
<whoman> White_Flame: ohh, right. the fun itself which doesnt return, not the symbols to which it refers. (ocaml was terrible for this, but great in all the other repl-like ways)
<learning> im pretty sure you have to tell it to compile?
<beach> learning: I recommend you be less sure.
<learning> otherwise it doesn't give you the compiled verison back. it gives you this slower function
<whoman> interpreted ?
<White_Flame> the standard allows for implementations to distinguish "compiled" and "not compiled" functions, but most implementations don't bother
thallia has joined #lisp
<beach> learning: SBCL: (defun f (x) (+ x 2)) => F
<learning> im pretty sure ive played around with this like a year or two ago and there was a difference between when i explicity compiled and when i didn't
<beach> learning: (compiled-function-p #'f) => T
<stacksmith> Sigh.
<beach> stacksmith: What's the matter?
<Naergon> And evolving turing machines, genetic algorithms and simikar concepts are bedt in lisp too, right?
<learning> ye, compiled-function-p returns true on ccl
<beach> Naergon: Common Lisp is a general-purpose programming language that is capable of most things that other languages allow, so it is usually better independently of the application domain. But yeah, if you are going to transform code, then Common Lisp is a good choice.
<learning> but id need to speed test it
<learning> because thats what i did before
<White_Flame> learning: again, most implementations only bother having 1 form of executable function
<stacksmith> beach: just annoyed at certain parties' desire to blab ignorance.
<beach> I know what you mean.
<Naergon> beach: thank you again =) i wonder why i didnt find it before
<White_Flame> especially if compiled-function-p returns true, that's a reasonable hint that it's going to run the same
bmgxc9 has quit [Remote host closed the connection]
Murii has joined #lisp
<beach> Naergon: Oh, it's a common situation. I hope you have plenty of time to make up for the lost years. :)
<learning> white_flame: that would make the most sense to me. maybe im just remembering something else.
<White_Flame> people tend to use COMPILE to avoid having EVAL, even though for defining functions, it's generally equivalent
<learning> like, (compile (load file)) should be pointless then right
<White_Flame> the syntax would be wrong
<learning> ugh. i think im just tired. can't even remember the file to find the source im trying to remember
<learning> yeah i know trying to find the file im talking about
<White_Flame> you don't compile files, you compile individual functions
<White_Flame> ah, there is compile-file as well
<learning> ye
<learning> maybe im mixing up compile-file with compile
<White_Flame> but still, you don't need to specify it. Just load/read your code and it's in & compiled for popular implementations
<White_Flame> let slime, asdf, etc worry about compiling files
<learning> or maybe it was for some esoteric thing i was doing at the time and now i dont remember the context
ebzzry_ has joined #lisp
<ebzzry_> Is there a way for Woe to serve the local directory?
<ebzzry_> Or, what is the equivalent of 'python3 -m http.server 8080' in CL?
Chream_ has quit [Read error: Connection reset by peer]
Chream_ has joined #lisp
Chream_2 has joined #lisp
Chream_ has quit [Read error: Connection reset by peer]
ludston_ has quit [Read error: Connection reset by peer]
ludston has joined #lisp
thallia has quit [Ping timeout: 252 seconds]
thallia has joined #lisp
smurfrobot has joined #lisp
thallia has quit [Ping timeout: 260 seconds]
thallia has joined #lisp
tkd has quit [Remote host closed the connection]
stacksmith has quit [Read error: Connection reset by peer]
tkd has joined #lisp
stacksmith has joined #lisp
learning has quit [Remote host closed the connection]
kark has quit [Quit: ZNC 1.6.5+deb1 - http://znc.in]
kark has joined #lisp
Pixel_Outlaw has quit [Quit: Leaving]
smurfrobot has quit [Remote host closed the connection]
tkd has quit [Quit: WeeChat 1.4]
learning has joined #lisp
Kevslinger has quit [Quit: Connection closed for inactivity]
smurfrobot has joined #lisp
stacksmith has quit [Ping timeout: 256 seconds]
kark has quit [Quit: ZNC 1.6.5+deb1 - http://znc.in]
kark has joined #lisp
tkd has joined #lisp
Patternmaster has joined #lisp
thallia has quit [Ping timeout: 248 seconds]
thallia has joined #lisp
damke_ has joined #lisp
stacksmith has joined #lisp
smurfrobot has quit [Remote host closed the connection]
wxie has joined #lisp
wheelsucker has quit [Ping timeout: 268 seconds]
Naergon has quit [Remote host closed the connection]
Vicfred has joined #lisp
wxie has quit [Ping timeout: 240 seconds]
learning has quit []
smokeink has quit [Remote host closed the connection]
fourier has joined #lisp
smokeink has joined #lisp
void_pointer has joined #lisp
iridioid has joined #lisp
smasta has quit [Ping timeout: 256 seconds]
smurfrobot has joined #lisp
bmgxc9 has joined #lisp
bmgxc9 has quit [Max SendQ exceeded]
bmgxc9 has joined #lisp
wxie has joined #lisp
saki has quit [Remote host closed the connection]
BitPuffin has joined #lisp
makomo has joined #lisp
saki has joined #lisp
bmgxc9 has quit [Remote host closed the connection]
wxie has quit [Ping timeout: 240 seconds]
marusich has quit [Quit: Leaving]
fourier has quit [Ping timeout: 248 seconds]
kotrcka has joined #lisp
<kotrcka> #join #haskell
Murii has quit [Ping timeout: 268 seconds]
<kotrcka> sorry
Murii has joined #lisp
quotation has quit [Quit: Connection closed for inactivity]
learning has joined #lisp
ryanbw has quit [Quit: WeeChat 2.0.1]
smaster has joined #lisp
iridioid has quit [Ping timeout: 256 seconds]
wxie has joined #lisp
<phoe> ebzzry_: woe?
<phoe> oh, fukamachiware
<phoe> ebzzry_: it looks like you should be able to do it with clack
<phoe> (clack:clackup (make-instance '<clack-app-directory> :root (truename ".")) :port 8080 :server :woo)
fikka has joined #lisp
<phoe> but again, this is just my speculation
<phoe> if anything, throw issues at fukamachi for writing no sensible documentation for his code whatsoever.
wxie has quit [Quit: AtomicIRC: The nuclear option.]
<beach> There might be a language issue.
<Shinmera> Well he doesn't write any documentation in Japanese either
MetaYan has quit [Ping timeout: 240 seconds]
<beach> Hmm, yes, I see.
MetaYan has joined #lisp
wxie has joined #lisp
<ebzzry_> phoe: let me try that
<ebzzry_> Does he write documentation in Japanese?
<phoe> ebzzry_: he doesn't write any sensible documentation at all.
<phoe> he writes efficient code that probably only he knows how to appropriately read and debug.
damke has joined #lisp
<ebzzry_> phoe: Oh, how about docstrings?
<Shinmera> just see for yourself, the code is open.
damke_ has quit [Ping timeout: 264 seconds]
learning has quit []
wxie has quit [Ping timeout: 255 seconds]
solyd has joined #lisp
<shrdlu68> (let ((acc (make-instance 'hunchentoot:easy-acceptor :port 8080)))
<shrdlu68> (setf (hunchentoot:acceptor-document-root acc) "~/Downloads/")
<shrdlu68> (hunchentoot:start acc))
<phoe> shrdlu68: that's a case for average Lisp software
<phoe> it isn't that trivial in case of fukamachiware.
Patternmaster has quit [Quit: leaving]
<smokeink> don't bother with issues, he'll most probably tell you "You're not using the code properly - you should use clack's plugin for that" or something similar, with no additional details. After I encountered bugs with one of his programs I stopped using fukamachiware
smurfrobot has quit [Remote host closed the connection]
<Murii> If I have a function and I pass to it some arguments how can I change the global value of these arguments whitin the function itself witout telling to modify directly the global variables but the arguments which will reflect on the global variables?
<beach> You can't.
<Murii> shit
<beach> Common Lisp is call-by-value.
<beach> You can modify the OBJECT that you pass in, but not the binding of the variable.
<beach> Murii: There are very few modern programming languages, if any, that would allow that.
<Murii> basically you can modify locally the variable but globally it will be the same?
<beach> You will then modify the lexical binding inside the function, yes.
smurfrobot has joined #lisp
<Murii> alright
<Murii> thanks!
<beach> Here, call-by-value, means that the argument is evaluated, and then the VALUE of the argument is passed to the function.
<beach> How that value was obtained is lost by the time you are inside the function.
<beach> If you are willing to change the signature of the function, you can do this...
<shrdlu68> Declarig variables special would get what he wants, right?
<beach> (fun *bla* (lambda (x) (setf *bla*) x))
<Murii> I'm asking because I have a main function,lets call it 'a' and another function,'b',. 'a' holds 'b' but in 'b' I modify some values and in 'a' I new the newly modified values to work with
<beach> shrdlu68: The variable would still have to be explicitly mentioned in the function then.
<Murii> I need the newly*
<beach> Murii: What does it mean for one function to hold another function?
<Murii> 'b' is called in 'a'
<phoe> Murii: depends on what you mean by "modify"
<phoe> 1) look at where the variable is bound.
<beach> You can make your functions return multiple values and make one of them the new value of the variable.
<shrdlu68> Murii: Why not just return the modified object?
smurfrobot has quit [Ping timeout: 240 seconds]
<phoe> if you bind a dynamic variable in A and modify it in B, then you will be able to use the new value afterwards in A.
<phoe> also what shrdlu68 said.
<Murii> Well, I was thinking in doing that but the only way will be by returning a list() and then use nth to bind,right?
<phoe> Murii: nope, functions in Lisp can return multiple values
<beach> clhs values
<phoe> (defun foo () (values 1 2 3))
<phoe> (multiple-value-bind (a b c) (foo) (print a) (print b) (print c))
<jackdaniel> (mapc #'print (multiple-value-list (values 1 2 3)))
<Murii> phoe: so what exactly would be the output of 'foo' ?
<Murii> (1 2 3) ?
<phoe> Murii:
<shrdlu68> (values 1 2 3)
<phoe> 1
<phoe> 2
<phoe> 3
<phoe> where 1 is the primary value
<phoe> not a list (1 2 3) because that would be one value.
<phoe> (print (foo)) ;=> 1
<phoe> by default, non-primary values are discarded in most functions. you need to explicitly use them.
<Murii> so how do you access the second values using (foo) ?
<beach> He just showed that.
<beach> clhs multiple-value-bind
<aeth> You can also use multiple-value-call, e.g. (multiple-value-call #'format t "~A ~A ~A~%" (foo))
mjl_ has joined #lisp
milanj has joined #lisp
shrdlu68 has quit [Ping timeout: 264 seconds]
Arcaelyx_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pjb> Murii: so how you do it: you return the new value, and you mutate the state outside of the function!
<pjb> Murii: for example: (setf list (delete item list))
<pjb> Murii: (defun foo (x) (+ 2 x)) (let ((v 42)) (setf v (foo v)) v) #| --> 44 |#
<pjb> Murii: notice that there's a define-modify-macro macro so that you can write: (define-modify-macro foof () foo) (let ((v 42)) (foof v) v) #| --> 44 |#
<Murii> Now I'm able to manage it
<Murii> thanks all!
smurfrobot has joined #lisp
<pjb> Murii: notice that this promote the functional style: write your functions so that it doesn't mutate external state. Therefore they become easy to test and debug. Therefore there's fewer bugs in your programs. All nice.
shrdlu68 has joined #lisp
mlf has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
smurfrobot has quit [Ping timeout: 248 seconds]
Oladon has quit [Quit: Leaving.]
smurfrobot has joined #lisp
random-nick has joined #lisp
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
fourier has joined #lisp
fourier has quit [Remote host closed the connection]
smurfrobot has quit [Remote host closed the connection]
tankrim has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
d4ryus1 is now known as d4ryus
mjl_ has quit [Quit: Lost terminal]
orivej has joined #lisp
nullman has quit [Remote host closed the connection]
nullman has joined #lisp
nirved has joined #lisp
zacknite has joined #lisp
<zacknite> Why do Lisp programmers support Trump more than other programmers?
<zacknite> What is the meaning behind this correlation?
<Shinmera> Try trolling elsewhere
<zacknite> I'm not trolling, just curious!
<Shinmera> Yes you are.
<Shinmera> Now please spend your time with something else.
<zacknite> A like of unorthodox things perhaps that leads one to both of those things incidentally?
<beach> Shinmera: drop it.
<zacknite> Honestly not trying to troll, I can't be the only one who notices this. Or is this chat only for technical discussion?
Chream_2 has quit [Read error: Connection reset by peer]
Chream_ has joined #lisp
Chream_2 has joined #lisp
Chream_ has quit [Read error: Connection reset by peer]
zacknite has left #lisp [#lisp]
shka has joined #lisp
Chream_ has joined #lisp
Chream_2 has quit [Read error: Connection reset by peer]
Chream_2 has joined #lisp
Chream_ has quit [Read error: Connection reset by peer]
<pjb> zacts: there's #lispcafe for this.
<phoe> pjb: it's not zacts, the person already left.
<pjb> ok.
<aeth> I didn't want to mention #lispcafe
<aeth> There's off-topic and then there's topics that are beyond off-topic.
<pjb> There's nothing off-topic in #lispcafe. It's the #emacs of #lisp…
<aeth> #lispcafe is the most on-topic off-topic channel in Freenode
Chream_2 has quit [Read error: Connection reset by peer]
Chream_ has joined #lisp
<pjb> aeth: And you don't see the correlation with Trump support! :-)
python476 has joined #lisp
Chream_2 has joined #lisp
Chream_ has quit [Read error: Connection reset by peer]
<aeth> A lot of the time #lispcafe is overflow of on-topic things because something's even more on-topic here.
heurist_ has quit [Ping timeout: 240 seconds]
heurist_ has joined #lisp
nullman has quit [Remote host closed the connection]
<beach> In a special form like LET or LET* that takes a body with declarations, should we not indent the declarations one column more than the forms of the body?
<phoe> How much do you indent the bindings in LET now?
<Shinmera> Hrm. I don't know how much I like that since it goes against conventions
<beach> phoe: 4 position compared to the (LET itself.
<shrdlu68> As long as it's consistent, i.e do the same for functions, macros, etc.
<pjb> beach: if you indent declarations in general, yes why not. Same as in lambda, locally, etc.
<shrdlu68> But I'd rather not.
<beach> phoe: But normally, the bindings are on the same line as the (LET so they get aligned that way instead.
<pjb> But if you do that, do it also for docstrings. Remember that docstrings can be mixed in the middle of declarations.
<beach> pjb: Sure.
<pjb> (defun foo () (declare (foo)) "this documents" (declare (bar)) "this is the result")
<pjb> (defun foo () (declare (foo)) (declare (bar)) "this documents" "this is the result")
<beach> pjb: If I do it, I'll do it consistently for both kinds of `body', i.e. the ones that allow docstrings and the ones that don't.
<pjb> (defun foo () (declare (foo)) (declare (bar)) "this is the result") ; no docstring!
<shrdlu68> One vexing this is how multiline docstrings don't align.
<shrdlu68> s/this/thing
<beach> pjb: I know the rule, or rather, I know where to find it.
milanj has quit [Read error: Connection reset by peer]
<beach> shrdlu68: That's why I use #.(format nil ...)
<pjb> beach: my hint is that it's not a bad idea to indent declarations and docstrings differently from the body expressions, if it's indeed done consistently and correctly.
<beach> shrdlu68: That way I can use ~@ in the docstring, and indent the following lines.
<beach> pjb: Understood.
<shrdlu68> beach: clever.
<beach> shrdlu68: Thanks!
<smokeink> has anyone gone through this tutorial and understood the mechanics of the VM it describes? https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/ I don't get it why each stack slot has its own code-page (and this is vital for understanding how (NEXT) works )
Chream_2 has quit [Read error: Connection reset by peer]
Chream_ has joined #lisp
nullman has joined #lisp
<pjb> Once I defined a document macro that I used with #. for docstrings. It could handle alternate localizations of the documentation…
Chream_ has quit [Read error: Connection reset by peer]
<ebzzry_> shrdlu68: How do I make that automatically serve index.html?
Chream_ has joined #lisp
<shrdlu68> ebzzry_: What do you mean by automatically?
<phoe> so that http://foo/ autoserves http://foo/index.html?
<beach> Shinmera: It would be optional, of course.
Chream_ has quit [Read error: Connection reset by peer]
Chream_2 has joined #lisp
Chream_2 has quit [Read error: Connection reset by peer]
kotrcka has quit [Quit: leaving]
Chream_ has joined #lisp
<phoe> I wouldn't indent them but would instead color them differently, just like docstrings are colored differently nowadays
<phoe> ...but I'm a color person, so I might not be in the majority
<phoe> I kind of wish declarations were more greyish compared to usual text, so the rest of code stands out more among them
safe has quit [Read error: Connection reset by peer]
<phoe> this could increase readability in heavily declaretype'd code.
<shrdlu68> ebzzry_: By defining an easy handler for "/". Hunchentoot has great documentation: https://edicl.github.io/hunchentoot/#reference
<ebzzry_> shrdlu68: thanks
damke_ has joined #lisp
kdridi has joined #lisp
damke has quit [Ping timeout: 263 seconds]
krwq has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 276 seconds]
smurfrobot has joined #lisp
<shrdlu68> ebzzry_: Something like this: https://plaster.tymoon.eu/view/714#714
shrdlu68 has left #lisp ["Trail won't ride itself"]
<phoe> ...I just realized that Plaster has Lisp coloring
<phoe> I kind of want it to become the new lisppaste but I'm also worried it might share the same fate as it
fikka has joined #lisp
<pjb> Indeed, in fontification not only color should be used, but also bold, italic and underline, since there are color blind people.
<pjb> Also, why not, use different fonts, or different unicode characters, such as 𝔣𝔯𝔞𝔠𝔱𝔲𝔯, 𝗆𝖺𝗍𝗁𝖾𝗆𝖺𝗍𝗂𝖼𝖺𝗅 𝗌𝖺𝗇𝗌 𝗌𝖾𝗋𝗂𝖿, 𝚘𝚛 𝚖𝚊𝚝𝚑𝚎𝚖𝚊𝚝𝚒𝚌𝚊𝚕 𝚖𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎.
<phoe> I think it's trivial with CSS. Just supply a color-blind-mode CSS that replaces the styles.
sz0 has joined #lisp
<pjb> I would guess beach uses McCLIM, not CSS…
<phoe> Oh wait, i was talking about Shinmera's plaster.
quazimodo has joined #lisp
<phoe> And you're talking about his Climacs fontification.
makomo has quit [Ping timeout: 248 seconds]
nowhere_man has quit [Read error: Connection reset by peer]
wxie has joined #lisp
nowhere_man has joined #lisp
pagnol has joined #lisp
<beach> Color and font changes would definitely be an option too.
smurfrobot has quit [Remote host closed the connection]
shelvick has quit [Quit: EliteBNC - http://elitebnc.org (Auto-Removal: idle account/not being used)]
dddddd has joined #lisp
Chream_ has quit [Ping timeout: 240 seconds]
lonjil has quit [Ping timeout: 256 seconds]
Karl_Dscc has joined #lisp
lonjil has joined #lisp
kdridi has quit [Remote host closed the connection]
kdridi has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
kdridi has quit [Ping timeout: 268 seconds]
kdridi has joined #lisp
makomo has joined #lisp
nowhereman_ has joined #lisp
ebzzry_ has quit [Ping timeout: 240 seconds]
nowhere_man has quit [Ping timeout: 240 seconds]
EvW has joined #lisp
fikka has joined #lisp
Fare has joined #lisp
ebzzry_ has joined #lisp
raynold has quit [Quit: Connection closed for inactivity]
markong has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
smaster has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
Tobbi has joined #lisp
ebzzry_ has quit [Ping timeout: 248 seconds]
python476 has quit [Read error: Connection reset by peer]
fikka has quit [Remote host closed the connection]
fikka has joined #lisp
smurfrobot has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
python476 has joined #lisp
wxie has quit [Ping timeout: 240 seconds]
ebzzry_ has joined #lisp
MetaYan has quit [Ping timeout: 240 seconds]
MetaYan has joined #lisp
makomo_ has joined #lisp
makomo has quit [Ping timeout: 276 seconds]
random-nick has quit [Remote host closed the connection]
smaster has joined #lisp
random-nick has joined #lisp
smaster has quit [Ping timeout: 268 seconds]
fikka has joined #lisp
smurfrobot has quit [Remote host closed the connection]
pagnol has quit [Ping timeout: 240 seconds]
kdridi has quit [Remote host closed the connection]
kdridi has joined #lisp
smurfrobot has joined #lisp
smurfrobot has quit [Ping timeout: 256 seconds]
attila_lendvai has joined #lisp
pagnol has joined #lisp
fdund has joined #lisp
trocado has joined #lisp
Kevslinger has joined #lisp
kdridi has quit [Remote host closed the connection]
kdridi has joined #lisp
<shka> good day
kdridi has quit [Read error: No route to host]
kdridi has joined #lisp
random-nick has quit [Remote host closed the connection]
smaster has joined #lisp
<beach> Hello shka.
<shka> beach: hello there, what you are doing?
<beach> Right now I just got up from a nap. Otherwise, I am working on indentation functions in the editor.
<beach> What about you?
<shka> cool
<shka> added some boring linear regression functions to cl-data-structures, I will probably do some house work now
smurfrobot has joined #lisp
<Xach> I am dismayed by the number of new failures at http://report.quicklisp.org/2018-02-18/failure-report.html
<Xach> (that is what i am doing)
<shka> oh
pagnol has quit [Ping timeout: 240 seconds]
<Xach> The trouble for me is new failures in old projects
<shka> and cepl
<Xach> Things that haven't updated in a while are now failing
<shka> and blackbird!
<Xach> I haven't changed my setup that I know of
<beach> That's worrisome.
<Xach> I did find that some projects fail to test if you have something running on port 8000
<shka> uhm
<Xach> They set up example services on port 8000
Karl_Dscc has quit [Remote host closed the connection]
Chream_ has joined #lisp
ninegrid has quit [Quit: leaving]
ninegrid has joined #lisp
<jackdaniel> maybe some common dependency changed
<jackdaniel> and broke them
rumbler31 has joined #lisp
random-nick has joined #lisp
milanj has joined #lisp
<jackdaniel> however looking at random failure log it seems that asdf can't find secondary system
smaster has quit [Ping timeout: 276 seconds]
Chream_ has quit [Read error: Connection reset by peer]
<Xach> You can essentially ignore anything with mabragor or gendl in it
<Xach> and I think cepl has a common cause
<Xach> But there are a number of other problems that perplex me
Chream_ has joined #lisp
smurfrobot has quit [Remote host closed the connection]
<Xach> http://report.quicklisp.org/2018-02-18/failure-report/trivialib.bdd.html#trivialib.bdd.test for example is a new failure in a project that has not changed in years
smaster has joined #lisp
<jackdaniel> and what is your asdf:*compile-file-warnings-behaviour* ?
<Xach> jackdaniel: the default
Murii has quit [Ping timeout: 256 seconds]
<jackdaniel> fwiw the default has changed a few times during the course of asdf development
<jackdaniel> on my sbcl version its value is :warn
<Xach> I have not changed my asdf or sbcl setup since the last quicklisp update
dieggsy has joined #lisp
<Xach> But the failures are all quite different
<Xach> Hmmmmm
<jackdaniel> I would try loading manually systems and replacing dependencies gradually to older versions
<jackdaniel> to pin-point what is the cause of break (because in such circumstances my bet is on some common dependency messing with the reader or asdf or something else)
<jackdaniel> s/manually systems/manualy suspicious system/
smurfrobot has joined #lisp
Baggers has joined #lisp
smurfrobot has quit [Ping timeout: 256 seconds]
<dim> git bissect?
<dim> (I mean, is it possible to automate that, as like what git bissect is doing?)
smaster has quit [Ping timeout: 256 seconds]
Amplituhedron has joined #lisp
xoreaxeax has joined #lisp
jstypo has quit [Read error: Connection reset by peer]
pagnol has joined #lisp
<jackdaniel> you'd have to compute all A system dependencies (recursively) and pick half of them to downgrade, not sure if easy to automate
makomo_ has quit [Ping timeout: 256 seconds]
Bike has joined #lisp
wigust has joined #lisp
jstypo has joined #lisp
trocado has quit [Ping timeout: 240 seconds]
EvW has quit [Ping timeout: 255 seconds]
Amplituhedron has quit [Ping timeout: 268 seconds]
Chream_ has quit [Read error: Connection reset by peer]
Chream_ has joined #lisp
Chream_2 has joined #lisp
Chream_ has quit [Read error: Connection reset by peer]
knicklux has joined #lisp
klltkr has joined #lisp
EvW has joined #lisp
makomo_ has joined #lisp
<Xach> My current setup is easy for latest, hard for not-latest
saki has quit [Remote host closed the connection]
nsrahmad has joined #lisp
* Xach looks into fiveam
<Xach> aha. i think that may be the common element, changed two days ago
attila_lendvai has quit [Read error: Connection reset by peer]
Sheilong has joined #lisp
<Xach> yes, that's it.
varjag has joined #lisp
<Xach> scymtym: you have made some "recent" changes to fiveam - are you up for troubleshooting today?
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<Xach> or fe[nl]ix?
<fe[nl]ix> yes
<Xach> scymtym, fe[nl]ix: my example case is (ql:quickload "introspect-environment-test" :verbose t)
<fe[nl]ix> at your service
<Xach> fe[nl]ix: with the latest fiveam, it fails - older fiveam succeeds.
<Xach> fe[nl]ix: i don't really know much beyond that
<fe[nl]ix> I'm looking into it
<Xach> Thanks.
<fe[nl]ix> found the ofending commit cc23df4700d6
<fe[nl]ix> scymtym: I might have to revert that
jason_m has quit [Quit: Leaving]
pagnol has quit [Ping timeout: 260 seconds]
trocado has joined #lisp
saki has joined #lisp
<Xach> Will do
<fe[nl]ix> thanks
<fe[nl]ix> I still don't understand the breakage
<fe[nl]ix> the code block that fails has a comment "haha oh man"
klltkr has quit [Ping timeout: 260 seconds]
<phoe> xD
<Xach> fe[nl]ix: well, it's not the only one - i can find other examples without suspicious comments
<fe[nl]ix> other libraries ?
<Xach> project has not changed since 2016, new failure
makomo_ has quit [Ping timeout: 260 seconds]
makomo_ has joined #lisp
trocado has quit [Ping timeout: 264 seconds]
fourier has joined #lisp
nsrahmad has quit [Quit: Leaving]
fourier has quit [Changing host]
fourier has joined #lisp
smurfrobot has joined #lisp
knicklux has quit [Ping timeout: 260 seconds]
wxie has joined #lisp
smurfrobot has quit [Ping timeout: 256 seconds]
drewc has quit [Ping timeout: 276 seconds]
fdund has quit [Ping timeout: 256 seconds]
Naergon has joined #lisp
knicklux has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
fourier has quit [Ping timeout: 265 seconds]
drewc has joined #lisp
attila_lendvai has joined #lisp
smokeink has quit [Quit: peace]
<fe[nl]ix> Xach: I reverted and made a new release
lonjil has quit [Quit: WeeChat 2.0.1]
attila_lendvai has quit [Read error: Connection reset by peer]
wxie has quit [Ping timeout: 240 seconds]
attila_lendvai has joined #lisp
fdund has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
slyrus has joined #lisp
kdridi has quit [Read error: Connection reset by peer]
kdridi has joined #lisp
<Xach> fe[nl]ix: I'll try it, thanks
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
pagnol has joined #lisp
shrdlu68 has joined #lisp
smcnamara has joined #lisp
fdund has quit [Quit: leaving]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
Khisanth has quit [Ping timeout: 240 seconds]
attila_lendvai has quit [Read error: Connection reset by peer]
solyd has quit [Remote host closed the connection]
pagnol has quit [Ping timeout: 240 seconds]
shifty has quit [Ping timeout: 248 seconds]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
xoreaxeax has quit [Quit: Page closed]
dieggsy has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
attila_lendvai has quit [Read error: Connection reset by peer]
smurfrobot has joined #lisp
Khisanth has joined #lisp
attila_lendvai has joined #lisp
smurfrobot has quit [Remote host closed the connection]
orivej has joined #lisp
vultyre has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
epony has quit [Ping timeout: 256 seconds]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
EvW has quit [Ping timeout: 255 seconds]
saki has quit [Read error: Connection reset by peer]
jmercouris has joined #lisp
saki has joined #lisp
Arcaelyx has joined #lisp
nika has quit [Quit: Leaving...]
fourier has joined #lisp
sz0 has quit [Quit: Connection closed for inactivity]
kotrcka has joined #lisp
pagnol has joined #lisp
st_iron has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
lxpup_24904 has joined #lisp
klltkr has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
lxpup_24904 has quit [Quit: Leaving]
<Naergon> How does lisp deals with memory allocation, garbage collection and similar things?
<Shinmera> It deals with it by not specifying it. Or in other words, it's up to the implementation.
<Xach> Naergon: did you have a specific concern that prompted the question?
<Naergon> just trying to compare it with other languages that have GC and that dont have GC
<phoe> Naergon: the question is too general.
<Xach> phoe: Not really?
<Xach> phoe: It's general, but too general? It has a general answer.
<phoe> Hm. Well.
<phoe> When Lisp needs to allocate, it allocates, when it needs to collect, it collects. Just like all other GCed languages.
<Xach> Each implementation is free to do what it wants.
<Shinmera> An implementation does not have to GC
<phoe> Well. Correct.
<Xach> In practice each usually does something useful by default. It may not be suitable for all workloads.
<Xach> Some can be tuned easily, others can't.
<phoe> Except I've yet to see a GCless implementation that isn't bocl or something like that.
<Shinmera> Lisp is not a GCd language either, it's just easier to implement with a GC.
<jackdaniel> Naergon: this fairly recent post https://medium.com/@MartinCracauer/llvms-garbage-collection-facilities-and-sbcl-s-generational-gc-a13eedfb1b31 touches some parts of SBCL's GC
<jackdaniel> SBCL is one one the Common Lisp implementations
<jackdaniel> (it tackles the topic from LLVM perspective)
<jackdaniel> ECL on the other hand simply uses Boehm GC (commonly present on linux systems as libgc.so)
<jackdaniel> Clasp uses MPS afair (memory pool system)
<Shinmera> Clasp uses Boehm primarily still
<Shinmera> But the end goal is the MPS
<jackdaniel> uhm, thanks
<shrdlu68> I've always wondered whether an implementation could just deal with memory the way C programmers do.
<Shinmera> Sure could.
<Shinmera> Conforming programs would quickly crash on your system, though.
<shrdlu68> Why?
<Shinmera> Out of memory.
<jackdaniel> shrdlu68: you do (list 1 2 3) in a function - that's basically a malloc
<jackdaniel> without GC you don't have free operation
<jackdaniel> so you accumulate all new data
<Xach> Quickly?
<Xach> I have lots of memory! So much!
<shrdlu68> Oh, leaks. Nah, the implementation simply notices when something can no longer be references and calls free.
<jackdaniel> in worst case it will wrap from 0 :-)
<Shinmera> shrdlu68: That's called a GC
<jackdaniel> shrdlu68: that's basically gc (I've smiled :-)
<shrdlu68> Well, I had something less fancy in mind.
<Xach> If I allocated 1k per second I wouldn't run out of memory for 185 days
<shrdlu68> Isn't it essentially how C programmers do it?
<shrdlu68> "Manual" GC.
<Xach> the 186th day is a vacation day
<jmercouris> They don't really do garbage collection, they manually alloc and dealloc/free memory spaces
<jackdaniel> shrdlu68: C programmers sometimes use libgc. Usually though they call free themself when data is not needed
<jackdaniel> but it's not C implementation what detects such situation, it's C programmer
<jmercouris> garbage collection as a term is usually reserved for any "freeing" that is done automatically by some system
<jackdaniel> and he still can (erronously) access freed memory
<jackdaniel> and sometimes it even works, until it stops working ! :-)
<shrdlu68> Exactly. Put the implementation in the exact same shoes.
<jackdaniel> that's why GC buys us so much - it removes a whole class of bugs. On the other hand it makes performance less predicitlbe
<fourier> c/c++ programmers are controlling the life time of objects they create on a heap manually
<jackdaniel> shrdlu68: if implementation detects when objects are not referenced and removes them, then this implementation implements garbage collector
<jackdaniel> that's the very definition of GC
<shrdlu68> I'm familiar with memory management - I once implemented once in asm.
<fourier> wondering though if the implementation could instead of gc wrap everything in reference-counted objects like c++ smart pointer.
* jackdaniel drops to watch chinease cartoons, cyas \o
<jmercouris> fourier: I don't see why not
<shrdlu68> What I had in mind was more like what you'd do if given some CL code to translate to C.
<jmercouris> I was having a discussion about that approximately a month ago where I argued that a manaul reference count based system would be more performant than any "automatic" gc
<fourier> yes thats why c++ exists and kicks
<jmercouris> yeah, everyone seemed to believe the opposite though :D
<Shinmera> reference counting is slow as balls.
<jmercouris> or maybe I am misremembering
<jmercouris> nah, seems I am remembering correctly lol
mlf has joined #lisp
<k-hos> *not common lisp
<shrdlu68> k-hos: Nope. What I have in mind is an implementation that naively translates CL to C, therefore instead of a GC you'd simply have malloc/calloc/free, etc.
<k-hos> you would have a hell of a time trying to get that work without ending up with another gc
<phoe> shrdlu68: you still need some kind of reference counting or other mechanism
<phoe> shrdlu68: (defparameter *foo* (make-huge-object))
<k-hos> reference counting breaks down in circular references as well
<phoe> how do you remember that the value of *foo* is now something that takes up memory?
<phoe> at some point later in your code someone calls (setf *foo* 2)
<k-hos> which is why languages generally go for a full gc rather than a more c++ setup
cmatei has quit [Ping timeout: 256 seconds]
<phoe> this is the last moment when you can free that object, later it'll be inaccessible and a memory leak.
<phoe> unless you figure out a clever way in which SETF checks if the object is otherwise inaccessible, *somehow*,
<phoe> and calls free() if it is.
<phoe> but reference counting will fail as Lisp is full of circularities, and other techniques essentially mean implementing a GC anyway,.
<phoe> so, in other words, "you'd simply have malloc/calloc/free" is a unicorn.
<Shinmera> For a language that doesn't have GC and no explicit memory management, see Rust. Though for that to work you need a lot of language support.
<phoe> yes, Rust has very nice concepts for memory management.
cmatei has joined #lisp
<shrdlu68> A sufficiently clever compiler is a CL programmer tasked with translating some CL code to assembly.
<shrdlu68> i.e it would figure out what you're trying to do and simply figure out how to do it in assembly.
<k-hos> so SBCL?
<phoe> shrdlu68: compilers were invented so CL programmers would *not* need to hand-translate Lisp into assembly
<phoe> yes, SBCL
<k-hos> :p
random-nick has quit [Read error: Connection reset by peer]
kdridi has quit [Remote host closed the connection]
python476 has quit [Read error: Connection reset by peer]
<Naergon> Does lisp have an api/analogue/glue for cuda/gl/mobile gl? General computations on video cards
<k-hos> there is cl-opengl for common lisp
<Shinmera> Naergon: What do you mean? A lisp dialect that runs on the GPU?
python476 has joined #lisp
<phoe> Naergon: for GLs, ask on #lispgames
<Shinmera> Or simply APIs to talk to the GPU
Murii has joined #lisp
<phoe> Naergon: Lisp has CFFI through which it can talk to C programs, so anything that you can interface from C is something you can interface from Lisp.
<Naergon> phoe: nice, thanks
<Naergon> Shinmera: yes, that would be an ideal
<Shinmera> Well since graphics vendors haven't given us a way to write assembly for their cards, there isn't really one. There are minor things like Varjo that emit GLSL.
<Shinmera> So you can write GLSL with lisp syntax (and partial lisp semantics)
kdridi has joined #lisp
damke_ has joined #lisp
fourier has quit [Ping timeout: 276 seconds]
klltkr has quit [Ping timeout: 260 seconds]
pfdietz_ has joined #lisp
attila_lendvai has joined #lisp
<pfdietz_> The failure mode for gc-ed languages is not referencing freed memory but leaks due to references keeping data from being gc-ed.
krwq has joined #lisp
<pfdietz_> Weak pointers of various kinds can be helpful.
cmatei has quit [Ping timeout: 256 seconds]
cmatei has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
froggey has quit [Remote host closed the connection]
froggey has joined #lisp
lonjil has joined #lisp
kotrcka is now known as pet84rik
kotrcka has joined #lisp
kotrcka has quit [Remote host closed the connection]
pet84rik is now known as kotrcka
random-nick has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
Bicyclidine has joined #lisp
<slyrus> is the slime github issue tracker the best for issues, or should they go to slime-devel?
attila_lendvai has joined #lisp
epony has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
<|3b|> slyrus: https://common-lisp.net/project/slime/ points to github issue tracker
marusich has joined #lisp
<slyrus> Ok, thanks.
<slyrus> apparently swank/gray doesn't work on ABCL and stassat's recent SLIME changes make the repl depend on swank/gray.
alexmlw has joined #lisp
Pixel_Outlaw has joined #lisp
fikka has joined #lisp
<phoe> slyrus: so basically SLIME no longer works on ABCL?
emacsoma` has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
<slyrus> slime-repl anyway
<slyrus> or any other lisp not supported in swank/gray
<phoe> that is a nasty bug
hel-io has joined #lisp
Patternmaster has joined #lisp
fikka has quit [Ping timeout: 276 seconds]
raynold has joined #lisp
lnostdal has quit [Quit: https://quanto.ga/]
EvW has joined #lisp
<phoe> breaking ABCL compatibility is bad.
<phoe> it seems like https://github.com/slime/slime/blob/master/swank/abcl.lisp#L28 might provide some insight
<slyrus> fun
emacsomancer_ has joined #lisp
<phoe> brief reading tells me that there's a shared GS implementation that cannot be used due to this bug.
fikka has joined #lisp
samla has joined #lisp
emacsomancer has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
emacsomancer_ is now known as emacsomancer
fikka has quit [Ping timeout: 240 seconds]
samla has quit [Remote host closed the connection]
lnostdal has joined #lisp
fikka has joined #lisp
damke has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
damke_ has quit [Ping timeout: 264 seconds]
Chream_ has joined #lisp
<stacksmith> Does the standard specify logbitp as setf-able?
Chream_2 has quit [Ping timeout: 256 seconds]
<phoe> stacksmith: nope.
<pjb> stacksmith: nope. It's written Function logbitp, not Accessor logbitp.
fikka has joined #lisp
<phoe> use SETF LDB.
<stacksmith> pjb: Ah, so that's what it means! I've been wondering for a while.
Devon has joined #lisp
<White_Flame> are any of the '-p' predicates setf-able?
lemoinem has quit [Read error: Connection reset by peer]
<White_Flame> seems to be against the grammar of the function name
<pjb> I don't think. Yes.
<stacksmith> sbcl does it for logbitp...
<pjb> There can always be extensions.
lemoinem has joined #lisp
<stacksmith> There is no official 'set bit of an integer' function, right?
<pjb> it's dpb
<pjb> akas (setf ldb)
fikka has quit [Ping timeout: 276 seconds]
<pjb> stacksmith: but note that integers are immutable.
<White_Flame> there's bit vectors, but I don't recall conversions to ints
pfdietz_ has quit [Ping timeout: 260 seconds]
<stacksmith> Is it incorrect to modify an integer whose sole purpose is to be returned? Even if you are certain of is width etc...
<pjb> stacksmith: it's not incorrect, it's IMPOSSIBLE!
<pjb> stacksmith: numbers are immutable!
<phoe> stacksmith: you can't do it
<pjb> stacksmith: also, in lisp integers have infinite width.
<stacksmith> Yes, of course.
<phoe> SETF LDB doesn't modify the original number, it returns a new one
<pjb> it mutates the place, not the integer.
<phoe> in Lisp numbers aren't values in memory whose bits you can peek and poke. they're immutable things.
<stacksmith> Right. I win the idiot contest today.
<phoe> well, at some point, they are represented by values in memory whose bits can be peeked and poked, but the programmer cannot do it, only the implementation can.
knicklux has quit [Quit: Leaving]
fikka has joined #lisp
<phoe> stacksmith: nah, not an idiot contest. Questions are here to be answered, and how Lisp treats numbers isn't obvious, especially to C programmers.
<pjb> Well, it could but it probably don't do it either, because integers can be interned, and particularly bigints
<jmercouris> There is no "idiot contest", I think that's the wrong attitude
<jmercouris> we all make mistakes, that does not make us idiots
<phoe> where you can int x = 2; x |= 0x0F0F0F0F; and other tricks like that.
<phoe> also what jmercouris said
<stacksmith> Meant entirely in good humour, as I slap my forehead.
void_pointer has quit [Remote host closed the connection]
void_pointer has joined #lisp
terpri has quit [Ping timeout: 276 seconds]
Chream_ has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
<jmercouris> It's been a long time since I've had an ice cream sandwich, seems hard to get them in germany
<k-hos> buy cookies and icecream and make your own
fikka has quit [Ping timeout: 268 seconds]
<jmercouris> that's a really good idea, I could make basically infinite flavor combinations, cutting and shaping the ice cream will be hard though
<phoe> #lispcafe serves good ice cream
Chream_ has joined #lisp
Achylles has joined #lisp
<stacksmith> Does this look like an efficient bitvector to integer conversion? I know bitvector has at least one bit. (reduce #'(lambda (a b) (+ (ash a 1) b)) bitvector)
Fare has quit [Remote host closed the connection]
attila_lendvai has quit [Ping timeout: 256 seconds]
<|3b|> if you need efficiency for huge bitvectors, might work better to assemble the final integer 32 or 64 bits at a time, so you don't involve bignums math as much
Oladon has joined #lisp
varjag has quit [Ping timeout: 256 seconds]
scymtym_ has joined #lisp
<|3b|> and probably would also be better to use dpb or setf ldb rather than shifting if your numbers are large
<stacksmith> |3b| Wouldn it have to be 63 or whatever the width of a fixnum?
<|3b|> not if you declare types
vaporatorius has quit [Ping timeout: 276 seconds]
<|3b|> most implementations can work on native machine words efficiently if they know the value will fit
scymtym has quit [Ping timeout: 260 seconds]
<stacksmith> Ah.
<|3b|> potentially much more efficiently than same operation on unknown types
<|3b|> your solution is probably more efficient in code size though :)
<stacksmith> I've been declaring byte widths smaller, assuming they had to fit in a fixnum. OK, this day is turning out to be more educational than I imagined.
Devon has quit [Ping timeout: 255 seconds]
<|3b|> if you know it is smaller, telling the compiler that can still help
Rawriful has joined #lisp
random-nick has quit [Remote host closed the connection]
<|3b|> for example (+ a b) might be a bignum if a and b are unsigned-byte 64, but won't be if they are unsigned-byte 55
<stacksmith> Yeah, I've gotten into all kinds of issues like that.
fikka has joined #lisp
<|3b|> when you only care about the low 64 bits of the result in first case, you can still get fast code on sbcl if you specify that with LDB or LOGAND, like (ldb (byte 64 0) (+ a b))
shka has quit [Ping timeout: 256 seconds]
<aeth> What I like about floats is that float + float is a float, unlike with integers. What I don't like about floats is, well, addition isn't necessarily a good idea.
<phoe> aeth: xD
<|3b|> well, to be fair in the comparable case float just says "who knows, it's big though"
<aeth> When I want to restrict a(n unsigned) integer to some range from 0 to whatever, I tend to mod it by some power of 2. e.g. (mod (+ x 42) (expt 2 32))
<aeth> SBCL optimizes it for cases of power of two (compare the disassembly for that vs for (1- (expt 2 32))), and it might not be too hard for other implementations to do that if they don't currently do that
aindilis has quit [Remote host closed the connection]
<|3b|> yeah, it detects a few different patterns
attila_lendvai has joined #lisp
vlatkoB_ has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 264 seconds]
random-nick has joined #lisp
<aeth> It helps to disassemble and see what it detects. e.g. iirc, SBCL handles FLOOR and CEILING efficiently/inline, but calls ROUND (you can integer divide with these three directly instead of having an intermediate non-integer)
<aeth> I don't like implementations that don't take disassemble seriously. It's easier than going through the source code.
aindilis has joined #lisp
<aeth> If someone is making an implementation, please comment disassemble like SBCL does (allocations, error detection (e.g. bounds checks), function calls, etc.)
kark has quit [Read error: Connection reset by peer]
<jackdaniel> patches are welcome
BitPuffin has quit [Remote host closed the connection]
<aeth> I probably will if I need to use it for something.
fikka has joined #lisp
Murii has quit [Quit: WeeChat 1.4]
fikka has quit [Ping timeout: 252 seconds]
quotation has joined #lisp
pfdietz_ has joined #lisp
kark has joined #lisp
random-nick has quit [Remote host closed the connection]
moei has joined #lisp
mishoo has joined #lisp
jmercouris has quit [Ping timeout: 240 seconds]
void_pointer has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
fikka has joined #lisp
pfdietz_ has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 265 seconds]
Karl_Dscc has joined #lisp
fikka has joined #lisp
attila_lendvai has quit [Ping timeout: 256 seconds]
krwq has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 240 seconds]
alexmlw has quit [Quit: alexmlw]
bmgxc9 has joined #lisp
bmgxc9 has quit [Max SendQ exceeded]
fikka has joined #lisp
pfdietz_ has joined #lisp
jmercouris has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
fikka has joined #lisp
Sheilong has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
hvxgr has quit [Quit: leaving]
dieggsy has joined #lisp
ludston has quit [Ping timeout: 240 seconds]
ludston has joined #lisp
mishoo has quit [Ping timeout: 240 seconds]
Naergon has quit [Ping timeout: 260 seconds]
schoppenhauer has quit [Ping timeout: 248 seconds]
bmgxc9 has joined #lisp
bmgxc9 has quit [Max SendQ exceeded]
schoppenhauer has joined #lisp
terpri has joined #lisp
jsn` has joined #lisp
clog has quit [Ping timeout: 248 seconds]
EvW has quit [Ping timeout: 260 seconds]
attila_lendvai has quit [Read error: Connection reset by peer]
pfdietz_ has quit [Ping timeout: 255 seconds]
pfdietz_ has joined #lisp
bjorkintosh has quit [Remote host closed the connection]
bjorkintosh has joined #lisp
learning has joined #lisp
hvxgr has joined #lisp
EvW1 has joined #lisp
pfdietz_ has quit [Ping timeout: 256 seconds]
attila_lendvai has joined #lisp
epony has quit [Read error: Connection reset by peer]
slyrus has quit [Quit: Client Quit]
hel-io has quit []
figurehe4d has joined #lisp
Karl_Dscc has quit [Remote host closed the connection]
porky11 has joined #lisp
kdridi_ has joined #lisp
kdridi has quit [Ping timeout: 256 seconds]
damke_ has joined #lisp
dilated_dinosaur has quit [Remote host closed the connection]
Baggers has quit [Remote host closed the connection]
damke has quit [Ping timeout: 264 seconds]
learning has quit [Remote host closed the connection]
Oladon has quit [Quit: Leaving.]
zaquest has quit [Ping timeout: 240 seconds]
zaquest has joined #lisp
jmercouris has quit [Ping timeout: 248 seconds]
Kaisyu7 has joined #lisp
pierpa has joined #lisp
slyrus has joined #lisp
trocado has joined #lisp
root_ has joined #lisp
root_ has left #lisp [#lisp]
dilated_dinosaur has joined #lisp
pfdietz_ has joined #lisp
voidlily has quit [Remote host closed the connection]
voidlily has joined #lisp
attila_lendvai has quit [Ping timeout: 248 seconds]
Rawriful has quit [Quit: WeeChat 1.4]
dilated_dinosaur has quit [Quit: Leaving]
Kaisyu7 has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
wigust has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
epony has joined #lisp
learning has joined #lisp
dilated_dinosaur has joined #lisp
attila_lendvai has joined #lisp
pfdietz_ has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 256 seconds]
no26 has joined #lisp
nirved has quit [Quit: Leaving]
fikka has joined #lisp