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.
<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]
<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
<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.
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.
<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>
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
<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
<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
<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]
<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]