phoe 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> | Pastebin: <https://plaster.tymoon.eu/>
Volt_ has joined #commonlisp
rgherdt_ has joined #commonlisp
rgherdt has quit [Ping timeout: 272 seconds]
iamFIREcracker has quit [Ping timeout: 245 seconds]
lisp123 has joined #commonlisp
amb007 has quit [Ping timeout: 272 seconds]
lisp123 has quit [Ping timeout: 272 seconds]
hashfunc1fa5 has joined #commonlisp
ec has joined #commonlisp
<hashfunc1fa5> is there a built-in function and/or strategy to determine if a symbol is built-in?
<hashfunc1fa5> "built-in" meaning (in my case) that it's built into SBCL
<hashfunc1fa5> and/or if it's a standard function defined in the CL specification
<hashfunc1fa5> sorry, ***and/or if it's a standard symbol defined in the CL specification
<phoe> hashfunc1fa5: check if SYMBOL-PACKAGE is EQ to (FIND-PACKAGE :CL)
<hashfunc1fa5> phoe: ok, i'll give that a try. thanks phoe
pjb has joined #commonlisp
random-nick has quit [Ping timeout: 240 seconds]
<hashfunc1fa5> what does the "%" mean in some lisp function names?
<hashfunc1fa5> e.g., "%map-cdb"
<hashfunc1fa5> "(defun %map-cdb (function cdb)"
<White_Flame> means it's an internal function
<hashfunc1fa5> White_Flame: ok thanks
s-liao has joined #commonlisp
<char[m]> scymtym: for with-current-source-form, is there a reason it only works inside macros?
lisp123 has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
Oladon has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
s-liao has joined #commonlisp
s-liao has quit [Quit: Client closed]
orestarod has quit [Ping timeout: 240 seconds]
s-liao has joined #commonlisp
Posterdati has quit [Ping timeout: 240 seconds]
s-liao has quit [Quit: Client closed]
Gamja17 has joined #commonlisp
Posterdati has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
Oladon has quit [Quit: Leaving.]
Common-Lisp has joined #commonlisp
Gamja17 has quit [Remote host closed the connection]
Gamja17 has joined #commonlisp
Common-Lisp has quit [Client Quit]
Common-Lisp has joined #commonlisp
Lord_Nightmare has joined #commonlisp
Common-Lisp has quit [Quit: Leaving]
Bike has joined #commonlisp
<Bike> char[m]: what would it mean outside of the compiler?
<dbotton> when looking at a backtrace is here a key or some command to say what line in what file?
<dbotton> there
<Bike> in sldb, "v" should take you to the source of the frame
<char[m]> Bike: I'm thinking for static analysis. linting and such. It would run at compile time, but not necesaarily part of a macro. so i would run it like this (lint '(this is my program))
<dbotton> thanks
<Bike> char[m]: if something other than implementation is reporting source problems, it would have to coordinate with t-w-c-s-f in its own way; t-w-c-s-f is just a portability library, as two implementations provide a hook into their compiler so that it can report more specifically
<Bike> i don't entirely understand what other than a macroexpander would need it, though
mrcom has joined #commonlisp
<char[m]> I guess, my question is why this does not work if you put it in a scratch buffer (let ((l '(my code))) (twcsf (l) (warn "warn")))
<Bike> because then the warning is signaled at runtime, not by the compiler
<Bike> most conditions do not have source information associated with them
lisp123 has joined #commonlisp
<Bike> the compiler may have a mechanism that intercepts conditions signaled from macro expanders and associates source information with them. twcsf provides a hook into that mechanism specifically.
v88m has quit [Ping timeout: 272 seconds]
<char[m]> I see. Thank you bike
Cena has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Bike> (that said, the lisp implementation probably also tracks source information relating to frames in a runtime backtrace; that's what the sldb "v" uses)
<Bike> so for a linter program, you'd need your linter to implement with-current-source-form, and then provide a macro definition for trivial-wscf to hook it in, and then probably also teach your IDE how to interpret the source information. implementing with-current-source-form entails an interception mechanism. i can show you how i did it in cleavir if
<Bike> you like.
lisp123 has quit [Ping timeout: 240 seconds]
Gamja17 has quit [Remote host closed the connection]
Cena has joined #commonlisp
<char[m]> I might take you up on that later. I'll see if I can figure it out first. This all might be overkill since I plan to run the linter at compile time anyway.
Gamja17 has joined #commonlisp
Cena has quit [Ping timeout: 240 seconds]
Gamja17 has quit [Remote host closed the connection]
<beach> Good morning everyone!
waleee has quit [Ping timeout: 240 seconds]
<jmes> Good morning :)
anticomputer_ has joined #commonlisp
anticomputer has quit [Ping timeout: 240 seconds]
semz_ has joined #commonlisp
semz has quit [Ping timeout: 260 seconds]
lisp123 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
Oladon has joined #commonlisp
s-liao has joined #commonlisp
akoana has quit [Quit: leaving]
s-liao6 has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
Bike has quit [Quit: Connection closed]
s-liao6 has quit [Ping timeout: 256 seconds]
hashfunc1fa5 has quit [Ping timeout: 240 seconds]
dirtcastle has joined #commonlisp
lisp123 has joined #commonlisp
Oladon has quit [Quit: Leaving.]
Cena has joined #commonlisp
s-liao has joined #commonlisp
lisp123 has quit [Quit: Leaving...]
Cena has quit [Ping timeout: 256 seconds]
lisp123 has joined #commonlisp
Fare has quit [Ping timeout: 240 seconds]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
v88m has joined #commonlisp
Josh_2 has quit [Remote host closed the connection]
amb007 has joined #commonlisp
igemnace has quit [Remote host closed the connection]
aartaka has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
notzmv has quit [Ping timeout: 256 seconds]
rotateq has joined #commonlisp
eugercek has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.4]
nature has joined #commonlisp
v88m has quit [Ping timeout: 256 seconds]
<gin> Like '(...) is a shortcut for (quote (...)), what is ,(...) a shortcut of?
<gin> oops. wrong question
<gin> Like '(...) is a shortcut for (quote (...)), what is `(...) a shortcut of?
<beach> The standard mentions this.
<beach> It is not standardized, but they recommend following the Scheme tradition. Let me see if I can find it.
<beach> ... and it is not a "shortcut". It is a "reader macro".
<beach> clhs 2.4.6.1
<gin> oh I read clhs 2.4.6 already. I don't think I communicated my question right.
<gin> I mean, we can write either '(...) or (quote (...)) without reader macro. But for `(...) there does not seem to be an alternative without reader macro.
<beach> Read 2.4.6.1 please
<beach> "Since the exact manner in which the Lisp reader will parse an expression involving the backquote reader macro is not specified, an implementation is free to choose any representation that preserves the semantics described."
<beach> "Implementors who have no particular reason to make one choice or another might wish to refer to IEEE Standard for the Scheme Programming Language, which identifies a popular choice of representation for such expressions that might provide useful to be useful compatibility for some user communities."
<gin> okay, thank you. my next question is. say I am making a toy Lisp: is it necessary to implement '()? Even without `() it would still be a Lisp, right? because users can write (quote (...))
<beach> I believe Scheme defines `x to expand to (backquote x), for ,x to expand to (unquote x) and for ,@x to expand to (unquote-splicing x).
<_death> the alternative is to write the expansion, e.g., `(foo ,bar) can be written as (list 'foo bar)
<gin> there does not seem to be (backquote ...) in CL. let me try in scheme and see if (backquote ...) works.
<beach> gin: There is no widely agreed-upon definition of "Lisp", so you can do whatever you want and you can call it "a Lisp" or something else.
<beach> gin: What part of "implementation specific" is not clear?
<beach> gin: It may be backquote in some implementations and something else in others.
<gin> beach: "Implementation specific" is now clear. and I understand that a specific CL implementation is free to implement it however it wants.
<beach> gin: And, as _death pointed out, you can't replace ` by (quote...).
<beach> gin: Good, so "there does not seem to be (backquote ...) in CL." doesn't make sense.
<gin> why not? is it not a fact that there is no "backquote" special operator in CL?
<gin> ah! I see it.
<gin> I should say there is no "backquote" special operator in SBCL.
<beach> You are right.
<beach> Either way, there is no such symbol in the standard.
<gin> yes, making sense now.
<_death> (write (read-from-string "`(foo)") :pretty nil)
<beach> So it has to live in a package other than the CL package either way.
<beach> s/it/the symbol chosen by the implementation/
<gin> oh, so it is SB-INT:QUASIQUOTE in SBCL. Thanks _death. that resolved the mystery for me.
<_death> may want to check out the cltl2 appendix for backquote
<beach> gin: What is your reason for writing a toy Lisp implementation? And why do you care whether it is "a Lisp" or not?
<gin> beach: just for learning. but don't want to cheat during learning. want to implement whatever looks like essential features.
<beach> So you plan to implement CLOS?
<gin> Am I correct in assuming that ' and ` do not offer any new semantic features in Lisp? They only offer syntactic convenience?
<rotateq> _death: I was about to give the same hint to them :)
<gin> beach: probably not. but I was conflicted regarding whether ' and ` are worth implementing. my toy lisp has no reader macro facility yet. so I was thinking if by implementing ' and `, I might learn how to have reader macros in my implementation.
<rotateq> gin: Especially the ` saves you from writing very nested LIST forms that could be hard to reason about quickly.
<rotateq> gin: And what are your #\( and #\) then if not readmacros? :)
<beach> gin: I consider CLOS an essential feature. And rotateq is right that writing macros without the backquote reader macro is pure hell.
<beach> rotateq: Good point.
<gin> okay, I will tackle this problem. Long way to go for me and lots of learning to do.
<rotateq> Oh and for me still too. It never ends.
<beach> Question about PARSE-MACRO from CLtL2: What role does the &OPTIONAL parameter ENV play in this function?
<gin> thanks beach, _death, rotateq for all the help
<beach> Sure.
<rotateq> You're welcome, gin. From the point in time when I started to get the idea of readmacros I also see it in other languages that way too, for example the #\" for reading in string objects.
<rotateq> beach: I have an idea for your question, but I'm too afraid that my answer wouldn't be accurate enough.
<beach> Give it to me anyway.
<rotateq> The &OPTIONAL parameter ENV takes potentially another environment. For example you work on first class global environments, so this could be used to have a way other semantic effect by parsing the same form.
<beach> OK.
<rotateq> Please correct me or if you would like tell us why you asked that. :)
<beach> I asked because we wrote "PARSE-MACRO and ENCLOSE are part of the environment chapter in CLtL2, but they are outside the scope of this paper" in our ELS submission, and a referee is asking "why are they outside the scope?".
<rotateq> Oh okay. ELS is not far away anymore.
<beach> I was going to write "That's a silly question; PARSE-MACRO doesn't access the compile-time environment in any way whatsoever", but I may be wrong about that.
<beach> Final paper versions are due march 7.
<beach> And I was going to write "That's a silly question: ENCLOSE is a run-time thing", but that is not true. It is used to create macro functions for MACROLET I think, given that the LAMBDA-EXPRESSION argument is allowed to access only the compile-time part of the environment.
<rotateq> I don't really have strong knowledge of environments yet. I try to get how LOAD-TIME-VALUE works at the moment.
<beach> The implementation of PARSE-MACRO in SBCL has (DECLARE (IGNORE ENV)) in it.
<beach> CCL passes the ENV argument to PARSE-BODY that then ignores it.
kevingal has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
<rotateq> beach: So giving it another first class global environment wouldn't have any effect when I understand correctly.
lisp123 has joined #commonlisp
<beach> Not that I can see. It just turns a macro body into a lambda expression.
<rotateq> Okay.
amb007 has quit [Remote host closed the connection]
amb007 has joined #commonlisp
cage has joined #commonlisp
s-liao has quit [Quit: Client closed]
notzmv has joined #commonlisp
Cena has joined #commonlisp
sepanko has joined #commonlisp
Cena has quit [Ping timeout: 256 seconds]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
attila_lendvai has joined #commonlisp
rgherdt_ is now known as rgherdt
treflip has joined #commonlisp
treflip has quit [Remote host closed the connection]
Dynom has joined #commonlisp
s-liao has joined #commonlisp
azimut has quit [Remote host closed the connection]
amb007 has quit [Read error: Connection reset by peer]
azimut has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
dmgk has left #commonlisp [#commonlisp]
tyson2 has joined #commonlisp
aartaka has quit [Ping timeout: 240 seconds]
aartaka has joined #commonlisp
s-liao has quit [Quit: Client closed]
waleee has joined #commonlisp
<bollu> is there a tutorial implementation of common lisp, that's geared for understanding how one would implementing things like conditions?
random-nick has joined #commonlisp
Lord_of_Life has quit [Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine]
Lord_of_Life has joined #commonlisp
<rotateq> bollu: There's this newer book by phoe_ "The Common Lisp Condition System" from 2020. Do you really mean _implementing_ or first learning to _use_ it?
<rotateq> Or maybe you mean defining new condition type with DEFINE-CONDITION.
<bollu> rotateq both, I guess :) I've seen toy examples of the condition system, and I'd be interested to know how it's implemented
<phoe> bollu: then my book will work well
<bollu> phoe oh, neat! you wrote the book :)
<phoe> bollu: well, yes, such things happen sometimes
tane has joined #commonlisp
tane has quit [Changing host]
tane has joined #commonlisp
<beach> The condition system is surprisingly simple, and it is hard to understand why pretty much every programming language (except Multics PL/I) has made exception systems that are both less useful and harder to implement.
<phoe> the condition system is not even necessary
<beach> Exactly.
<rotateq> Maybe they like to throw and not signal things.
<phoe> if you have dynamic variables, if you have a way to have non-local jumps with unwinding, if you have closures, then you don't need a condition system
<phoe> since you can build one yourself
<beach> Indeed.
<rotateq> phoe: Or full continuations. :)
<phoe> rotateq: yes
<phoe> but notably continuations aren't strictly required
<rotateq> hui in Java ∘.○
<jackdaniel> /if you have a way to have non-local jumps with unwinding/ <-- that's the non trivial part
<jackdaniel> cleverly buried between dynamic variables and closures that are a given
<rotateq> jackdaniel: The trick is saying "left as an exercise for the reader".
<phoe> jackdaniel: other languages tend to have it - e.g. try/finally in java
orestarod has joined #commonlisp
<jackdaniel> I'm not saying that they don't, I'm saying that this part is the non-trivial thing. also java is a language that has quite a few under the hood (despite its yucky look)
<phoe> yes
<jackdaniel> s/a few/a few things/
<phoe> it's not trivial to have that in the slightest - that's why you have whole separate libraries to achieve that in languages that don't support it out of the box, e.g. libunwind in the C world
<bollu> phoe can you elaborate on what it means to have "non-local jumps with unwinding"? I don't know what that means
<phoe> bollu: in CL terms, block/return-from, tagbody/go, catch/throw
<phoe> in non-CL terms, that you can change the way the program is executing and jump backwards to some predefined place on the call stack and continue execution from there
<beach> bollu: setjmp()/longjmp() in C.
<jackdaniel> are you sure that block/return-from and tagobyd/go qualify?
<phoe> jackdaniel: well, they can be non-local and they trigger unwinding, so I think so, yes
<beach> jackdaniel: Yes, they can do non-local jumps.
<pl> C++ exceptions, wherever they came from and how they poisoned the well further, are ultimately very simplistic in supposed implementation and don't provide for closures etc.
<rotateq> I would first have thought of UNWIND-PROTECT too.
<phoe> when you combine GO or RETURN-FROM with closures then they become non-local
<jackdaniel> I see
<pl> it's funny that Windows provides better (not Common-Lisp level, but closer) exceptions systemwide than most languages in use on the platform
<bollu> phoe it must be some unwinding to some location *in the call stack* ?
<phoe> bollu: the details are usually hidden from the user, but imagine that your code has something like (CATCH 'FOO ...)
<phoe> and then, something in these ..., no matter how many function calls away, issues a (THROW 'FOO)
<phoe> and, after properly unwinding the stack via UNWIND-PROTECT cleanup forms, execution continues from the CATCH form
<bollu> phoe isn't that like call/cc then?
<phoe> kinda sorta, but you don't strictly need call/cc to have that sort of thing
perrierjouet has joined #commonlisp
kevingal has quit [Remote host closed the connection]
s-liao has joined #commonlisp
mogan90 has joined #commonlisp
kevingal has joined #commonlisp
<rotateq> phoe: I read now again in the "Metacircular Semantics for Common Lisp Special Forms" paper from 1992 by Henry Baker. On page 4 it has a footnote which states "Of the three, we strongly recommend that catch/throw be considered the most primitive mechanism, because basing tagbody/go and block/return-from on catch/throw makes absolutely clear the fact that Common Lisp does not and can not have Scheme-like first-class co
<rotateq> Would have been nice giving at this point even a simple explanation why.
s-liao has quit [Quit: Client closed]
<phoe> rotateq: catch/throw is the absolutely most generic mechanism
<phoe> and the hardest to optimize
<phoe> you can implement RETURN-FROM and GO easily in terms of THROW and a dynamic variable, as seen in Baker
yewscion has joined #commonlisp
Fare has joined #commonlisp
mogan90 has quit [Ping timeout: 256 seconds]
Common-Lisp has joined #commonlisp
c has joined #commonlisp
Common-Lisp is now known as Guest755
c is now known as Common-Lisp
Guest755 has quit [Remote host closed the connection]
Common-Lisp has quit [Quit: Leaving]
tane has quit [Ping timeout: 240 seconds]
mogan90 has joined #commonlisp
psf has quit [Ping timeout: 256 seconds]
psf has joined #commonlisp
Common-Lisp has joined #commonlisp
Oladon has joined #commonlisp
Common-Lisp has quit [Quit: Leaving]
tane has joined #commonlisp
tane has joined #commonlisp
mogan90 has quit [Ping timeout: 240 seconds]
v88m has joined #commonlisp
<rotateq> phoe: Yes it's a wonderful paper and shows how much knowledge and cerebral fat can be in just 10 pages. :)
cosimone has joined #commonlisp
Cena has joined #commonlisp
Cena has quit [Ping timeout: 240 seconds]
Oladon has quit [Quit: Leaving.]
shka has joined #commonlisp
razetime has joined #commonlisp
attila_lendvai has quit [Ping timeout: 256 seconds]
Common-Lisp has joined #commonlisp
jealousmonk has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
Common-Lisp has quit [Quit: Leaving]
dirtcastle has quit [Remote host closed the connection]
ym has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
razetime has quit [Ping timeout: 250 seconds]
<mfiano> rotateq: It seems you are using an IRC client that doesn't split long messages. Your long message above was cut short.
kevingal has quit [Ping timeout: 272 seconds]
kevingal has joined #commonlisp
igemnace has joined #commonlisp
waleee has quit [Ping timeout: 268 seconds]
waleee has joined #commonlisp
dirtcastle has joined #commonlisp
<rotateq> mfiano: Oh that's too bad. :/ I use erc normally.
<rotateq> Which is the last word that was sent through?
<mfiano> "first-class co"
<rotateq> ah then just '... first-class continuations."'
dirtcastle has quit [Ping timeout: 240 seconds]
lisp123 has quit [Ping timeout: 256 seconds]
orestarod has quit [Quit: Leaving]
<dbotton> When "overriding" a method in a child class, to call its parent implementation do I just "cast" the obj to the parent time and call or is there an official way? (sorry all the language is wrong for lisp I know, but not sure how to express it or likely have my answer)
<_death> you can call-next-method, or use an :after method, depending on your use case
dirtcastle has joined #commonlisp
<dbotton> appreciated
<_death> sometimes picking a different method combination altogether may make sense.. but the run-of-the-mill functionality that's similar to the one found in other languages is call-next-method
amb007 has quit [Ping timeout: 252 seconds]
dirtcastle has quit [Ping timeout: 240 seconds]
lisp123 has joined #commonlisp
Volt_ has quit [Ping timeout: 256 seconds]
palter has joined #commonlisp
Volt_ has joined #commonlisp
Fare has quit [Ping timeout: 240 seconds]
kevingal has quit [Remote host closed the connection]
MetaYan has joined #commonlisp
tane has quit [Quit: Leaving]
tane has joined #commonlisp
Fare has joined #commonlisp
orestarod has joined #commonlisp
<dbotton> that worked out well, my first multiple inheritance in Lisp :) (a database table control + drop down list box) works amazing.
<dbotton> thanks for the help
Oladon has joined #commonlisp
<dbotton> Can't wait to make a demo of it all soon. Drag and drop a few controls and a whole database driven multi table website in minutes.
<_death> sounds cool
dirtcastle has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
amb007 has joined #commonlisp
cjb has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life has joined #commonlisp
dirtcastle has quit [Ping timeout: 240 seconds]
rogersm has joined #commonlisp
tyson2 has quit [Ping timeout: 240 seconds]
attila_lendvai has joined #commonlisp
Cena has joined #commonlisp
semz_ is now known as semz
cage has quit [Quit: rcirc on GNU Emacs 27.1]
yewscion has quit [Ping timeout: 250 seconds]
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
Catie has joined #commonlisp
rogersm has quit [Quit: Leaving...]
tane has quit [Quit: Leaving]
recordgroovy has quit [Remote host closed the connection]
rotateq has quit [Quit: ERC (IRC client for Emacs 27.2)]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
Oladon has quit [Quit: Leaving.]
mogan90 has joined #commonlisp
aartaka has quit [Ping timeout: 240 seconds]
Dynom has quit [Quit: WeeChat 3.4]
kevingal has joined #commonlisp
mogan90 has quit [Ping timeout: 256 seconds]
euandreh has quit [Quit: WeeChat 3.3]
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
akoana has joined #commonlisp
Inline has quit [Ping timeout: 240 seconds]
hashfunc1fa5 has joined #commonlisp
rtoy has quit [Ping timeout: 240 seconds]
nature has quit [Ping timeout: 250 seconds]
Bike has joined #commonlisp
eugercek has quit [Remote host closed the connection]
eugercek has joined #commonlisp
eugercek has quit [Remote host closed the connection]
gxt has quit [Ping timeout: 240 seconds]
gxt has joined #commonlisp
igemnace has quit [Remote host closed the connection]
kevingal has quit [Remote host closed the connection]
Cena has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shka has quit [Ping timeout: 250 seconds]
hashfunc1818 has joined #commonlisp
hashfunc1fa5 has quit [Remote host closed the connection]
epony has quit [Quit: QUIT]
Cena has joined #commonlisp