Xach changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook>
Mandus has quit [Ping timeout: 252 seconds]
Mandus has joined #commonlisp
<Psybur> thanks
Psybur has quit [Remote host closed the connection]
zazzerino has joined #commonlisp
brettgilio has joined #commonlisp
igemnace has quit [Quit: WeeChat 3.3]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 252 seconds]
cyberbanjo has joined #commonlisp
Guest-liao has joined #commonlisp
winning-luser has joined #commonlisp
winning-luser has quit [Client Quit]
winning-luser has joined #commonlisp
taiju has joined #commonlisp
paule32_ has joined #commonlisp
paule32__ has joined #commonlisp
paule32 has quit [Ping timeout: 252 seconds]
paule32_ has quit [Ping timeout: 265 seconds]
paule32 has joined #commonlisp
paule32__ has quit [Ping timeout: 265 seconds]
tyson2 has quit [Remote host closed the connection]
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
<beach> Good morning everyone!
wyrd has joined #commonlisp
Guest-liao has quit [Ping timeout: 256 seconds]
lisp123 has joined #commonlisp
wyrd has quit [Quit: leaving]
<winning-luser> a good morning to read norvig's paip
taiju has quit [Ping timeout: 245 seconds]
semz has joined #commonlisp
wyrd has joined #commonlisp
zazzerin` has joined #commonlisp
zazzerino has quit [Ping timeout: 264 seconds]
taiju has joined #commonlisp
Guest-liao has joined #commonlisp
winning-luser has quit [Quit: zzz]
taiju has quit [Read error: Connection reset by peer]
taiju has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
<White_Flame> Have you read your PAIP today?
<lisp123> White_Flame: Tomoorrow for me :)
<lisp123> How about you?
<kagevf> sicp or paip - which one should be read first?
<White_Flame> paip is more practical, sicp is more foundational/conceptual'
asarch has joined #commonlisp
<lisp123> Well I haven't finished PAIP. But SICP is a life changing experience
<lisp123> So with the idea of not having to wait to read SICP, read SICP first :D
<White_Flame> SICP is also Scheme, PAIP is CL
<White_Flame> (or is it pre-ansi cl?
<White_Flame> )
<kagevf> paip is from 90 or 91, so I guess it's pre-finishing the standard
<kagevf> I'm hesitant to read non-CL books, but I'm considering making an exception for sicp ... or maybe I should try to work through it in CL??
<mfiano> Yes, PAIP points to CLtL2 as the definitive reference.
<White_Flame> I don't recall any mismatch with standard CL, though. if any, it would be quite minor
<mfiano> And, even though CLtL2 defined CLOS, it was not widely agreed upon yet, and as such, the book uses structs exclusively.
<mfiano> (and regular functions)
<lisp123> kagevf: Actually I find learning a bit of scheme helped liberate and further my understanding of CL. It's not hard to pick up, but eventually you get to know of the differences between the two languages and IMO it makes you better at CL
<kagevf> lisp123: is there a scheme version of slime for emacs?
<kagevf> if not, I guess I could use Dr Racket in mit scheme mode ...
<mfiano> This channel is about Common Lisp. If you want to talk about other Lisps, there is #lisp
<kagevf> sorry
<lisp123> kagevf: I have to jump, but I'll send you my .emacs settings for Scheme in a few days. Ok no more scheme in this chat :)
<kagevf> alright, thanks
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
<White_Flame> hmm, Psybur is gone, but #2a(#.(coerce "abc" 'list)) is a very hacky way of making it a syntactically 2d vector of chars
lisp123 has quit [Quit: Leaving...]
<mfiano> White_Flame: A vector is specifically 1 dimensional.
<White_Flame> erm, 2d array ;)
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
waleee has quit [Ping timeout: 252 seconds]
Bike has quit [Quit: Lost terminal]
<asarch> If (foo) calls (bar) and then it calls (baz) to finally calls (spam), is it possible to know where in that in-between process is taking so long time and why?
<beach> asarch: Profile all the functions.
<hayley> Just interrupt the program while it's running, and look at the backtrace?
<asarch> How?
<asarch> I suspect it is in a string concatenation process after doing a query to a PostgreSQL cluster
<hayley> C-c C-c in Emacs, C-c in a terminal.
<asarch> The String concatenation process parses the query output to set it up into HTML elements to respond the message
<hayley> Well, don't tell me about it, just profile or interrupt it, and see what you get.
<beach> If you are using SBCL, check out SB-PROFILE:PROFILE.
<asarch> (SB-PROFILE:PROFILE) output: https://pastebin.com/fvMwnPgm
<hayley> Oh, okay, this function is being called from another thread, so you cannot interrupt it that easily.
<asarch> D'oh!
Nilby has joined #commonlisp
<White_Flame> the statistical profiler can do :threads :all
<White_Flame> sb-sprof:
<White_Flame> with-profiling
<White_Flame> oh,the default is all threads, too
<asarch> Where could I learn more about profiling?
<White_Flame> need :report :flat or :graph to see anything
<asarch> Thank you!
<beach> asarch: You need to start reading the documentation of the Common Lisp implementation you are using.
<beach> asarch: If you did that, you would have found this chapter: http://www.sbcl.org/manual/#Profiling
<asarch> Yeah, I need a way to enabled it globally
<beach> Enable reading of the SBCL manual?
<asarch> Instead of doing (sb-sprof:with-profiling ...) for each function
<asarch> No, I mean, to enabling the profiling for all functions
dre_ has joined #commonlisp
<beach> asarch: WITH-PROFILING doesn't designate the functions that are profiled.
<beach> It profiles everything.
dre has quit [Ping timeout: 252 seconds]
dre__ has joined #commonlisp
<White_Flame> "regular" profiling instruments functions. stastical profiling just interrupts every N milliseconds and sees what functions are on the stack
dre_ has quit [Ping timeout: 252 seconds]
zazzerin` has quit [Remote host closed the connection]
<mfiano> A nice side-effect of the latter is it annotates the lines of #'disassemble with sample counts
<mfiano> For whomever didn't know.
<hayley> Also note that the counts tend to be on the wrong instructions, usually on the instruction after.
abrantesasf has joined #commonlisp
abrantesasf has quit [Remote host closed the connection]
<mfiano> It is a with-* style macro. You wrap it around code
<mfiano> Such as your toplevel function
<mfiano> Or key interesting functions
abrantesasf has joined #commonlisp
abrantesasf has quit [Remote host closed the connection]
<hayley> WITH-PROFILING won't work too well if you already have a server running, and additionally if you create new threads in the body, from experience.
<asarch> Yeah: (sb-sprof:with-profiling (:max-samples 1000 :report :flat :loop t :show-progress t) (cpu-test 24))
<asarch> But what if you can only define the function and other process calls it for you?
<hayley> I vaguely remember this, let me check...
<asarch> In my case, I do: (defun foo () ...) and some other function calls it for me when the user visits "/foo"
<hayley> (sb-sprof:start-profiling) <do some stuff you want to profile> (sb-sprof:stop-profiling) (sb-sprof:report :type :flat)
<mfiano> Don't you also want to reset?
<mfiano> After reporting, or does that do it automatically?
<hayley> Yes, reset before profiling again.
<mfiano> I usually do it before start and after report, just incase
asarch has quit [Ping timeout: 252 seconds]
gaqwas has joined #commonlisp
Catie has quit [Quit: time]
asarch has joined #commonlisp
<asarch> Ok, this is the log: https://pastebin.com/FkrQv2hq
<asarch> Sorry but we have the worst Interne' on earth
<hayley> There's a fair bit of compiler noise, because you profiled loading the file too. But (SB-PCL::FAST-METHOD ELEMENTOS:RENDEREAR (ELEMENTOS:INDICE)) still sticks out.
<mfiano> Should that be RENDER-EAR or RENDERER?
<mfiano> also shouldn't that be INDEX?
<asarch> It is Mexicanglish señor
<asarch> :-P
<mfiano> I won't try to read it then.
azimut has quit [Ping timeout: 276 seconds]
<asarch> " 1 617 25.3 880 36.1 617 25.3 - (SB-PCL::FAST-METHOD ELEMENTOS:RENDEREAR (ELEMENTOS:INDICE))"
azimut has joined #commonlisp
dre__ has quit [Quit: Leaving]
<asarch> Actually, this is the function: https://pastebin.com/UDQ2mnHz
<samebchase> asarch: This is the first time I'm seeing Spanish code. Nice! 🤠
<asarch> I use to debug more quickly
Cymew has joined #commonlisp
<hayley> That is the code for the route, but not for the method for RENDEREAR.
<asarch> Yeah, sorry. Slow Interne': https://pastebin.com/Q5cYgmAZ
<asarch> That's the code for those functions
<asarch> A small HTML-code generator
<hayley> Looks like you guessed right with the string concatenation being a problem.
<mfiano> Well the algoriothmic time complexity of the indice method is...something
<hayley> One option would be to collect each rendered row into a string, and then concatenate from that list (e.g. (format nil "~{~a~}" rows)). Though it also would be a good idea to use a HTML library such as CL-WHO.
<mfiano> Edi himself recommends against that
<mfiano> Use something else that doesn't suffer from the same fundamental design problems.
<asarch> That function takes the code from the query, parses its components and the passes the result into the template to make this: https://pasteboard.co/7LEpyJx8qqZp.png
<mfiano> My recommendation would be spinneret
<hayley> That's news to me. Where did he say that?
<mfiano> hayley: In an email I sent him, asking him why he recommended others over his own in Common Lisp Recipes.
<hayley> Huh. Well.
Spawns_Carpeting has quit [Ping timeout: 252 seconds]
<asarch> Is there a library to handle big quantity of Strings?
<asarch> Data processing?
<hayley> I don't think there are good answers for that question right now. You probably aren't going to concatenate strings any faster than CONCATENATE; you need to avoid concatenating big strings repeatedly.
<beach> asarch: How big? I am asking because lots of people, even very smart ones, overestimate the amount of memory required.
<mfiano> beach: Read the method specialized on INDICE in the link above
<hayley> beach: The problem is that asarch is performing (setf accumulator (concatenate 'string accumulator another-string)) in a loop.
<beach> But that's a problem for execution time, right?
<hayley> Yes.
<beach> I was asking about the "handle big quantity of Strings".
<mfiano> It seems most of that string can be cached at accessor writing time and read at render time.
<asarch> Yeah, the loop seems to be the problem
<asarch> However, which other way could parse every element of the original string, give a format and the save the result into a variable?
<mfiano> I would use an adjustable character vector stored inside the object
<mfiano> Then you aren't needlessly allocating lots of small strings
<mfiano> and can just reuse existing memory
<mfiano> If I understand correctly anyway. This is an algorithmic problem, not really that of a data structure (string)
<Nilby> Or make a string class that has O(1) concatenation
<asarch> A fellow from C# was talking about the ConcurrentBag object when you need multiple instances of complex objects and you don't want to allocate memory constantly
<asarch> You could use a small list to reuse every instance
<asarch> Is there something similar in Common Lisp?
taiju has quit [Ping timeout: 245 seconds]
<beach> I recommend Flexichain for this kind of stuff.
<asarch> Nice!
<asarch> I think this kind of situation is the main mantra of Perl, right?
<asarch> That's why you could easily slurp an entire big file
taiju has joined #commonlisp
<asarch> Anyway. See you later and thank you very much for your advices. Have a nice day :-)
asarch has quit [Quit: Leaving]
gaqwas has quit [Ping timeout: 265 seconds]
wyrd has quit [Quit: leaving]
wyrd has joined #commonlisp
lieven has joined #commonlisp
wyrd has quit [Client Quit]
wyrd has joined #commonlisp
srhm has quit [Ping timeout: 265 seconds]
srhm has joined #commonlisp
thonkpod has quit [Ping timeout: 246 seconds]
cosimone has joined #commonlisp
thonkpod has joined #commonlisp
heisig has joined #commonlisp
wyrd has quit [Quit: leaving]
snits has joined #commonlisp
random-nick has joined #commonlisp
wyrd has joined #commonlisp
makomo_ has joined #commonlisp
wyrd has quit [Quit: leaving]
wyrd has joined #commonlisp
wyrd has quit [Client Quit]
wyrd has joined #commonlisp
pranavats has left #commonlisp [#commonlisp]
_heisig has joined #commonlisp
heisig has quit [Ping timeout: 252 seconds]
srhm has quit [Ping timeout: 265 seconds]
srhm has joined #commonlisp
_heisig is now known as heisig
srhm has quit [Ping timeout: 265 seconds]
srhm has joined #commonlisp
pranavats has joined #commonlisp
hendursa1 has joined #commonlisp
hendursaga has quit [Ping timeout: 276 seconds]
taiju has quit [Ping timeout: 264 seconds]
Guest-liao has quit [Ping timeout: 256 seconds]
makomo_ has quit [Ping timeout: 252 seconds]
taiju has joined #commonlisp
azimut has quit [Ping timeout: 276 seconds]
Guest-liao has joined #commonlisp
prxq has joined #commonlisp
makomo_ has joined #commonlisp
Guest-liao has quit [Ping timeout: 256 seconds]
makomo_ has quit [Ping timeout: 260 seconds]
makomo_ has joined #commonlisp
Qwnavery has joined #commonlisp
cranium has joined #commonlisp
cyberbanjo has quit [Remote host closed the connection]
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
Qwnavery has quit [Quit: WeeChat 3.3]
amb007 has quit [Ping timeout: 245 seconds]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
Guest-liao has joined #commonlisp
cranium has quit [Ping timeout: 252 seconds]
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
dec0d3r has quit [Remote host closed the connection]
rotateq has joined #commonlisp
tfeb has joined #commonlisp
Bike has joined #commonlisp
Lycurgus has joined #commonlisp
tfeb has quit [Quit: died]
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
Guest-liao has quit [Ping timeout: 256 seconds]
JeromeLon has quit [Ping timeout: 245 seconds]
mingus has joined #commonlisp
igemnace has joined #commonlisp
JeromeLon has joined #commonlisp
makomo_ has quit [Ping timeout: 265 seconds]
makomo_ has joined #commonlisp
Lycurgus has quit [Quit: Exeunt]
skeemer has joined #commonlisp
tyson2 has joined #commonlisp
azimut has joined #commonlisp
Guest-liao has joined #commonlisp
cage has joined #commonlisp
cosimone has quit [Remote host closed the connection]
rain3 has joined #commonlisp
Guest-liao has quit [Quit: Client closed]
Guest-liao has joined #commonlisp
Guest-liao has quit [Ping timeout: 256 seconds]
<skeemer> can i use quicklisp to load external dependencies in my project?
<Bike> usually you write your project with a system definition .asd which includes external dependencies. if you then use quicklisp to load your project, it will take care of downloading anything you don't have downloaded. which is to say yes, but you probably don't want your project to actually use quicklisp itself unless it's a script kind of deal.
hendursa1 has quit [Ping timeout: 276 seconds]
Guest-liao has joined #commonlisp
cranium has joined #commonlisp
pve has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
<mfiano> Reminder: To anyone looking to have some fun this weekend (and all of next week in their spare time), the Lisp Game Jam friendly competition is kicking off tonight/tomorrow at midnight EDT: https://itch.io/jam/autumn-lisp-game-jam-2021
hendursa1 has joined #commonlisp
fitzsim has joined #commonlisp
rotateq has quit [Remote host closed the connection]
makomo_ has quit [Ping timeout: 265 seconds]
makomo_ has joined #commonlisp
cosimone has joined #commonlisp
robin_ has joined #commonlisp
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
robin_ has quit [Remote host closed the connection]
robin_ has joined #commonlisp
<stack_> Good morning
<beach> Hello stack_.
robin_ has quit [Remote host closed the connection]
robin_ has joined #commonlisp
robin_ has quit [Remote host closed the connection]
robin_ has joined #commonlisp
srhm has quit [Ping timeout: 252 seconds]
srhm has joined #commonlisp
akoana has joined #commonlisp
<semz> There's also afaik still the problem that quicklisp doesn't verify downloads (has there been movement on that front?)
<semz> it's one thing to do that on your own machine, but if you ship something that uses quicklisp in normal operation, your users will probably not appreciate that
Posterdati has joined #commonlisp
Guest-liao has quit [Ping timeout: 256 seconds]
robin_ has quit [Remote host closed the connection]
Nilby has quit [Ping timeout: 245 seconds]
robin_ has joined #commonlisp
robin_ has quit [Remote host closed the connection]
Guest-liao has joined #commonlisp
tyson2 has joined #commonlisp
Catie has joined #commonlisp
<JeromeLon> In a unit test, I want to check that a hook is called with the right argument. So I setup a special lexical witness variable, and update it from a lambda in the hook. But SBCL gives a warning, because there is no dynamic variable, even though everything is working fine. Any idea how I can improve this?
<JeromeLon> Either replacing the witness with something else, or getting rid of the warning?
<beach> There is no such thing as a special lexical variable.
<mfiano> JeromeLon: You are experiencing undefined behavior. Referencing a variable before defining it is not allowed by the standard.
<beach> mfiano: Do you think that's what it is?
<beach> JeromeLon: Why is the entire thing '(uint testname ...) quoted?
<JeromeLon> Oh, it's defined before compilation, but it's lexical
<White_Flame> where is your INCF form coming from?
<mfiano> Where is defvar or defparameter in relation to that function?
<White_Flame> but yeah, as far as this code goes, the specialness of *witness* only exists in that LET scope
<White_Flame> and you need defvar... yeah what mfiano said
<beach> mfiano: There doesn't have to be if it is declared SPECIAL.
<mfiano> I missed that line, thanks.
<White_Flame> if the INCF or access to *WITNESS* also exists outside that LET, then it would be handy
<JeromeLon> beach: it's a setting that was extracted from a setting repository, and passed as an argument. There are many parts in the setting, the hook is the only one that can be EVALed
<beach> JeromeLon: But EVAL is executed outside the scope of your LET
<White_Flame> JeromeLon: just use a defvar instead of locally declaring it special
<beach> JeromeLon: So your variable is not defined then.
<JeromeLon> White_Flame: right, but if all unit tests start to rely on defvars nothing is contained anymore
Guest-liao has quit [Quit: Client closed]
<White_Flame> the defvar is part of the testing harness
<White_Flame> the defvar as well as the test function that uses it are all local to the testing package
<JeromeLon> okok, so my solution only works by chance, and I should rely on a proper dynamic variable
<JeromeLon> thanks all!
Posterdati has quit [Ping timeout: 252 seconds]
jealousmonk has joined #commonlisp
xaotuk has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
Posterdati has joined #commonlisp
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #commonlisp
aeth has quit [Ping timeout: 265 seconds]
aeth has joined #commonlisp
<JeromeLon> For reference, I tried on sbcl, clisp and ecl. In all cases, declaring the lexical variable special works: it's not BOUNDP, but the EVALed sexp has access to it. My test is (defun f1 () (let ((w 0)) (declare (special w)) (eval '(incf w)) w))
robin has joined #commonlisp
ec has joined #commonlisp
<beach> JeromeLon: There is no such thing as a lexical special variable.
lisp123 has joined #commonlisp
cranium has quit [Quit: Leaving]
ec has quit [Ping timeout: 276 seconds]
edgar-rft has quit [Quit: Leaving]
lisp123 has quit [Quit: Leaving...]
<JeromeLon> beach: ok, how would you call it? "Dynamic variable that is only bound for the scope of the form that introduced it" is incorrect (BOUNDP is false).
<beach> If the form introduced it, it is bound, unless you explicitly make it unbound.
<beach> In your case (let (<stuff>)...) is the same as (let ((<stuff> nil))...) so your variable is bound in the scope of the LET.
<JeromeLon> beach: I agree it is bound. I was mentioning BOUNDP because BOUNDP only returns true for dynamic variables, not lexically bound variables.
<beach> Sort of.
<beach> Lexical variables are always bound, but there is no way to pass a lexical variable to BOUNDP.
ec has joined #commonlisp
<_death> you should pass (locally (declare (special w)) (incf w)) to eval instead
MatrixTravelerbo has quit [Quit: Bridge terminating on SIGTERM]
Mrtn[m] has quit [Quit: Bridge terminating on SIGTERM]
happy-dude has quit [Quit: Bridge terminating on SIGTERM]
yitzi has quit [Quit: Bridge terminating on SIGTERM]
loke[m] has quit [Quit: Bridge terminating on SIGTERM]
luis` has quit [Quit: Bridge terminating on SIGTERM]
katco has quit [Quit: Bridge terminating on SIGTERM]
etimmons has quit [Quit: Bridge terminating on SIGTERM]
Arcsech has quit [Quit: Bridge terminating on SIGTERM]
hayley has quit [Quit: Bridge terminating on SIGTERM]
Gnuxie has quit [Quit: Bridge terminating on SIGTERM]
Bi[m] has quit [Quit: Bridge terminating on SIGTERM]
saltrocklamp[m] has quit [Quit: Bridge terminating on SIGTERM]
bhyde[m] has quit [Quit: Bridge terminating on SIGTERM]
Duuqnd has quit [Quit: Bridge terminating on SIGTERM]
sp has quit [Quit: Bridge terminating on SIGTERM]
dieggsy has quit [Quit: Bridge terminating on SIGTERM]
santiagopim[m] has quit [Quit: Bridge terminating on SIGTERM]
alphapapa[m] has quit [Quit: Bridge terminating on SIGTERM]
dualinverter[m] has quit [Quit: Bridge terminating on SIGTERM]
CodeBitCookie[m] has quit [Quit: Bridge terminating on SIGTERM]
danirukun[m] has quit [Quit: Bridge terminating on SIGTERM]
rudi has quit [Quit: Bridge terminating on SIGTERM]
philnum[m] has quit [Quit: Bridge terminating on SIGTERM]
bitspook[m] has quit [Quit: Bridge terminating on SIGTERM]
akater[m] has quit [Quit: Bridge terminating on SIGTERM]
icepic1984[m] has quit [Quit: Bridge terminating on SIGTERM]
<beach> Yeah, that's a better solution.
igemnace has quit [Ping timeout: 265 seconds]
<JeromeLon> _death: nice, this fixes all my issues! No need for defvar, no warning, no global cluttering
katco has joined #commonlisp
<_death> right.. still, I'd usually prefer defvar.. btw we've discussed all this last month I think, but september has been known at last..
luis` has joined #commonlisp
bitspook[m] has joined #commonlisp
alphapapa[m] has joined #commonlisp
etimmons has joined #commonlisp
santiagopim[m] has joined #commonlisp
rudi has joined #commonlisp
Mrtn[m] has joined #commonlisp
happy-dude has joined #commonlisp
dieggsy has joined #commonlisp
akater[m] has joined #commonlisp
<_death> *to last
<Alfr> JeromeLon, does (boundp 'w) really tell you that w is unbound within the scope of that let? That's strange. (Precluding the case that you've makunbound it.)
icepic1984[m] has joined #commonlisp
Gnuxie has joined #commonlisp
saltrocklamp[m] has joined #commonlisp
hayley has joined #commonlisp
yitzi has joined #commonlisp
sp has joined #commonlisp
dualinverter[m] has joined #commonlisp
Bi[m] has joined #commonlisp
hendursaga has quit [Ping timeout: 276 seconds]
philnum[m] has joined #commonlisp
MatrixTravelerbo has joined #commonlisp
Duuqnd has joined #commonlisp
bhyde[m] has joined #commonlisp
CodeBitCookie[m] has joined #commonlisp
Arcsech has joined #commonlisp
loke[m] has joined #commonlisp
danirukun[m] has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]
<JeromeLon> Alfr: no, you are right, in the let, it returns true.
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
<Alfr> Nice. :)
<beach> And it's not bound only within the scope of the let, but within the extent of the body of the let.
<JeromeLon> Alfr: It's from my lambda than BOUNDP is false, even though it can access the variable (in https://pastebin.com/JzUqcTSG)
<beach> So it is bound inside DECODE-SCALAR too, even though the body of the function DECODE-SCALAR is not in the scope of the LET.
<_death> if you don't declare special at point of use, it's a lexical variable, e.g. check (funcall (let ((w 123)) (declare (special w)) (eval `(let ((w 42)) (lambda () w))))).. if the variable is free, some implementations take a lenient approach and look it up dynamic environment..
<Alfr> beach, didn't dynamic scope include dynamic extent?
<beach> I am not sure there is such a thing as "dynamic scope".
<beach> Let me check...
<beach> Ah, yes, you are right.
<beach> But you need to specify "dynamic" then.
<_death> "dynamic scope" is a colloquial term that means "indefinite scope and dynamic extent"
<beach> Yeah.
<Alfr> beach, I thought that was clear from the context, as it's about that dynamic binding of W. Mea culpa.
<beach> No worries. I suppose I should have inferred it.
<_death> (you can also move the funcall inside the outer LET in the form I gave, with the same result)
ec has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
<JeromeLon> _death: "implementations take a lenient approach and look it up dynamic environment" this sentence explains everything. In particular, it explains why boundp is inconsistent with variable usage, I was finding this very confusing.
<beach> How is BOUNDP "inconsistent with variable usage"?
srhm has joined #commonlisp
<JeromeLon> eval inside (let special) can access the variable, but boundp is false.
<_death> JeromeLon: is boundp returning false?
<beach> I think you are confused.
CrashTestDummy2 has joined #commonlisp
<JeromeLon> beach: I might be :-(. Let's me run a few more checks.
<beach> JeromeLon: I suspect you are under the impression that the *...* inside your quoted expression refers to the binding in the LET.
srhm has quit [Read error: Connection reset by peer]
<beach> JeromeLon: The quoted expression is just data until it is handed to EVAL.
srhm has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
CrashTestDummy has quit [Ping timeout: 252 seconds]
srhm has joined #commonlisp
<JeromeLon> _death: no, I can't find the boundp returning false case again. I wish I had a better history of all my tests.
<_death> it does seem strange that boundp notes talk about global environment, btw
makomo_ has quit [Ping timeout: 245 seconds]
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
srhm has quit [Remote host closed the connection]
<JeromeLon> anyway, when the code is consistent (using declare special both in the let and the eval), the behavior is consistent and clearly explained. And the initial weird case (eval having access to the special variable, even though nothing hints at it in its environment, but with a warning) has a reasonable explanation (lenient approach from the implementation)
<JeromeLon> is that a fair conclusion?
<_death> yeah.. SBCL warns you because generating that look-up code is not portable and perhaps not what you intended
<JeromeLon> thanks everybody!
rdrg109 has quit [Changing host]
rdrg109 has joined #commonlisp
srhm has joined #commonlisp
tyson2 has joined #commonlisp
<CodeBitCookie[m]> Hello Everyone!
<CodeBitCookie[m]> oops, wrong room
hendursaga has joined #commonlisp
selwyn_ has joined #commonlisp
selwyn_ has quit [Client Quit]
lisp123 has joined #commonlisp
<lisp123> From the earlier discussion on Eval --> If I have (eval `(something ,other-thing)) , other-thing can still access the lexical environment in which the eval statement is placed into?
cosimone` has joined #commonlisp
cosimone` has quit [Remote host closed the connection]
<lisp123> Because its evaluated before being passed to Eval, is this correct?
cosimone` has joined #commonlisp
cosimone has quit [Ping timeout: 252 seconds]
amk has joined #commonlisp
hineios has joined #commonlisp
<_death> your question is unclear.. other-thing presumably is a variable, and its value is used when creating the list that is passed to eval
makomo_ has joined #commonlisp
cosimone` has quit [Quit: ERC (IRC client for Emacs 27.1)]
cosimone has joined #commonlisp
cosimone` has joined #commonlisp
cosimone` has quit [Read error: Connection reset by peer]
<lisp123> _death: Yes, lets say other-thing is a variable, and I agree with your second part
<lisp123> Similarly, (eval `(something ,(other-thing 'mysterious-symbol))) would evaluate other-thing within the lexical environment and pass the resultant list to eval?
<_death> sure
<lisp123> Thanks!
<_death> `(foo ,bar) is basically equivalent to (list 'foo bar)
<_death> and eval is an ordinary function
<lisp123> Yes. I was just curious on the earlier comment saying SBCL was being lenient, but perhaps its related to something else.
<_death> the only thing is that the form it evaluates has no access to the lexical environment active when EVAL is called
<lisp123> Yes. And that occurs AFTER the arguments are evaluated
lisp123 has quit [Read error: Network is unreachable]
lisp123 has joined #commonlisp
winning-luser has joined #commonlisp
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
waleee has joined #commonlisp
taiju has quit [Ping timeout: 245 seconds]
lisp123 has quit [Quit: Leaving...]
nature has joined #commonlisp
<pjb> JeromeLon: if you don't want to declare it special globaly, you will just have to wrap a local declaration around each use: (locally (declare (special ext::*witness*)) (incf ext::*witness*))
rain3 has quit [Ping timeout: 260 seconds]
<JeromeLon> pjb: yes, this was suggested by _death, and it's perfect for me, it's what I am using now in that code.
tyson2 has joined #commonlisp
<pjb> great
Lycurgus has joined #commonlisp
gaqwas has joined #commonlisp
Lycurgus has quit [Quit: Exeunt]
heisig has quit [Quit: Leaving]
Cymew has quit [Ping timeout: 265 seconds]
attila_lendvai has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
winning-luser has quit [Quit: zzz]
Spawns_Carpeting has joined #commonlisp
edgar-rft has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
Lycurgus has joined #commonlisp
tyson2 has joined #commonlisp
wyrd has quit [Quit: leaving]
attila_lendvai has quit [Ping timeout: 252 seconds]
Lycurgus has quit [K-Lined]
hayley has joined #commonlisp
hayley has quit [Changing host]
edgar-rft has quit [Quit: Leaving]
stack_ has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
kevingal has joined #commonlisp
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
stack_ has quit [Quit: WeeChat 2.8]
taiju has joined #commonlisp
notzmv has quit [Ping timeout: 268 seconds]
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ is now known as Lord_of_Life
wyrd has joined #commonlisp
stacksmith has joined #commonlisp
mmk2410 has quit [Quit: ZNC - https://znc.in]
mmk2410 has joined #commonlisp
pve has quit [Quit: leaving]
beach` has joined #commonlisp
<skeemer> what do you use macro for? and do you think macro is the only feature which keeps Lisp apart from other programming languages like python/ruby/golang and so on ?
<kagevf> skeemer: macros are for building DSL and doing syntax abstraction. In addition to macros, image based dev, conditional system, CLOS (because it's method centric instead of class centric) are some other Lisp only* features ...
<kagevf> * smalltalk as image based dev, and macros can be found to some degree in other languages. I think the conditional system and clos are unique to CL, though .... other Lisps have CLOS similars, though
<skeemer> what is image based dev ?
<kagevf> s/smalltalk as/smalltalk has
<skeemer> kagevf, conditional system???
<skeemer> the cond ?
<skeemer> what is special about it ?
<kagevf> skeemer: IOW, "the image" is the program running in memory ... you can interact with a program while it's running and modify small parts of it without having to re-build the whole thing
<kagevf> skeemer: cond is a special form that's analogous to "switch" in algol derived languages
<kagevf> skeemer: the conditional system includes things like exception handling, re-starts and more ... phoe even wrote an apress book about it
<skeemer> kagevf, what book ?
<skeemer> sorry kagevf what does IOW stand for ?
<kagevf> check out the first 3 chapters of PCL to get a taste: https://gigamonkeys.com/book/
<kagevf> but if you're just starting out, I recommend reading "lisp a gentle introduction" which is free online
<kagevf> IOW is short for "in other words"
<kagevf> phoe's book can be found here ... the CL conditional system: https://www.apress.com/us/book/9781484261330
kakuhen has joined #commonlisp
<Catie> Seconded on Common Lisp: A Gentle Introduction to Symbolic Computation. Super helpful book when I was starting out
<kagevf> go to the common lisp sub-reddit - it has a side bar with lots of great resource links
dec0d3r has joined #commonlisp
<kagevf> also, the cookbook link in the title bar to this chat room is a great resource
<kagevf> skeemer: one cool thing about image development is that you can build and change your program without having to through a complete build cycle on each step
<kagevf> you can even interact with apps you've deployed if you have to ... not a best practice necessarily but come in handy if you ever need it :)
<kagevf> s/come in/comes in
<skeemer> kagevf, thanks i understannd now...
makomo_ has quit [Ping timeout: 252 seconds]
CrashTestDummy2 has quit [Quit: Leaving]
<kagevf> skeemer: great .... do you use emacs? emacs+slime is the recommended (but not only!) environment for coding CL
<skeemer> yes kagevf
<skeemer> i am using emacs with evil mode + slime
<kagevf> nice
<kagevf> then you're on the right track
aeth has quit [Ping timeout: 265 seconds]
aeth has joined #commonlisp
gaqwas has quit [Ping timeout: 245 seconds]
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #commonlisp
kevingal has quit [Remote host closed the connection]
<pjb> skeemer: have a look at Casting Spels in Lisp Conrad Barski, M.D. http://www.lisperati.com/casting.html
CrashTestDummy has joined #commonlisp
CrashTestDummy has quit [Read error: Connection reset by peer]
CrashTestDummy has joined #commonlisp
selwyn_ has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
qhong has joined #commonlisp
random-nick has quit [Ping timeout: 265 seconds]
selwyn_ has quit [Quit: Leaving]
dre has joined #commonlisp
abrantesasf has joined #commonlisp
kakuhen has quit [Remote host closed the connection]
CrashTestDummy has quit [Quit: Leaving]
CrashTestDummy has joined #commonlisp
igemnace has joined #commonlisp
Everything has quit [Quit: leaving]
random-nick has joined #commonlisp
<mzan> skeemer: I found Lisp syntax very nice for macros, for these reasons
<mzan> ``(some-dsl-name ....)`` is rather clear to read and explicit
<mzan> Lisp syntax is "uniformly ugly" so you can add to it various macro and DSL without thinking too much.
Spawns_Carpeting has quit [Ping timeout: 265 seconds]
<mzan> On the contrary it is more difficult to extend a language with an infix syntax like C, C++ in good way.
<mzan> On other words: every DSL in Lisp seems native, while on other languages maybe not, because you had to extend the syntax in a nice way.
winning-luser has joined #commonlisp
notzmv has joined #commonlisp
kakuhen has joined #commonlisp
<stacksmith> mzan: many people find Lisp syntax "uniformly beautiful". It's nice for macros the same way gloves are nice for human hands - Lisp syntax is what it is primarily to allow macros to manipulate forms, don't you think?
<mzan> yes
Guest-liao has joined #commonlisp
taiju has quit [Ping timeout: 245 seconds]