p_l changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | ASDF 3.3.4
asupalai has joined #lisp
Khisanth has quit [Ping timeout: 256 seconds]
quazimodo has quit [Ping timeout: 256 seconds]
iAmDecim has quit [Ping timeout: 256 seconds]
quazimodo has joined #lisp
Khisanth has joined #lisp
ebzzry has joined #lisp
vhost- has quit [Ping timeout: 265 seconds]
wsinatra_ has quit [Quit: WeeChat 2.7.1]
curtmack has joined #lisp
X-Scale has quit [Ping timeout: 255 seconds]
X-Scale` has joined #lisp
X-Scale` is now known as X-Scale
asupalai has quit [Remote host closed the connection]
iAmDecim has joined #lisp
markoong has quit [Ping timeout: 265 seconds]
iAmDecim has quit [Ping timeout: 256 seconds]
bitmapper has quit [Ping timeout: 258 seconds]
shifty has joined #lisp
Inline has quit [Ping timeout: 272 seconds]
asupalai has joined #lisp
z147 has quit [Ping timeout: 240 seconds]
Jmabsd has joined #lisp
<Jmabsd> Can you please explain the utility of Common Lisp "dynamic variables" please
quazimodo has quit [Ping timeout: 260 seconds]
swills has quit [Quit: swills]
Jmabsd2 has joined #lisp
<Josh_2> I can only think of times I have used it, when I need a variable that I can access in functions that are called after It's declaration
<aeth> Jmabsd: They're mainly used for streams these days. It lets you do things like rebind *standard-output* to called functions without having to pass a standard-output variable through the entire call-stack, and once you leave the local rebinding, it is restored to its original value... (defun foo (stream) (let ((*standard-output* stream)) (format t "Hello, world!")))
<Josh_2> but can't remember why I did it xD
<no-defun-allowed> Special variables are good for "configuration" things.
<aeth> Jmabsd: Now, you can just replace "t" with "stream" in my example and it's not too complicated, but imagine instead that that FORMAT is 10 functions deep in called functions instead of directly in FOO
<aeth> You'd have to pass a stream variable each time.
<aeth> For debugging/logging, this might not be a good idea.
Jmabsd2 has quit [Remote host closed the connection]
Jmabsd2 has joined #lisp
Jmabsd has quit [Ping timeout: 260 seconds]
caltelt has quit [Ping timeout: 260 seconds]
<no-defun-allowed> They're also good for function "arguments" that you don't really want to make arguments. For example, in my networked CLOS extension, a client can use a special variable to disable automatic retrieval of objects that are in network objects' slots.
quazimodo has joined #lisp
<aeth> You want your logging state to be in a special variable rather than in the parameters of every single function, or in the slots of data structures that are in the parameters of every single function.
swills has joined #lisp
zulu_inuoe has quit [Ping timeout: 255 seconds]
Jmabsd2 has quit [Client Quit]
caltelt has joined #lisp
quazimodo has quit [Ping timeout: 256 seconds]
slyrus has quit [Quit: Leaving]
asupalai has quit [Remote host closed the connection]
KDr21 has joined #lisp
KDr21 has quit [Ping timeout: 240 seconds]
curtmack has quit [Remote host closed the connection]
EvW has quit [Ping timeout: 240 seconds]
vhost- has joined #lisp
caltelt has quit [Ping timeout: 260 seconds]
caltelt has joined #lisp
ebzzry has quit [Ping timeout: 240 seconds]
epony has quit [Quit: reconf]
epony has joined #lisp
quazimodo has joined #lisp
Jmabsd has joined #lisp
<Jmabsd> anyone?
<Bike> Jmabsd: aeth already gave you a reasonable explanation
<Bike> though i think "usually used for streams" is an exaggeration
<Jmabsd> ah, i see
<Jmabsd> ah, i see his explanation
<Jmabsd> > They're mainly used for streams these days. It lets you do things like rebind *standard-output* to called functions without having to pass a standard-output variable through the entire call-stack, and once you leave the local rebinding, it is restored to its original value... (defun foo (stream) (let ((*standard-output* stream)) (format t "Hello, world!")))
<Jmabsd> > Now, you can just replace "t" with "stream" in my example and it's not too complicated, but imagine instead that that FORMAT is 10 functions deep in called functions instead of directly in FOO
<Jmabsd> > You'd have to pass a stream variable each time. For debugging/logging, this might not be a good idea.
<Jmabsd> um
<Jmabsd> thanks! -
semz has quit [Ping timeout: 240 seconds]
<Jmabsd> Bike,aeth: someone told me that dynamic variables is like, one variable definition that will lead to different variable slots, depending on the scope of the code
<Bike> i don't know what that means
<no-defun-allowed> Yeah, that's a little hard to understand.
Jmabsd2 has joined #lisp
<no-defun-allowed> My mental model is that the dynamic environment is an argument passed implicitly in every function call, and accepted implicitly by every function.
buffergn0me has joined #lisp
<no-defun-allowed> Then, to get SYMBOL-VALUE of a symbol, we look up the symbol in that argument. To bind a special variable with LET, we construct a new environment with that variable bound and call everything in the LET body with that new environment.
Jmabsd has quit [Ping timeout: 265 seconds]
semz has joined #lisp
semz has quit [Changing host]
semz has joined #lisp
devon has joined #lisp
asupalai has joined #lisp
asupalai has quit [Remote host closed the connection]
KDr2 has joined #lisp
asupalai has joined #lisp
davsebamse has quit [Ping timeout: 258 seconds]
Jmabsd2 has quit [Ping timeout: 255 seconds]
davsebamse has joined #lisp
_whitelogger has joined #lisp
Necktwi has quit [Read error: Connection reset by peer]
torbo has quit [Remote host closed the connection]
Jmabsd has joined #lisp
<Jmabsd> Bke,aeth: can you do something like this:
<Jmabsd> first in global scope: (defdynvar v)
<Jmabsd> and then you do something like (defun (a) (with-dyn-var ((v 123)) (b)))
<Jmabsd> (defun (b) (c))
<Jmabsd> (defun (c) (print v))
<Jmabsd> and v will print 123!
<Jmabsd> Bike,aeth: is that possible?
<Bike> well your syntax is completely wrong, but you have the basic idea correct, yes.
<Bike> you'd write (defvar *v*) (defun a () (let ((*v* 123)) (b))) (defun b () (c)) (defun c () (print *v*))
ebzzry has joined #lisp
shifty has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
<devon> Good evening all.
<devon> Is there a QL way to "portably" create symbolic links?
g0d_shatter has quit [Ping timeout: 255 seconds]
caltelt has quit [Ping timeout: 265 seconds]
zulu_inuoe has joined #lisp
zulu_inuoe has quit [Remote host closed the connection]
zulu_inuoe has joined #lisp
teej has quit [Quit: Connection closed for inactivity]
lottaquestions has quit [Ping timeout: 255 seconds]
<beach> Good morning everyone!
<Jmabsd> Bike:: Oh, the (let ((*v* 123) will mean assignment of the dynamic variable??
<devon> G'day.
<Bike> Jmabsd: binding. it's analogous to your "with-dyn-var".
lottaquestions has joined #lisp
<Jmabsd> Bike: so normally, let means variable binding, but if a variable name belongs to a dynamic variable, let instead means dynamic variable instance allocaition and assignment?
<Bike> yes, let can bind both lexical and special variables.
<Jmabsd> Bike: can you give me a manual reference for dynamic variables?
<Bike> sure, let me find it for you
devon has quit [Ping timeout: 240 seconds]
<Jmabsd> interesting. so "lexical" is normal. what are other special variables ,than dynamic vairables?
<Bike> "special" and "dynamic" are interchangeable in this context
<Jmabsd> the leading and ending star means dynamic vairable??
<Bike> yes. that's just a convention, since they're different from lexical variables
<Jmabsd> or "defvar" means it's a dynamic vairable, in contrast with def which is the usual define form?
<Bike> common lisp does not define any operator called "def"
<Jmabsd> and the use (in print) is done implicitly
<Bike> clhs 3.1.2.1.1.2
<Jmabsd> i.e. Common Lisp will automatically typecheck for you that this is a dynamic vairable,
<Jmabsd> and then pull out its content for you
<Bike> it's not a type check, the compiler just knows which variables are lexical and which are dynamic, because you tell it so
ebrasca has joined #lisp
buffergn0me has quit [Ping timeout: 256 seconds]
<Jmabsd> Bike: err can you refer me to Lispworks' documentation for assigning and loading dynamic variables?
<Jmabsd> Bike: the stars are necessary, in your example??
shifty has quit [Ping timeout: 265 seconds]
<Jmabsd> or could you as well just call it "v"
<Bike> the stars are just a naming convention, so that you the human reader can tell lexical from dynamic variables easily
shifty has joined #lisp
<Bike> they're not required by the language
<Jmabsd> (defvar v) (defun a () (let ((v 123)) (b))) (defun b () (c)) (defun c () (print v))
<Jmabsd> ah.
<Bike> as for assigning and "loading", special variables use the same syntax as regular ones
<Jmabsd> ok, so it's "defvar" vs "def", ok
<Jmabsd> ok
<Bike> there is no "def"
<Bike> i don't know why you think there is a "def", but there is not.
<Jmabsd> ah
<Jmabsd> how do you define a normal global variable?
<no-defun-allowed> clhs defvar
<no-defun-allowed> clhs defparameter
<Jmabsd> ummmmm
<Jmabsd> hey hey
<Jmabsd> wait
<Jmabsd> so how do you define a dynamic vairable versus a normal one
<no-defun-allowed> Ooh, "global". Not easily.
<Bike> lisp doesn't have a mechanism for defining global lexical variables
<Jmabsd> defvar is specifically to make a dynamic variable
<Jmabsd> so all globals are dynamic??
<Bike> global variables, yeah
<Bike> there are also symbol macros, but that's a different can of fish
<Jmabsd> ummmmmm ummm
<Jmabsd> Bike: look at this http://paste.debian.net/1134081/
<Jmabsd> will this one print out "123 234 "?
<Bike> no, because your print call is wrong
<Jmabsd> ah
<no-defun-allowed> ^^
<Jmabsd> how fix?
<Jmabsd> remove the " "
<Jmabsd> would it then print "123234"?
<Bike> something like that yeah
shifty has quit [Ping timeout: 255 seconds]
<Jmabsd> Bike: do you have some more manual reference?
shifty has joined #lisp
<Bike> for what
<Jmabsd> dynamic variables
<Bike> the page i linked is the core page
<Jmabsd> Bike: so in other words, in Common Lisp, "let" will EITHER allocate a new variable slot, which is the case for lexical variables
<Bike> from the definition of the semantics of the evaluation
<Jmabsd> *OR* mean assignment of a dynamic variable, which is what it does if the bound variable name is a global define
<Bike> binding. binding a dynamic variable.
<Bike> you also shouldn't think of allocation, there's no reason a lexical variable couldn't be in a register.
<Bike> but yes, LET can do two different things.
<Jmabsd> interesting
<Bike> that is the basic page on dynamic variables, yes.
<seok> "let" assigns a variable within that scope only
<Jmabsd> interesting
<Jmabsd> can you give me the CL spec for dynamic variable
<seok> which language are you from?
<Jmabsd> some other language
<Bike> i did give you the spec!
<Jmabsd> seok: yeah in that scope, i follow you
<Bike> it is this page.
<beach> Jmabsd: The Common Lisp HyperSpec *is* the Common Lisp specification for all practical purposes.
<Jmabsd> Bike: Lispworks is the CL spec? oh
<seok> which language
<Jmabsd> i see
<seok> lispworks follows the CL spec
<Jmabsd> does SBCL have its own page?
<Bike> well, i mean, it's formatted to look nicer
<Bike> but this is essentially the language standard.
<Jmabsd> Bike: wait, all these links are to lispworks.com . is this the "CL HyperSpec"?
<seok> SBCL and lispworks follow the same spec
<seok> yes
<Jmabsd> ic
<Jmabsd> ok
<seok> they have implementation specific functions, but they are within their own libraries
<Jmabsd> ok!
<seok> like sbcl:
shifty has quit [Ping timeout: 256 seconds]
<beach> Jmabsd: The ANSI standard is a document published by ANSI and exists only in printed form. Lispworks obtained the right from ANSI to turn the standard into an HTML document, and that is the Common Lisp HyperSpec.
<Jmabsd> seok: yes?
Inline has joined #lisp
<Jmabsd> beach: ic
<Jmabsd> ok great, thanks for clarfying!
<seok> still not sure what you are trying to understand from the spec for variables
<Jmabsd> beach,Bike,*: about dynamic variables in Common Lisp, the conversaiton we have had on the topic now **is exhaustive** isn't it
<Jmabsd> for instance, CL does *NOT* have first class continuations,
<seok> they are just like variables in other languages
<seok> that's why I asked which language you are from
<Bike> i don't think first class continuations are directly related to dynamic variables, but no, lisp does not have first class continuations.
<Jmabsd> and for this reason you don't need to be worried about really exotic GOTO:s or such
<beach> Jmabsd: It sounds like you are confusing many things.
<Bike> well, it does have escape continuations. they're not quite first class though.
<Jmabsd> Bike: well, if you would do ultraexotic GOTO:s between continuations, you would end up with the question "which assignment of a dynamic variable, should apply in which continuation" :)
<Jmabsd> right
<Bike> you can work that kind of thing out, it just gets more complicated
<Jmabsd> escape continuation means N-step return, right
<Jmabsd> e.g. "please return the past five procedures for me"
<Jmabsd> similar to C++ exception throwing in a way
<Jmabsd> > Bike: you can work that kind of thing out, it just gets more complicated
<Jmabsd> Bike: well, CL dynamic variables would not accomodate such toying
<Jmabsd> they are relative to the stack's work upward only aren't they
<Jmabsd> basically the "let" form that assigns a dynamic variable, **WILL RESET THAT DYNAMIC VARIABLE TO ITS ORIGINAL VALUE, AT RETURN TIME** righT?
<beach> Right.
<Jmabsd> awesome.
<beach> Even when the LET form is terminated abnormally.
<beach> As in (tagbody (let ((*v* 234)) (go a)) a)
<Jmabsd> great.
<Jmabsd> yep
<Bike> i mean you can do dynamic variables with first class continuations. racket does
<semz> What was the original reason for not adding FCCs anyway? Difficulty of implementation?
<Bike> mostly just that common lisp was developed to standardize things lisps already did, and they didn't do first class continuations. i think.
<beach> semz: Strange semantics mainly, coupled with doubts about performance and usefulness.
<beach> That's my guess anyway.
zulu_inuoe has quit [Ping timeout: 240 seconds]
<Bike> nowadays the new excitement is delimited continuations, anyway
buffergn0me has joined #lisp
<Jmabsd> Bike: your (tagbody (let ((*v* 234)) (go a)) a) example
<Jmabsd> why is this abnormal
<beach> semz: It is not particularly difficult to implement. But either you need to have heap-allocated activation records, or you need some complicated stack copying when a continuation is captured.
<Bike> my example?
<Jmabsd> Bike: in Racket I presume they're called "parameter objects".
<Bike> parameters, yes
<beach> Jmabsd: That's my example. It is "abnormal" because there is a non-local control transfer.
<Jmabsd> ah, "go" you mean?
<beach> Yes.
<beach> Jmabsd: If I elaborate a bit, like (tagbody (let ((*v* 234)) (print "hello") (go a) (print "hi")) a) then the "hi" will never be printed, so the LET body does not finish normally.
<Jmabsd> what does go mean actually, GOTO?
<beach> Essentially, yes.
<Jmabsd> ok
<Jmabsd> so just like, goto somewhere
<beach> And the tag that it is transferring to is outside the scope of the LET.
<Jmabsd> great.
<Jmabsd> beach,Bike,aeth: thanks a ton for all your clarifications!!
<beach> Pleasure.
<Bike> no problemo
dddddd has quit [Remote host closed the connection]
Bike has quit [Quit: Lost terminal]
g0d_shatter has joined #lisp
PuercoPope has quit [Remote host closed the connection]
vlatkoB has joined #lisp
ebzzry has quit [Ping timeout: 255 seconds]
gravicappa has joined #lisp
Jmabsd has quit [Ping timeout: 260 seconds]
<ebrasca> beach: Hi
orivej has quit [Ping timeout: 256 seconds]
KDr2 has quit [Remote host closed the connection]
KDr2 has joined #lisp
<HiRE> howdy everyone
Inline has quit [Quit: Leaving]
<beach> Hello HiRE.
<HiRE> I got an opportunity to preach the good word about lisp
<HiRE> a few days ago
<HiRE> eventually I'll convert someone else to the church of parentheses
<beach> Careful with that though.
<HiRE> do I need to be careful who I convert
<no-defun-allowed> Where did you "preach"?
<beach> If you "convert" someone who then uses Common Lisp in a project, and something goes wrong, or that person uses it in a non-optimal way, you are the one responsible.
<HiRE> oh it wasn't in a professional context. Someone asked me what the perfect idea of a language was and followed it up with if I could build a computer what would it look like
<HiRE> I got to talk about why lisp is great and lisp machines were a good idea.
<beach> HiRE: Then, if you are not able to fix the problems, Common Lisp as a whole will be blamed, and you will have had the opposite effect.
<beach> HiRE: Oh, OK.
<beach> Just be careful.
<HiRE> yeah what you say makes sense
<HiRE> thankfully lisp is gross to most people in the professional sense. If FAANG+ don't use it, it may as well not exist.
g0d_shatter has quit [Quit: Leaving]
<HiRE> At least this has been my experience as a consultant
Jmabsd has joined #lisp
asupalai has quit []
ArthurStrong has joined #lisp
<HiRE> I had a funny thought the other day on campus with all the bible beaters coming around this time of year to preach we're all destined for eternal suffering
<HiRE> I thought it would've been funny for one of them to tell me that and tell follow up with "yeah that's great and all but have you heard about lisp?"
<no-defun-allowed> It's usually funnier to claim you partake in all the things that they think cause suffering, but I did give up on trying to advocate the use of Lisp, except for myself.
ArthurStrong has left #lisp [#lisp]
<HiRE> yeah im just in the honeymoon phase
<HiRE> I'll become jaded at the world again soon enough
<Josh_2> I agree with no-defun-allowed
<HiRE> I do think one of the interesting aspects of lisp is that iirc you can compile lisp from the 60s still
<HiRE> I dont know of many languages that have that level of backwards compatibility.
<HiRE> I dont think fortran does
<HiRE> algol maybe? lol
<beach> HiRE: "bible beaters" coming to campus? You must live in a very strange country.
ggole has joined #lisp
<HiRE> beach, I live in the southwest US. Campuses here are open so we get all walks of extreme life wandering on campus to preach (not just the religious kind, but they seem to be the most common)
<beach> So I was right. You *do* live in a very strange country.
<HiRE> As long as they aren't creating a hostile (read: violent) situation the campus police tend to let them do what they want.
<HiRE> yeah certainly weird
<HiRE> I'd imagine in other countries that doesnt happen
<beach> Not here.
<HiRE> whereabouts are you?
<beach> France, EU.
<HiRE> oh cool. Are campuses closed off to non-students there?
<beach> No, I don't think so.
<HiRE> must be cultural then :p
<beach> It's just that not many people are religious in western Europe.
<beach> Also, France has a strict separation between church and state, and campuses are run by the state.
<no-defun-allowed> Also not the case in Australia, and this university has a pretty open campus.
<HiRE> oh like I said religious are the most common but we get very...expressive PETA people trying to block the SU to stop meat eaters for example.
<HiRE> usually around holiday
<beach> But we are drifting off topic.
<HiRE> yes, its off topic for the channel - sorry.
narimiran has joined #lisp
<aeth> It's more that the US government can't stop people from speaking in public spaces on public campuses because of the first amendment iirc. It's definitely exploitable. Start giving out LispOSes and spreading Lisp.
jeosol has quit [Remote host closed the connection]
<Josh_2> aeth: exactly
<Josh_2> Lisp evangelism here we go!
<HiRE> steal their techniques. Hand out usb drives with a copy of PCL, SICP, and a VM of genera
<aeth> hand out CD-ROMs, true believers will find ways to read them
<no-defun-allowed> Maybe not the last one.
<HiRE> ah good idea
<HiRE> the CD is the pure shape formed of a single empty S-expr
<HiRE> a representation of the neophyte lisper
<aeth> '(o) is basically a CD-ROM
<Josh_2> you can get some pretty cheap USB's
<aeth> yes, that's the joke, that CD-ROMs are probably more expensive these days because they're old tech
perdent has joined #lisp
<perdent> How do you calculate the Solubility Product Constant of a chemical e.g AgF in lisp?
<no-defun-allowed> How do you calculate it without Lisp?
<perdent> Like that
zulu_inuoe has joined #lisp
<HiRE> you'd probably need a chemist to write it but there's no reason lisp *couldnt* do it
jeosol has joined #lisp
<perdent> HiRE no calculators exist online for it
<beach> perdent: You would probably use the same formula in Common Lisp as in other languages.
<perdent> so i cant imagine it being easy to write in lisp
<perdent> or any lang
<HiRE> it probably has less to do with the difficulty and more to do with the consumers of it
<HiRE> if there aren't many people using it, and its specialized enough, no one is going to write a calculator for it
Bourne has joined #lisp
<HiRE> A good example of something I've written that calculators dont really exist for (or are hard to find) are greeks for exotic options
<HiRE> The math isn't difficult to translate - just no one's done it because its highly specialized bank stuff.
<no-defun-allowed> The rule is there already.
<HiRE> probably be a little nicer in CL since you can do some fun stuff with symbols to make the formula entry easier to write maybe.
<no-defun-allowed> Say you have (defstruct product coefficient concentration), then the rule for each product could be (defun product-solubility-constant (product) (expt (product-concentration output) (product-coefficient output))), and then your SPC would be (reduce #'* products :key #'product-solubility-constant).
<perdent> no-defun-allowed can you show me in here: https://rextester.com/l/common_lisp_online_compiler
<no-defun-allowed> perdent: I'll leave making it symbolic to you, but as HiRE says, it should be pretty easy to do in Lisp (and moreso with a pattern matcher).
<perdent> HiRE*
<no-defun-allowed> No, I just gave you the relevant definitions.
<HiRE> this strikes me as a homework question :)
<HiRE> I dont really know enough to solve an equilibrium equation. I'm a CS guy and I only had to take intro chemistry in my undergrad.
<HiRE> But it may be useful to start there and write the system to get the equilibrium equation.
<no-defun-allowed> perdent: I'm quite busy with some other work, but that's basically all you need for the equation you gave me.
<HiRE> you could have some function equilbrium solver that takes a number of chemical objects. Each chemical has it's associated ionic properties attached to it. Then you can return the a, b, c of the equilbrium
<perdent> no-defun-allowed so it cant be done in one line and fit all equations given?
<perdent> all compounds*
<HiRE> a,c,d**
<no-defun-allowed> And if this is homework for some class, I strongly encourage you to check your school's rules on plagiarism. My university does consider it plagiarism to get code from anyone.
<no-defun-allowed> That description and that code was all on one line.
<Josh_2> They don't have to know though :P
iAmDecim has joined #lisp
<HiRE> well if your professor accepts a solution in lisp, they might be lurking this here channel ;D
<no-defun-allowed> Josh_2: Hey, I don't think I'd be getting out of it easily if I helped someone else cheat in their classes.
<perdent> nope its not homework
<perdent> it can be in any language
<perdent> doesnt have to be lisp
<no-defun-allowed> This is #lisp, so we're only giving Lisp answers.
<perdent> Yes which is why I asked in lisp how to do it
<perdent> But i have been asking in other channels too
<slyrus_> just to waste various channels' members time or for some more principled reason?
<no-defun-allowed> Right. You can use the rules I gave then.
iAmDecim has quit [Ping timeout: 258 seconds]
<Josh_2> In first year I wrote half my friends C++ code oof
shka_ has joined #lisp
<Josh_2> doesn't count to the degree so ¯\_(ツ)_/¯
<perdent> Im not sure your rules work
<perdent> But I only know python im still learning lisp
<buffergn0me> perdent: https://common-lisp.net/project/chemboy/ might have something useful
zulu_inuoe has quit [Ping timeout: 240 seconds]
<no-defun-allowed> I'm pretty confident my rules work. Did I make a mistake there?
montxero has joined #lisp
ebzzry has joined #lisp
Cymew has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
ebzzry has joined #lisp
shka_ has quit [Ping timeout: 256 seconds]
jprajzne has joined #lisp
buffergn0me has quit [Quit: ERC (IRC client for Emacs 26.2)]
rumbler31 has quit [Ping timeout: 258 seconds]
rumbler31 has joined #lisp
isBEKaml has joined #lisp
thodg has quit [Ping timeout: 256 seconds]
scymtym has quit [Ping timeout: 256 seconds]
ebzzry has quit [Read error: Connection reset by peer]
MichaelRaskin has quit [Quit: MichaelRaskin]
orivej has joined #lisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life has joined #lisp
Kevslinger has quit [Quit: Connection closed for inactivity]
varjag has joined #lisp
flamebeard has joined #lisp
shifty has joined #lisp
isBEKaml has quit [Quit: leaving]
thodg has joined #lisp
ljavorsk has joined #lisp
Josh_2 has quit [Read error: Connection reset by peer]
shka_ has joined #lisp
v_m_v has joined #lisp
gmeister has joined #lisp
montxero has quit [Ping timeout: 265 seconds]
scymtym has joined #lisp
quazimodo has quit [Ping timeout: 258 seconds]
Jmabsd has quit [Changing host]
Jmabsd has joined #lisp
fanta1 has joined #lisp
ljavorsk has quit [Ping timeout: 260 seconds]
jprajzne1 has joined #lisp
ebzzry has joined #lisp
ebrasca has quit [Remote host closed the connection]
montaropdf has joined #lisp
hhdave has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
jonatack has joined #lisp
shangul has joined #lisp
slyrus__ has joined #lisp
slyrus_ has quit [Ping timeout: 255 seconds]
dale has quit [Quit: My computer has gone to sleep]
adam4567 has quit [Remote host closed the connection]
ebzzry has joined #lisp
Jmabsd has quit [Ping timeout: 265 seconds]
mfiano is now known as axion
v_m_v has quit [Remote host closed the connection]
v_m_v has joined #lisp
v_m_v has quit [Ping timeout: 255 seconds]
rippa has joined #lisp
hlavaty has joined #lisp
cosimone has joined #lisp
Kevslinger has joined #lisp
markoong has joined #lisp
v88m has quit [Ping timeout: 265 seconds]
prince1 has quit [Ping timeout: 240 seconds]
dddddd has joined #lisp
space_otter has quit [Remote host closed the connection]
zooey has quit [Ping timeout: 240 seconds]
zooey has joined #lisp
samebchase-2 has left #lisp [#lisp]
samebchase- has joined #lisp
Jmabsd has joined #lisp
shifty has joined #lisp
iAmDecim has joined #lisp
iAmDecim has quit [Ping timeout: 258 seconds]
ljavorsk has joined #lisp
gko_ has joined #lisp
Jmabsd has quit [Quit: Leaving]
markong has joined #lisp
markoong has quit [Ping timeout: 260 seconds]
v_m_v has joined #lisp
bitmapper has joined #lisp
margeas has joined #lisp
markong has quit [Ping timeout: 255 seconds]
v_m_v_ has joined #lisp
v_m_v has quit [Ping timeout: 258 seconds]
jmercouris has joined #lisp
didi has joined #lisp
<didi> So, I want to give each object an unique identifier. Is GENSYM a good function for this?
<jmercouris> I don't see why not
<minion> jmercouris, memo from pjb: the size of source files and their arrangement doesn't matter: just write an emacs command to fetch and save toplevel forms automatically in any organization you like and forget it! Don't visit lisp file, visit lisp toplevel forms!
<didi> jmercouris: Thanks.
<jmercouris> maybe a more straightforward solution would be incrementing some integer
<didi> jmercouris: That was my first thought.
prince1 has joined #lisp
<jackdaniel> gensym is not a good way to achieve this (unless you depend on eq, not the string-name)
<didi> Although... How do I retrieve an object using a GENSYM? Hum...
<jackdaniel> s/string-name/symbol-name/
<didi> jackdaniel: Indeed.
<jackdaniel> indeed what?
<didi> jackdaniel: It's not a good way, I think now.
jprajzne has quit [Ping timeout: 256 seconds]
<didi> Back to integers.
<beach> didi: You retrieve the objects by sticking them in a hash table.
<jmercouris> I was just thinking of gensym to make keys to the hash table
cosimone has quit [Quit: Terminated!]
prince1 has quit [Ping timeout: 258 seconds]
<jackdaniel> jmercouris: what for?
<jmercouris> why not?
<jmercouris> I mean it would work just fine
<jackdaniel> usually you put something in a hash table to retreive it by a key
<jmercouris> right, and if you want a unique key?
<jackdaniel> are you going to have a separate collection of keys?
<jmercouris> not necessarily, you could still iterate over the hash table
<jmercouris> and maybe those objects themselves also know their key
<jmercouris> I don't know the application here, but if you are just trying for unique names, gensym would suffice
<jackdaniel> this does not make much sense to me
<jackdaniel> if you want to iterate over a collection, then sequence is plenty
<jmercouris> sometimes compound data structures are very useful
v_m_v_ has quit [Remote host closed the connection]
<jackdaniel> if you are going to find keys in objects, then why query the hash table?
<beach> I totally agree with jackdaniel.
<jmercouris> how can you agree upon a theoretical application?
<jmercouris> we have no idea what/how the objects will be used :-D
<jmercouris> anyways, whatever :-D
<jackdaniel> don't get me wrong, I find hash tables very important part of CL, just your proposal doesn't make sense
shifty has quit [Ping timeout: 258 seconds]
<jackdaniel> that reminds me a story from university - we had a group project and I've convinced folks, that we should do it in CL (they will do the C part and I will code the CL part) -- it was a success, we've all passed
shifty has joined #lisp
<jackdaniel> since I didn't want any instability in the project, I've asked them to implement a hash table in C; and then when they were not able to deliver in time, I've "remembered", that common lisp has hash tables
<jackdaniel> (so there was no C in the project in the end)
<beach> Nice!
ljavorsk has quit [Ping timeout: 265 seconds]
lucasb has joined #lisp
v_m_v has joined #lisp
zulu_inuoe has joined #lisp
Bike has joined #lisp
v_m_v has quit [Remote host closed the connection]
v_m_v has joined #lisp
jmercouris has quit [Ping timeout: 256 seconds]
ebzzry has quit [Ping timeout: 258 seconds]
<_death> why weren't they able to implement a hash table?
<jackdaniel> they had a prototype, but it had bugs
<_death> also, in the end, was all the code written by you?
<jackdaniel> the frontend part was written by another guy in js/html; we've also all designed the solution
jmercouris has joined #lisp
<lieven> lol it's not like there are no C libraries that implement hash tables
<jmercouris> yeah, there are a ton of them
<jmercouris> it sounds like your classmates simply did not wish to do the task
<jackdaniel> it was not allowed to use 3rd-party libraries
<jackdaniel> and it made sense. like: there is i.e plenty of graph libraries, but when you learn about graph algorithms you are expected to write them
<lieven> sure
<jmercouris> I'm not sure how that makes sense, in my classes you were always allowed 3rd party libraries
<jmercouris> unless the purpose of the problem was to implement something like a hash table
<jmercouris> if that was just a secondary aspect of the problem, then I see it as wholly irrelevant
<_death> a simple hash table is not something you need a library for..
<jmercouris> no, but maybe you want a lot of data structures and they come in a nice little C library
<jmercouris> why reinvent the wheel?
<_death> jmercouris: the wheel gets reinvented all the time, by everyone
<dlowe> it's really easy to come up with a terrible hash function
<jackdaniel> reinventing a wheel is a great learning experience
<jmercouris> IF the goal is to make a wheel
<jmercouris> if you are making a car, there is no need to make each wheel, that's not the point of the exercise, that's what I'm saying
<jmercouris> of course we implemented all sorts of data structures, but only when it was the point to learn those data structures
<jmercouris> otherwise we use another implementation, as one would do in real life
<jackdaniel> I don't think that this regime of learning brought you to a proficiency in looking for solutions
<jackdaniel> s/looking for/coming up with/
<jmercouris> I'm not sure why you always make things so personal
<jmercouris> Let me rephrase what you just said
<jmercouris> "Your university sucked, and you are an idiot"
<jackdaniel> that is very rude of you to put such words in my mouth
<jmercouris> lol, get off your high horse
<jmercouris> you started by blatantly insulting me
<jmercouris> anyone can clearly see that by what you wrote
shifty has quit [Ping timeout: 260 seconds]
<jackdaniel> no, I've commented that you often ask very basic questions, yet you are very certain about your opinions regarding education
shifty has joined #lisp
kslt1 has joined #lisp
<jackdaniel> as a side note, and it is the last thing I want to add to this, is that the way you put critic matters, i.e it is a difference when you say, that someone is not proficient in something and when you say that someone is stupid.
LiamH has joined #lisp
<jackdaniel> and both phrasings mean completely different things
mercourisj has joined #lisp
thodg has quit [Quit: Lost terminal]
<_death> I would also like to say that the novelty in implementing yet another hash table may be a personal novelty: gaining an understanding of something
jmercouris has quit [Disconnected by services]
mercourisj is now known as jmercouris
<jmercouris> you just don't know when to stop
<jmercouris> "you always ask such stupid simple things"
<_death> that's why it's good to reinvent wheels
random-nick has joined #lisp
<jmercouris> you may be a good programmer, but you are lacking social skills
<jackdaniel> I've understood pointers after countless hours of implementing linked lists
<jmercouris> and with that, I'm off for now
jmercouris has left #lisp [#lisp]
<jackdaniel> I need to have a permanent "bad guy" badget pinned, so people don't confuse me for a nice person I suppose
<jackdaniel> badge*
<_death> jackdaniel: interesting.. my understanding of pointers was natural because I learned assembly before C :)
<jackdaniel> heh
<jackdaniel> C was my first language
shifty has quit [Ping timeout: 258 seconds]
<_death> and they were more various than plain C.. there were near pointers and far pointers, you had to understand segments, banking, etc.
<jackdaniel> I'm oblivious to such concerns
didi has left #lisp ["O bella ciao bella ciao bella ciao, ciao, ciao."]
ebzzry has joined #lisp
Kevslinger has quit [Quit: Connection closed for inactivity]
sammich has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
sammich has joined #lisp
v_m_v has quit [Remote host closed the connection]
v_m_v has joined #lisp
v_m_v has quit [Remote host closed the connection]
v_m_v has joined #lisp
v_m_v has quit [Ping timeout: 256 seconds]
ebzzry has quit [Ping timeout: 256 seconds]
EvW has joined #lisp
ebzzry has joined #lisp
pjb has quit [Ping timeout: 272 seconds]
dddddd has quit [Remote host closed the connection]
v_m_v has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
ebzzry has joined #lisp
pjb has joined #lisp
perdent has quit [Ping timeout: 240 seconds]
v_m_v has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 260 seconds]
caltelt has joined #lisp
prince1 has joined #lisp
prince1 has quit [Ping timeout: 265 seconds]
<Shinmera> jackdaniel: fwiw, once again, I agree with what you said
akoana has joined #lisp
shka_ has quit [Quit: WeeChat 1.9.1]
<jackdaniel> a badge it is then :) more seriously though - thanks
mangul has joined #lisp
shangul has quit [Ping timeout: 255 seconds]
buffergn0me has joined #lisp
v_m_v has joined #lisp
v_m_v has quit [Remote host closed the connection]
v_m_v has joined #lisp
X-Scale has quit [Ping timeout: 256 seconds]
X-Scale` has joined #lisp
ljavorsk has joined #lisp
v88m has joined #lisp
X-Scale` is now known as X-Scale
v_m_v has quit [Remote host closed the connection]
jprajzne1 has quit [Quit: Leaving.]
oxum has quit [Remote host closed the connection]
oxum has joined #lisp
v_m_v has joined #lisp
scymtym has quit [Ping timeout: 240 seconds]
ljavorsk has quit [Ping timeout: 258 seconds]
ebrasca has joined #lisp
FreeBirdLjj has joined #lisp
v_m_v has quit [Remote host closed the connection]
lottaquestions_ has joined #lisp
FreeBirdLjj has quit [Ping timeout: 240 seconds]
lottaquestions has quit [Ping timeout: 255 seconds]
Lycurgus has joined #lisp
flamebeard has quit []
rumbler3168 has joined #lisp
oxum_ has joined #lisp
oxum has quit [Ping timeout: 256 seconds]
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
hlavaty has quit [Remote host closed the connection]
montaropdf has quit [Quit: ERC (IRC client for Emacs 26.3)]
gko_ has quit [Ping timeout: 256 seconds]
v_m_v has joined #lisp
v_m_v has quit [Remote host closed the connection]
lottaquestions has joined #lisp
caltelt has quit [Remote host closed the connection]
lottaquestions_ has quit [Ping timeout: 268 seconds]
v_m_v has joined #lisp
caltelt has joined #lisp
v_m_v has quit [Ping timeout: 265 seconds]
lottaquestions_ has joined #lisp
lottaquestions has quit [Ping timeout: 256 seconds]
thecoffemaker has quit [Read error: Connection reset by peer]
oxum has joined #lisp
oxum_ has quit [Ping timeout: 255 seconds]
prince1 has joined #lisp
v88m has quit [Ping timeout: 258 seconds]
prince1 has quit [Ping timeout: 240 seconds]
gmeister has quit [Quit: WeeChat 2.4]
shka_ has joined #lisp
davepdotorg has quit [Ping timeout: 255 seconds]
asarch has joined #lisp
rumbler3168 has quit [Ping timeout: 240 seconds]
lottaquestions_ has quit [Ping timeout: 265 seconds]
lottaquestions has joined #lisp
lottaquestions_ has joined #lisp
lottaquestions has quit [Ping timeout: 268 seconds]
EvW has quit [Ping timeout: 256 seconds]
Cymew has quit [Ping timeout: 256 seconds]
lottaquestions has joined #lisp
lottaquestions_ has quit [Ping timeout: 268 seconds]
mangul is now known as shangul
felideon has joined #lisp
hhdave has quit [Quit: hhdave]
hiroaki has joined #lisp
caltelt has quit [Ping timeout: 240 seconds]
fanta1 has quit [Quit: fanta1]
<asarch> picolisp?
lottaquestions_ has joined #lisp
lottaquestions has quit [Ping timeout: 256 seconds]
frgo has quit [Remote host closed the connection]
kslt1 has quit [Remote host closed the connection]
ukari has quit [Remote host closed the connection]
Inline has joined #lisp
ukari has joined #lisp
lxbarbosa has joined #lisp
<random-nick> what exactly are logical pathnames?
<random-nick> CLHS just says it's implementation-dependant
<pjb> random-nick: logical pathnames are not implementation dependent. physical pathnames are implementation dependent.
didi has joined #lisp
<pjb> random-nick: so logical pathnames are implementation independent abstract pathnames that you can use in your application independently of the actual physical pathnames on the target platform.
<pjb> random-nick: the program, or the user, may provide a translation table to map logical pathnames to physical pathnames.
<didi> How do I read the other keys of (lambda (&key &allow-other-keys) ...)?
<Bike> What do you mean, didi?
<pjb> didi: with &rest.
<didi> Bike: ((lambda (&key &allow-other-keys)) :foo "bar") and I want to know :foo.
<didi> pjb: Thanks.
<pjb> ((lambda (&rest other-keys &key &allow-other-keys) (loop for (k v) on other-keys by (function cddr) collect k)) :foo 42 :bar 33) #| --> (:foo :bar) |#
<Bike> ah. then yeah, &rest
* didi bows
v_m_v_ has joined #lisp
whiteline has quit [Remote host closed the connection]
whiteline has joined #lisp
sauvin has quit [Read error: Connection reset by peer]
didi has left #lisp ["O bella ciao bella ciao bella ciao, ciao, ciao."]
ebzzry has quit [Ping timeout: 265 seconds]
dddddd has joined #lisp
shangul has quit [Remote host closed the connection]
shangul has joined #lisp
Bike has quit [Remote host closed the connection]
shangul has quit [Ping timeout: 240 seconds]
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
Bike has joined #lisp
iAmDecim has joined #lisp
dddddd has quit [Ping timeout: 256 seconds]
snits has quit [Quit: leaving]
snits has joined #lisp
shka_ has quit [Ping timeout: 256 seconds]
akoana has left #lisp ["Leaving"]
asarch has quit [Quit: Leaving]
prince1 has joined #lisp
seok has quit [Remote host closed the connection]
dddddd has joined #lisp
prince1 has quit [Ping timeout: 265 seconds]
cosimone has joined #lisp
efm has quit [Quit: Konversation terminated!]
jeosol has quit [Remote host closed the connection]
entel has joined #lisp
buffergn0me has quit [Ping timeout: 256 seconds]
rpg has joined #lisp
<rpg> Could anyone offer a pointer to a Travis configuration for testing a CL library?
<rpg> Thanks!
shka_ has joined #lisp
buffergn0me has joined #lisp
varjag has joined #lisp
efm has joined #lisp
iAmDecim has quit [Ping timeout: 265 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
ggole has quit [Quit: Leaving]
shka_ has quit [Ping timeout: 268 seconds]
shka_ has joined #lisp
luckless has quit [Remote host closed the connection]
luckless has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
zulu_inuoe has quit [Remote host closed the connection]
zulu_inuoe has joined #lisp
lisplearner has joined #lisp
zulu_inuoe has quit [Ping timeout: 268 seconds]
cosimone has quit [Quit: Quit.]
v_m_v_ has quit [Remote host closed the connection]
Lord_of_Life_ has joined #lisp
iAmDecim has joined #lisp
buffergn0me has quit [Read error: Connection reset by peer]
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life_ is now known as Lord_of_Life
lisplearner has quit [Remote host closed the connection]
iAmDecim has quit [Ping timeout: 240 seconds]
jcowan has joined #lisp
<jcowan> Can anyone point me to a description of how threads and dynamic variables interact, especially in systems using kernel-level threads? Obviously this is implementation-specific, but I don't at present care which implementation is described.
<Bike> that's actually semi standardized. see make-thread in https://trac.common-lisp.net/bordeaux-threads/wiki/ApiDocumentation
jeosol has joined #lisp
<Bike> tl;dr globals are shared, bindings are not, new threads may or may not inherit bindings.
<White_Flame> and being OS-provided threads vs userspace threading implementation shouldn't matter
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
izh_ has joined #lisp
refpga has joined #lisp
luckless has quit [Read error: Connection reset by peer]
luckless has joined #lisp
sjl has joined #lisp
<jcowan> Thanks.
<jcowan> When local bindings are not shared, are they typically copied from the creating threads, or set to the global value?
lisplearner has joined #lisp
<phoe> likely the latter
<phoe> or rather
<fe[nl]ix> it's implementation-specific
<Inline> global poisoning ?
<Inline> bleh
<Inline> that's not wished for anyway
<phoe> it is possible to set the global binding from one thread and have that affect the other
<phoe> at least in some impls
<fe[nl]ix> that's why bordeaux-threads has its own way of specifying initial bindings
<jcowan> So there are three cases: shared, copied, completely new?
<Inline> either you have some application logic which requires copying values to globals
<phoe> so if you do not want that to happen, do what fe[nl]ix says and create new bindings for that thread
<Inline> or you somehow can access them thread-local wise.....
<phoe> or if you *want* globals that you can edit from between multiple threads, use https://github.com/lmj/global-vars
<Bike> two cases. a new thread either accesses its own bindings (with copied values or not), or global bindings. it can't alter its parent's bindings.
<Bike> i think
<jcowan> Bordeaux-threads explicitly permits this
<Bike> Permits what?
<Bike> oh, you're right. never mind me then.
<fe[nl]ix> jcowan: AFAIK no implementation shares bindings
iAmDecim has joined #lisp
<jcowan> Shared local bindings: "Local bindings in the the caller of MAKE-THREAD may or may not be shared with the new thread that it creates: this is implementation-defined."
<Bike> thought it was just talking about the values, my b
<fe[nl]ix> so it's either copy or null (revert to global)
luni has joined #lisp
<jcowan> I'm surprised that b-t explicitly permits this if it's unused by any implementation.
<Bike> might have been done when b-t was new?
<fe[nl]ix> jcowan: what are you referring to ?
* jcowan scratches his head
<jcowan> The remark I quoted above, which comes from the linked page on b-t
<fe[nl]ix> I need to update the docs
<fe[nl]ix> that sentence refers to the native behaviour
<jcowan> Different Schemes use all three strategies: the null strategy has been declared non-conformant, and the other two strategies are finessed by not allowing local bindings to be mutated as opposed to rebound.
<jcowan> s/finessed/& in portable code
Lycurgus has quit [Quit: Exeunt]
<Inline> so you can't add new bindings nor delete existing bindings in a thread from the outside
iAmDecim has quit [Ping timeout: 268 seconds]
<Inline> you can only change the values of the existing bindings in that thread
<Inline> ?
<jcowan> Only if you share a common ancestry with them and your implementation uses the sharing approach. Nobody that I know of allows you to mutate the bindings of an arbitrary thread from an arbitrary other thread.
jeosol has quit [Remote host closed the connection]
shka_ has quit [Ping timeout: 260 seconds]
<Inline> hmmm
<Bike> sbcl exports sb-thread:symbol-value-in-thread, which lets you read and write them from other threads.
<fe[nl]ix> jcowan: (bt:interrupt-thread <thead> (lambda () (setf *foo* 42)))
<jcowan> Bike: ah, thanks
<jcowan> so essentially running code in the context of another thread
<fe[nl]ix> yes
<fe[nl]ix> you can implement symbol-value-in-thread in terms of interrupt-thread
vlatkoB has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
scymtym has joined #lisp
ukari has quit [Remote host closed the connection]
lisplearner has quit [Remote host closed the connection]
ukari has joined #lisp
<jcowan> I note that b-t supports the eeeeevil destroy-thread
<White_Flame> it always bugs me from a micro-optimization perspective that there's no (as far as I'm aware) declaration to say "always use the TLS value, and don't fallback to global"
<White_Flame> since lots of my usage only ever uses a tread-local binding
EvW1 has joined #lisp
<White_Flame> and the disasembly always shows a test for unbound TLS lookup and fallback to global
hiroaki has quit [Ping timeout: 256 seconds]
Kevslinger has joined #lisp
Bike has quit [Remote host closed the connection]
Bike has joined #lisp
prince1 has joined #lisp
amerigo has joined #lisp
iAmDecim has joined #lisp
hiroaki has joined #lisp
prince1 has quit [Ping timeout: 268 seconds]
<phoe> seems like there's no explicit per-thread-local storage in modern implementations
iAmDecim has quit [Ping timeout: 255 seconds]
<phoe> like static global variables from global-vars, just having a per-thread binding that is impossible to rebind
<rpg> @fe[nl]ix: Thanks for sending that Travis script. I have it *almost* working thanks to your help. I'm getting a problem where my 5AM test job runs long, and Travis squashes it because of no output for 10 minutes. Do you by any chance know if there's a way to cause 5AM to periodically write something to the console?
narimiran has quit [Ping timeout: 265 seconds]
<jackdaniel> White_Flame: while not as convenient as simply putting a symbol, you may use sb-thread:symbol-value-in-thread
<rpg> @fe[nl]ix: Actually, never mind -- I found a loop that would run very long, not printing anything unless some member of its set of plans failed. Adding gratuitous output will fix this, I hope!
jeosol has joined #lisp
<phoe> rpg: one usually wants plenty of output in CI logs anyway, in case something goes bad
gravicappa has quit [Ping timeout: 265 seconds]
<jackdaniel> however I doubt it will be faster
luni has left #lisp [#lisp]
<White_Flame> yeah, that's a pretty reasonable doubt :-P
<White_Flame> although, might as well test
<White_Flame> doesn't look like there's any inline optimization in using sb-thread:*current-thread*, although it's next to tools that might be abke to hack direct access
shifty has joined #lisp
<jcowan> You could simulate per-thread variables by using thread objects as property indicators on the p-list of the symbol, though you'd need to gc them somehow if you have lots of threads being created and dying.
<rpg> phoe: Yes. This isn't really useful information I am printing, though -- it's more a heartbeat than anything else.
rpg has quit [Quit: Textual IRC Client: www.textualapp.com]
devon has joined #lisp
<White_Flame> yeah, manually using the low-level TLS access stuff compiles to much larger code than dereferencing a variable. It doesn't constant propagate the symbol offset, and currently has to hit the symbol-value of *current-thread*
<White_Flame> although, it reads *current-thread* ONLY from the TLS without a global fallback, which is exactly what I want. I wonder how it's declared...
caltelt has joined #lisp
<White_Flame> (sb-impl::define-thread-local <var> <val> <doc>). Cool
<White_Flame> but... that doesn't seem to exist at runtime :-P
<White_Flame> I think the "best" way might be to define a custom VOP, since it generates just a single asm instruction
<phoe> rpg: (let ((stream *standard-output*)) (bt:make-thread (lambda () (loop do (sleep 10) if *keep-printing-p* do (princ "." stream) else (loop-finish)))))
<phoe> I mean, else do (loop-finish)
<Bike> White_Flame: there's an sb-ext:global proclamation, so sbcl could just be extended to have the opposite of that
<White_Flame> yeah, I've used that one
izh_ has quit [Quit: Leaving]
shifty has quit [Ping timeout: 258 seconds]
shifty has joined #lisp
<jackdaniel> while local would be proper english, disglobal sounds so much better ,)
<Shinmera> unglobald
<aeth> We can use "special characters" in names. Take advantage of that. ~global or ¬global
<Bike> i guess the issue is that global is a pretty easy to enforce declaration, but local is not
<Bike> maybe if you also gave it a default thread local binding
<phoe> but you can't do that with a declaration alone, or can you
<phoe> s/declaration/proclamation/
<sjl> def🌐
<Bike> you could have proclaim signal an error if you try to proclaim local-ness for a variable with no default thread local whatever... i guess the default thread local whatevers can be removed later, though.
<phoe> or proclaim it to be local
<phoe> and have the default value be the unbound marker
<phoe> just like in case of one-arg DEFVAR
<White_Flame> that's the existing behavior
<Bike> oh, yeah, that's true, i guess you don't need to worry about boundedness so much
<White_Flame> the TLS table is checked first, and if it's unbound, then the global slot is used
<Bike> just compile references to *foo* to check the TL value and then otherwise signal unbound
frgo has joined #lisp
<jackdaniel> White_Flame: I can't help but wonder, is this really the bottleneck in your application?
EvW1 has quit [Ping timeout: 240 seconds]
<White_Flame> no, it's just a tiny microoptimization, as stated
<White_Flame> something that annoys me in disassemblies
<jackdaniel> ah, OK
iAmDecim has joined #lisp
<White_Flame> but writes are actually worse than reads, which I do quite often to set debugging progress info
montxero has joined #lisp
<jackdaniel> I rarely look at disassemblies, usually when I have a bottleneck which can't be normally addressed or when I have some nasty bug
orivej has joined #lisp
frgo has quit [Ping timeout: 265 seconds]
refpga has quit [Remote host closed the connection]
z147 has joined #lisp
EvW has joined #lisp
Bike has quit [Quit: Bike]
<aeth> I frequently look at disassemblies. It can be very useful to e.g. objectively see if two different ways to write the code produce the same end result in a given compiler (and optimization levels, etc.).
<White_Flame> it can also be useful to increase blood pressure in seeing a lack of peephole optimizer in sbcl ;)
shifty has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
<aeth> I kind of wish there was an exposed IR (if compilers use IR) because you don't really need the *assembly*, you just need something to show that two things are equivalent.
<jackdaniel> hm, interesting idea
ljavorsk has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
<jackdaniel> maybe it could be an extension to disassemble as a keyword argument
<jackdaniel> :show-ir t
<aeth> If the IR is returned as s-expressions from a function, then you could just EQUALP a global to see if changing the code changes the IR...
<aeth> Sometimes that's all you need.
samarth has joined #lisp
iAmDecim has quit [Ping timeout: 256 seconds]
ljavorsk has quit [Ping timeout: 240 seconds]
elderK has joined #lisp
<elderK> Good morning, everyone!
<minion> elderK, memo from phoe: PLNs are now in SBCL, CCL, ECL, ACL, ABCL, Clasp, and will be available in LW after the next release.
<elderK> I was wondering why some people enter the cl-user package before they define new packages.
LiamH has quit [Quit: Leaving.]
<aeth> elderK: because DEFPACKAGE might not be there.
v_m_v has joined #lisp
<aeth> elderK: I personally do (cl:defpackage ...) and (cl:in-package ...) but most tools aren't smart enough to realize that that's the same thing as defpackage and in-package
<aeth> So it does break e.g. highlighting
<elderK> aeth: Ah, I see. That makes sense. Thank you.
<jackdaniel> I always use defpackage and in-package
<aeth> elderK: Until you get to the line after the cl:in-package part of your file, you simply don't know what package you're actually in. So everything before that point should use cl, if they're not first in-packaged instead.
<jackdaniel> if someone spoofs these symbols when loading/compiling the file, then they probably know what they are doing
<aeth> jackdaniel: I'm more concerned about the symbol not being present at all, rather than being spoofed.
<jackdaniel> it is unlikely it won't exist
<jackdaniel> and you give a freeway to people who want to do interesting things with packages
<jackdaniel> (by not specifying cl verbatim)
<jackdaniel> note, that you don't know what readtable you are in neither (;
<elderK> Another question I have, regarding aesthetics, is regarding the margin used by most CL developers. In the C world, I'm used to working within 76 characters. I have been trying to keep to that limit in the CL I write, but I'm finding it difficult.
<elderK> So, I was wondering what the common limit is :)
<elderK> Also, hi jackdaniel! I know you from #osdev :)
<jackdaniel> I don't think I've ever joined this channel
<aeth> jackdaniel: Well, all I do about the reader is not assume upcasing. So I do (symbol-name '#:foo) instead of "FOO" in macros. A compiler should be able to turn that into the constant "FOO". I used to put a #. in front, but that's unnecessary.
<elderK> jackdaniel: Perhaps I am mistaken. I could've been sure that I've seen you either there, or on the osdev forums. If not, my mistake.
<elderK> Yet another question: Is there any merit in using #:thing vs. :thing vs thing in defpackage, say for exports?
<jackdaniel> elderK: I'm not in these circles, so you probably think about someone else
<aeth> elderK: It's probably a name collision.
<jackdaniel> as of thing, #:thing would be best, because you don't intern any symbols in other packages
<jackdaniel> if you do simply thing, then you intern in whatever package is in action, if you do :thing, you create a keyword
<jackdaniel> n.b, same goes for package names
<jackdaniel> (defpackage #:foobar …) (in-package #:foobar)
<elderK> Thank you
<jackdaniel> sure
<aeth> My style is (cl:defpackage #:foobar (:use #:cl) (:export #:foo #:bar))
<aeth> At the moment, I do an extensive list of IMPORT-FROMs, but maybe I should use PLNs
frgo has joined #lisp
prince1 has joined #lisp
<elderK> aeth: I've been using a lot of import-froms, too.
frgo has quit [Ping timeout: 258 seconds]
random-nick has quit [Ping timeout: 240 seconds]
v_m_v has quit [Remote host closed the connection]
<z147> elderK, two of the style guides suggests 100 columns for CL https://google.github.io/styleguide/lispguide.xml https://lisp-lang.org/style-guide/
samarth has quit [Remote host closed the connection]
<aeth> I use 100 columns as a "soft limit", as in if you have to rewrite your code just to meet line limit rules, you're probably going to mess things up
<jackdaniel> I'm using 80 characters, because on 1080p lapop it makes two columns full screen, and on 4k monitors it makes four columns with a font which is good for me
<jackdaniel> and indeed, where it is due, the "limit" is broken
<aeth> For my font size, screen, configuration, etc., my limit to fit in a column with a 4-way split is 92.
<aeth> *92 characters
<aeth> If people are utilizing their screens to the fullest, they probably are somewhere between 80 and 120 characters for a file, so the limits are absolutely still relevant today.
lxbarbosa has quit [Remote host closed the connection]
<aeth> 72-80 is pretty hard because of the long names that idiomatic Lisp has
refpga has joined #lisp
Bike has joined #lisp
<z147> Oh if more were idiomatic, sure makes reading easier.
<aeth> (let ((|The most descriptive variable name is the variable itself.| "The most descriptive variable name is the variable itself.")) |The most descriptive variable name is the variable itself.|) => "The most descriptive variable name is the variable itself."
<Odin-> There is such a thing as overkill.
<Odin-> Also, isn't the pretty printer basically a response to needing to fit Lisp code into relatively narrow outputs?
<jackdaniel> (let ((|There is such a thing as overkill| t)) (values |There is such a thing as overkill| :goodnight);)
<Odin-> The existence of miser mode rather suggests that to me.
<aeth> (defun |Who needs docstrings? This function is used in the following manner...| (...) ...)
<aeth> That builds in function versioning, too. If you change the function in a way that you need to change its documentation, it's probably best to rename it, anyway, so that old callers use the stable API. Bugfixes do not need to change the documentation.
<Odin-> That would probably very quickly get about as comprehensible as assembly.
<Odin-> At the very least about as verbose.
entel has quit [Quit: Connection closed for inactivity]
samarth has joined #lisp
v_m_v has joined #lisp
samarth has quit [Remote host closed the connection]
samarthk has joined #lisp
<aeth> Odin-: At the character level, yes, but not at the token level!
<aeth> Odin-: But more problematically, with the level of documentation typical to a CL project, too many functions would be named ||
Josh_2 has joined #lisp
ebrasca has quit [Remote host closed the connection]
v_m_v has quit [Ping timeout: 258 seconds]
<aeth> Or, I suppose more accurately, most CL projects already follow my naming scheme: the function name is the documentation!
<Odin-> That is true.
torbo has joined #lisp
terpri has quit [Ping timeout: 240 seconds]
efm has quit [Ping timeout: 260 seconds]
efm has joined #lisp
caltelt has quit [Ping timeout: 240 seconds]
montxero has quit [Ping timeout: 256 seconds]
hiroaki has quit [Ping timeout: 268 seconds]
montxero has joined #lisp
hdasch has quit [Ping timeout: 258 seconds]
orivej has quit [Ping timeout: 268 seconds]
hdasch has joined #lisp
__jrjsmrtn__ has joined #lisp
_jrjsmrtn has quit [Ping timeout: 260 seconds]