tyson2 has quit [Remote host closed the connection]
micro has quit [Ping timeout: 246 seconds]
micro has joined #commonlisp
<Mondenkind>
I thought ~A was for 'aesthetic'?
attila_lendvai_ has quit [Ping timeout: 260 seconds]
bitmapper has joined #commonlisp
shka has quit [Ping timeout: 260 seconds]
bilegeek has joined #commonlisp
mgl_ has quit [Ping timeout: 246 seconds]
mariari has quit [Quit: WeeChat 4.1.2]
mariari has joined #commonlisp
<aeth>
yeah, I thought it was standard vs aesthetic
<aeth>
I guess they changed it to that because it makes more sense
<aeth>
Kingsy: if you want ~A to do something aesthetic, then you need to put the result you want to print in a defclass or a defstruct and then define a (defmethod print-object ((object your-class) stream) ...)
<aeth>
In the ... you can do e.g. (print-unreadable-object (object stream :type t :identity t))
molson has quit [Remote host closed the connection]
<aeth>
but if you want to give it a more meaningful representation, you (probably) want to remove the :identity t part and you can add to the body, e.g. (print-unreadable-object (object stream :type t) (format stream "~A" (some-accessor-call object)) ...)
<aeth>
boilerplate sucks so there's probably some macro somewhere that combines defmethod print-object with print-unreadable-object
molson has joined #commonlisp
clothespin has quit [Quit: Say What?]
<edgar-rft>
usually it's sufficient to just look at the return values as printed in the REPL
vyrsh has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
green_ has joined #commonlisp
Lord_of_Life has joined #commonlisp
<Kingsy>
sorry just saw this.
<Kingsy>
I just decided to crack on, managed to get a working toc tac toe game but its a little ugly. haha works though.
dra has quit [Ping timeout: 260 seconds]
piethesailor has joined #commonlisp
<piethesailor>
Is there a way to pause the execution between :before, main, :after method calls so that I can view the state before a transition?
<piethesailor>
Does that question make sense?
<piethesailor>
say the main method runs and I want to view the state of slots before the :after method is invoked?
occ has joined #commonlisp
<piethesailor>
(slot-value *t* 'security)
<piethesailor>
oops. that was for my repls eyes lol
cross has joined #commonlisp
cross has quit [Client Quit]
cross has joined #commonlisp
<bike>
piethesailor: you could put BREAKs in the methods
<piethesailor>
ah right, of course! so simple. Thanks bike
khrbtxyz has quit [Ping timeout: 256 seconds]
rtypo has quit [Ping timeout: 256 seconds]
`Pixel_Outlaw is now known as Pixel_Outlaw
khrbtxyz has joined #commonlisp
random-nick has quit [Ping timeout: 276 seconds]
Inline has quit [Quit: Leaving]
Inline has joined #commonlisp
piethesailor has quit [Ping timeout: 264 seconds]
NicknameJohn has joined #commonlisp
gjvc has quit [Quit: leaving]
gjvc has joined #commonlisp
piglet_ has joined #commonlisp
vyrsh has quit [Ping timeout: 260 seconds]
piglet_ is now known as vyrsh
dajole has joined #commonlisp
Inline has quit [Ping timeout: 264 seconds]
Inline has joined #commonlisp
jack_rabbit has quit [Remote host closed the connection]
jack_rabbit has joined #commonlisp
Inline has quit [Client Quit]
Inline has joined #commonlisp
josrr has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
Inline has joined #commonlisp
Inline has quit [Excess Flood]
rgherdt has joined #commonlisp
Inline has joined #commonlisp
Inline has quit [Client Quit]
Inline has joined #commonlisp
tyson2 has joined #commonlisp
Inline has quit [Client Quit]
rgherdt_ has joined #commonlisp
Inline has joined #commonlisp
rgherdt has quit [Ping timeout: 264 seconds]
Inline has quit [Ping timeout: 268 seconds]
Inline has joined #commonlisp
Inline has quit [Excess Flood]
Inline has joined #commonlisp
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
khrbtxyz has quit [Ping timeout: 264 seconds]
rgherdt_ has quit [Quit: Leaving]
khrbtxyz has joined #commonlisp
rgherdt has joined #commonlisp
kevingal_ has quit [Ping timeout: 276 seconds]
kevingal has quit [Ping timeout: 276 seconds]
Alfr has quit [Remote host closed the connection]
Alfr has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
bilegeek_ has joined #commonlisp
bilegeek has quit [Ping timeout: 260 seconds]
Inline has quit [Quit: Leaving]
Inline has joined #commonlisp
Inline has quit [Client Quit]
Inline has joined #commonlisp
decweb has quit [Ping timeout: 256 seconds]
Inline has quit [Excess Flood]
amb007 has quit [Ping timeout: 256 seconds]
Inline has joined #commonlisp
Inline has quit [Excess Flood]
Inline has joined #commonlisp
Inline has quit [Max SendQ exceeded]
Inline has joined #commonlisp
son0p has quit [Ping timeout: 256 seconds]
Inline has quit [Ping timeout: 256 seconds]
Inline has joined #commonlisp
jobhdez has joined #commonlisp
Lycurgus has joined #commonlisp
<jobhdez>
i deployed a small hunchentoot server using docker on AWS. its a site for the toy compilers i have done. the python syntax to x86 AST is the crappiest i did. but if you copy and paste the test function it will lower to almost corrext x86 AST, the output of instruction selection so is still use the variables instead of stack locations or registers
younder has quit [Remote host closed the connection]
<jobhdez>
anybody know any common lisp companies hiring? i know of hrl labs and rigetti but you need to be a US citizen for these
<beach>
SISCOG seems to always want to hire.
<beach>
And RavenPack.
<jobhdez>
thanks!
<beach>
Sure.
<beach>
Are you a citizen of EU?
<jobhdez>
im in the US but im not a citizen
<jobhdez>
otherwise i could probably get a chance at hrl labs
<jobhdez>
ive contributed to coalton
<beach>
That's not what I asked though. I asked because those two companies are located in the EU.
<jobhdez>
well no im not a citizen of EU
<beach>
I see. That complicates things a git I imagine.
<beach>
*a bit
<jobhdez>
yea. but hey i have the copy of the optimization textbook you recommended. im going to read it. but as i was experimenting with racket and using its pattern matcher i wished i was using a language like ocaml because it seems like it would make it easier to work with the intermediate language. but id imagine hat you dont have this problem with
<jobhdez>
common lisp
<jobhdez>
you think static types are important for compiler dev?
<beach>
I don't think so.
Lycurgus has quit [Quit: leaving]
Inline has quit [Quit: Leaving]
<beach>
I think it might be important to use a statically typed language when the application absolutely must not fail or it will cost huge amounts of money, or lives. Then, you can afford the additional development cost, because people who need that kind of application are usually willing to finance such additional development cost.
Inline has joined #commonlisp
Inline has quit [Ping timeout: 276 seconds]
<jobhdez>
oh ok; interesting. yeah that makes a lot of sense. is the interactivity of common lisp and macros the key features why common lisp is a good language for compilers in your point of view? macros are just great, they reduce the amount of code you end up with so it makes system easier to maintain. theyre just great
wacki has joined #commonlisp
<beach>
Don't forget CLOS. I think CLOS is excellent for that kind of stuff.
<beach>
But yes, macros cut down on a lot of boilerplate code.
<pfdietz>
I am not convinced that in that sort of situation, static types would actually help. You'd need to test really extensively anyway, and if you do that, you will tend to find the errors that static typing would have prevented.
<beach>
pfdietz: That's why I said "might be".
<beach>
I guess I am merely stating the inverse, i.e., that a statically typed language is not needed in most cases.
<pfdietz>
It might help in the common case where testing is utterly inadequate. The software is going to be crap, but perhaps slightly less smelly crap.
<beach>
Heh.
<jobhdez>
clos is the reason why im staying with common lisp as my main lisp
<beach>
But the people into statically typed languages often cite the feature that if it compiles then if often works. But the conveniently forget the difference in cost to make that happen.
<beach>
*they conveniently
Inline has joined #commonlisp
pfdietz has quit [Quit: Client closed]
<jobhdez>
yea lisp seems like a great language then to build compilers. beach have you tried ocaml or haskell?
<beach>
jobhdez: Only a tiny bit. Never for anything serious.
jobhdez has quit [Quit: Client closed]
younder has joined #commonlisp
jobhdez has joined #commonlisp
<beach>
It is somewhat interesting that in the paper by Hudak and Jones, which was written to make Haskell look great for prototyping, they also conveniently avoid the data point where a language called "Relational Lisp" beats everyone else.
<beach>
I have used this paper in my teaching and in my talks to industry, but I never explicitly mention Lisp then. The takeaway is just that the choice of the programming language can potentially have a huge impact on productivity.
<beach>
I let the students look at the table themselves, and find that there is an entry for a kind of Lisp in there.
<jobhdez>
very cool. i use to like haskell. i still do but not as much but it seems like the designers of the language prefer building a theoretical artifact than something pragmatic. this is why i think im going to try ocaml
pfdietz has joined #commonlisp
<jobhdez>
those lisp papers you showed me that you wrote and your compiler implementation are part of your research?
<beach>
jobhdez: Indeed. Though now I no longer do research as a job.
<beach>
Just for fun.
igemnace has joined #commonlisp
<jobhdez>
oh very cool. hows your lisp compiler going?
<beach>
jobhdez: Well, lately we have concentrated on other aspects if implementing Common Lisp, namely we have created a fairly large number of implementation-independent libraries that each provides some aspect of the Common Lisp standard. So the compiler itself is a bit on hold.
Inline has quit [Ping timeout: 264 seconds]
<beach>
This was the original purpose of SICL, so you can say that we are again prioritizing that aspect. As a consequence, I am able to greatly simplify the SICL bootstrapping procedure, which is what I am working on now.
<jobhdez>
nice. thats very cool.
<younder>
Simplifying the bootstrap code or simplifying it by making the libraries implementation independent?
pfdietz has quit [Quit: Client closed]
Inline has joined #commonlisp
pfdietz has joined #commonlisp
Inline has quit [Max SendQ exceeded]
bitmapper has quit [Quit: Connection closed for inactivity]
msavoritias has quit [Ping timeout: 264 seconds]
<beach>
Simplifying it by making it mainly consist of loading those libraries in some well defined order.
<beach>
Rather than loading individual SICL files (of which there were many more than there are libraries) in some well defined order.
Gleefre has quit [Remote host closed the connection]
<beach>
In the past, it was tempting to have the bootstrapping procedure less general, and to modify the SICL code to accommodate the bootstrapping procedure. Now, the objective is to make the bootstrapping procedure more complete, so that it can handle more libraries.
<beach>
We basically have to do that, because external libraries can have arbitrary dependencies, and we must be able to handle whatever code they contain.
bilegeek_ has quit [Quit: Leaving]
amb007 has joined #commonlisp
<jobhdez>
will sicl generate code as fast as sbcl?
Inline has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
<beach>
I hope so. Again, that depends not only on the compiler, but also on the rest of the system.
amb007 has quit [Ping timeout: 264 seconds]
<beach>
For example, I am counting on call-site optimization as a main feature of performance improvements.
<beach>
Oh, and we also learned how to make bot an extrinsic and an intrinsic version of our libraries, where "extrinsic" means that it can be loaded into an existing Common Lisp implementation without modifying it. This is important, because we can run extrinsic versions of some libraries during bootstrapping, like the reader (Eclector) or the package system (Parcl).
<beach>
*make both an
<jobhdez>
its great your pushing lisp compilers forward!
Inline has quit [Remote host closed the connection]
<beach>
Well, not compilers so much. I don't think we have invented any compilation technique that doesn't already exist. So it is mainly the rest of the system.
Inline has joined #commonlisp
<beach>
We have invented a few new ways of implementing compilation techniques that already exist in some form, like path replication, incremental inlining, stuff like that.
<jobhdez>
ah ok but still youre modernizing lisp compilers with the papers you have written.
<beach>
Sure. But that's easy. Even the SBCL compiler doesn't use CLOS, or didn't last time I looked.
<younder>
Could you make LLVM worry about the portability and optimization? That would sure save a lot of work.
<beach>
I am not planning to use LLVM. The work on Clasp shows that it is very slow, and it has this C++-focused way of doing things which makes things harder. C++ exceptions is one problem that I don't know whether the Clasp developers were able to avoid.
masinter has quit [Ping timeout: 252 seconds]
<jobhdez>
so using llvm doesnt necessarily make your compiler faster. interesting. why does llvm make clasp slow?
<beach>
No, LLVM is slow in itself. It makes Clasp compilation slow, but not necessarily the resulting code.
igemnace has quit [Read error: Connection reset by peer]
Inline has quit [Quit: Leaving]
<beach>
I think the LLVM people considered compilation time as unimportant. That is not necessarily the case in an interactive language.
Inline has joined #commonlisp
<beach>
LLVM is so slow, that bike had to design a bytecode compiler/interpreter to make compilation times tolerable.
bjorkintosh has quit [Ping timeout: 268 seconds]
<jobhdez>
so compilation speed is slow. what about the generated code of llvm?
<beach>
I am convinced it is great.
<beach>
I mean, it doesn't happen automatically. You have to feed it something reasonable in the first place.
Inline has quit [Quit: Leaving]
<beach>
Also, LLVM is written in C++, and I wouldn't want SICL to depend on a library written in C++. LLVM must be hell to maintain, given my conviction that it is impossible to write a large C++ program that is both modular and fast. Though perhaps it is slow because they abandoned the "fast" aspect in favor of modularity.
SAL9000 has quit [Ping timeout: 268 seconds]
<jobhdez>
oh ok so it is the case that the programmer can indeed help the compiler generate efficient code. i was reading "computer systems a programmers perspective" and it was talking about how you can do things such loop optimizations your self and have gcc produce more efficient code. is it the case for sbcl too? because i did a toy linear algebra
<jobhdez>
compiler with a lisp backend and i improved the performance (but still very slow) by unrolling loops.
<jobhdez>
c++ seems hell indeed
<jobhdez>
i am not to sure about managing memory myself in a compiler project. most bugs are probably memory bugs in a c++ compiler
<beach>
I suppose SBCL has to do everything itself, including loop unrolling, as it doesn't rely on an external library to generate code.
Inline has joined #commonlisp
amb007 has joined #commonlisp
<beach>
jobhdez: They could abandon "fast" by using reference counters and such.
<beach>
jobhdez: That would make it possible for it to be modular.
inline__ has joined #commonlisp
Inline is now known as Guest136
Guest136 has quit [Killed (iridium.libera.chat (Nickname regained by services))]
inline__ is now known as Inline
pfdietz has quit [Quit: Client closed]
<beach>
Personally, if I had to use C++ to write something like LLVM (or any other large application for that matter) I would likely try the Boehm etc garbage collector.
<jobhdez>
i dont know why people use c++ for compiler development. why would anyone want to manage memory. i get that this is needed for os development but for compilers theres better languagess
<beach>
It is also not needed for OS development. Look at Genera, Movitz, and Mezzano.
<beach>
But maybe OS creators read the book by Tanenbaum and Bos which states that it is impossible to write an OS in a language with automatic memory management (thereby conveniently ignoring those three systems, and perhaps more).
<jobhdez>
i see. francis allen the turing award winner did say c was a big mistake and that it slowed down the compiler field
igemnace has joined #commonlisp
<jobhdez>
im familiar with mezzano. thats the one built with common lisp right?
<beach>
jobhdez: I think the idea is this: They think that manual memory management is faster than garbage collection. But it really isn't necessarily so. And even if it is, they compare execution times of small examples, where C++ is great of course.
<beach>
But then, for a large project, in order to get modularity, they then need to use very slow techniques such as reference counters. Unfortunately, nobody has tried to write a large application both in C++ and (say) Common Lisp, to compare performance.
<beach>
jobhdez: Yes, Mezzano is pure Common Lisp as I recall. You can ask froggey who is still around.
Inline has quit [Quit: Leaving]
Inline has joined #commonlisp
_cymew_ has joined #commonlisp
<beach>
I also think that it was a goal of the LLVM project to make it a library usable from C++, so they probably didn't have much of a choice. Other than that, I see absolutely no reason to write something like LLVM in C++.
<beach>
Perhaps someone could start an LLVM-like project in Common Lisp. That would be a great tool for Common Lisp compiler writers and it would simplify lots of existing Common Lisp implementations.
<jobhdez>
so like start with some backend that generates efficient code that common lisp compiler writers can use to generate code for their compilers?
<beach>
Something like that, I guess. I haven't really looked into exactly what work LLVM accomplishes and how.
Inline has quit [Ping timeout: 256 seconds]
Kyuvi has joined #commonlisp
<jobhdez>
i think llvm is suppose to be infrastructure others can use to build a concrete compiler
<beach>
That much seems true.
<beach>
I guess a large part of LLVM must be the fact that it can generate code for many different processor architectures.
Inline has joined #commonlisp
<jobhdez>
yes. llvm is great i think but i find it hard to find c++ interesting
Kyuvi has quit [Ping timeout: 250 seconds]
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
<beach>
It would be fun to see the performance of an LLVM-like written in Common Lisp compared to LLVM itself. That would then be one of the few examples of the kind of comparison that I would like to see.
pranavats has joined #commonlisp
bilegeek has joined #commonlisp
<jobhdez>
it sounds like a great project to do. im going to keep using common lisp for compiler dev. thanks. but you should do this llvm like project!
<beach>
Me? I don't have enough remaining life expectancy.
Inline has quit [Quit: Leaving]
Inline has joined #commonlisp
<jobhdez>
oh i see. well ive never built an optimizing compiler. how hard is to build a backend that generates code on par with llvm for an x86 cpu?
<beach>
x86 is particularly hard. Maybe start with RISC-V instead.
<hayley>
x86 accepts some sloppiness in instruction selection and scheduling; Cliff Click likens those tasks to horseshoes and hand grenades. But I think that is more a statement about the reordering in hardware, rather than a particular instruction set.
<Mondenkind>
yeah in general 80% performance comes for 20% the effort. you don't _need_ to get two-address and memory operands perfect, and ooos are somewhat forgiving of scheduling snafus
<Mondenkind>
on high-power riscv cores rather than complex instructions you'd presumably want to generate fusable sequences. And if you have the c extension then you have finicky register assignment problems, since instructions that use just the low 8 registers have a smaller encoding
SAL9000 has joined #commonlisp
son0p has joined #commonlisp
pve has joined #commonlisp
jobhdez has quit [Quit: Client closed]
jobhdez has joined #commonlisp
<beach>
If I were to start such a project, I would ignore the compressed format to begin with.
khrbtxyz has quit [Ping timeout: 256 seconds]
<Mondenkind>
sure. my point is that, just as you can ignore the hairy corners of riscv and be ~ok, you can ignore the hairy parts of x86 and be ~ok
khrbtxyz has joined #commonlisp
Pixel_Outlaw has quit [Remote host closed the connection]
<beach>
Yes, I see. Good point.
gko` has quit [Ping timeout: 256 seconds]
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
pranavats has left #commonlisp [#commonlisp]
pranavats has joined #commonlisp
occ has quit [Read error: Connection reset by peer]
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dcb has quit [Quit: Connection closed for inactivity]
varjag has joined #commonlisp
dino_tutter has joined #commonlisp
dra has joined #commonlisp
dra has quit [Changing host]
dra has joined #commonlisp
utis has joined #commonlisp
dra has quit [Ping timeout: 264 seconds]
<dnhester26>
beach: what is "Relational Lisp"?
<beach>
I don't know. The article basically said "whatever that might be" or something to that effect. They obviously didn't want to elaborate because they were pushing Haskell.
<beach>
And I don't think the "Relational" part had anything to do with their good productivity, given the problem they had to solve.
<dnhester26>
ah, so it's just lisp then. I was googling it but couldn't find things haha
<beach>
The article is fairly old, and many of the competing languages are probably no longer in use.
<utis>
(loop repeat 2 do (format t "> ") (read-line))
<utis>
sly adds a newline after the 2nd prompt and slime doesn't . .
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
<utis>
is this a bug in sly? is there a way to prevent that newline?
shka has joined #commonlisp
jobhdez has quit [Quit: Client closed]
vyrsh has quit [Ping timeout: 264 seconds]
traidare has joined #commonlisp
gko has joined #commonlisp
donleo has joined #commonlisp
NicknameJohn has quit [Remote host closed the connection]
pranavats has left #commonlisp [Error from remote client]
Gleefre has joined #commonlisp
dra has joined #commonlisp
<dnhester26>
you are welcome
dra has quit [Ping timeout: 246 seconds]
bendersteed has quit [Quit: bendersteed]
danse-nr3 has joined #commonlisp
attila_lendvai_ has joined #commonlisp
<beach>
utis: I am not an expert, but I am not convinced that you can rely on the behavior of SLIME or SLY for user interaction.
NicknameJohn has joined #commonlisp
thuna` has joined #commonlisp
Fare has quit [Quit: Leaving]
vyrsh has joined #commonlisp
dajole has quit [Quit: Connection closed for inactivity]
czy has quit [Remote host closed the connection]
danse-nr3 has quit [Read error: Connection reset by peer]
czy has joined #commonlisp
danse-nr3 has joined #commonlisp
dnhester26 has quit [Read error: Connection reset by peer]
yitzi has joined #commonlisp
pranavats has joined #commonlisp
dra has joined #commonlisp
dra has quit [Changing host]
dra has joined #commonlisp
bilegeek has quit [Quit: Leaving]
szkl has joined #commonlisp
dnhester26 has joined #commonlisp
buffet2 has quit [Quit: WeeChat 3.8]
random-nick has joined #commonlisp
rtypo has joined #commonlisp
yitzi has quit [Remote host closed the connection]
msavoritias has quit [Ping timeout: 256 seconds]
green_ has quit [Ping timeout: 256 seconds]
younder has quit [Ping timeout: 268 seconds]
rendar has joined #commonlisp
rendar has quit [Changing host]
rendar has joined #commonlisp
dcb has joined #commonlisp
utis has quit [Ping timeout: 276 seconds]
dnhester26 has quit [Remote host closed the connection]
Mandus has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
yitzi has joined #commonlisp
Mandus has joined #commonlisp
utis has joined #commonlisp
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 264 seconds]
green_ has joined #commonlisp
josrr has joined #commonlisp
zetef has joined #commonlisp
danse-nr3 has quit [Ping timeout: 264 seconds]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
zetef has quit [Remote host closed the connection]
decweb has joined #commonlisp
msavoritias has joined #commonlisp
<dnhester26>
in a loop how can I return the last value? every run of the loop I am updating a variable declared with with `with a = 2` syntax, and I want to return the last value, is there a simple way of doing it? I know I can just wrap the loop in a let instead
<dnhester26>
return?
<beach>
(LOOP .... FINALLY RETURN A)
<dnhester26>
thanks
<dnhester26>
just found finally somewhere also in the docs
<dnhester26>
the epilogue
<dnhester26>
thanks
<beach>
dnhester26: You need to be more careful with terminology. WITH a = 2 is not a declaration. Neither is a DEFGENERIC form.
<dnhester26>
ok, I'll look up the glossary to learn what 'declaration' means, thanks for letting me know
<beach>
Sure.
tyson2 has joined #commonlisp
<dnhester26>
ah ok got it, now what should I say instead? define? initialize? set?
<beach>
A declaration is what you get when you use DECLARE, PROCLAIM, or DECLAIM.
<beach>
Yes, that would be a definition.
<dnhester26>
yeah, I just read the glossary and section 3.3 in the beginning
<dnhester26>
ok, thanks, definition
<dnhester26>
hm, how can I return the value of the variable defined by `with` in the loop? ,(loop for i in (list 1 2 3 4) with a = 3 finally (a))
<ixelp>
(loop for i in (list 1 2 3 4) with a = 3 finally (a)) ERROR: Undefined function A called with arguments () .
<dnhester26>
,(loop for i in (list 1 2 3 4) with a = 3 finally a)
<ixelp>
(loop for i in (list 1 2 3 4) with a = 3 finally a) ERROR: Compound form expected, but found A. ↩ Current LOOP context: FINALLY A.
<dnhester26>
I should define the variable in an enclosing let instead?
<beach>
,(loop for i in (list 1 2 3 4) with a = 3 finally (return a))
<ixelp>
(loop for i in (list 1 2 3 4) with a = 3 finally (return a)) ;Compiler warnings : ↩ ; In an anonymous lambda form: Unused lexical variable I ↩ => 3
<beach>
Sorry, forgot the parenthesis in my earlier answer.
<beach>
What follows FINALLY is a sequence of ordinary forms. And LOOP by default creates a block named NIL which is why you can use (RETURN A) == (RETURN-FROM NIL A).
<dnhester26>
ah, I didn't think about return because it will skip the epilogue and implicit accumulation, but since we are in the epilogue and I don't care about any accumulation since I didn't do any, then it's not an issue. Is that correct?
<beach>
Sounds right. I forget the definition of the "epilogue", so I am not entirely sure that it is skipped.
<dnhester26>
"The loop epilogue contains forms that are executed after iteration terminates, such as finally clauses, if any, along with any implicit return value from an accumulation clause or an termination-test clause."
<dnhester26>
thanks
<beach>
Sure.
green_ has quit [Ping timeout: 256 seconds]
danse-nr3 has joined #commonlisp
jmdaemon has quit [Ping timeout: 256 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<dnhester26>
how do I specialize a method to a list? I thought (given-list cons) would work, but got an error saying there's no method for the input I tried which was a list
<beach>
The CONS type doesn't include the empty list.
<beach>
Use the class LIST.
<dnhester26>
There is no applicable method for the generic function ... (64 #<MITO.DAO.TABLE:DAO-TABLE-CLASS ORM-QUERY-LANGUAGE::BOOK>).
<dnhester26>
ah, thanks, I will look that up in the reference
<ixelp>
cons | Common Lisp (New) Language Reference
<bjorkintosh>
for equal CONS!
<beach>
bjorkintosh: What would it do?
<bjorkintosh>
if an atom equals a cons, it returns T :-)
<bjorkintosh>
it's just silly.
<bjorkintosh>
mostly riffing on econ.
<beach>
dnhester26: A list is either a CONS or the symbol NIL. There is no such thing as a "regular list"
attila_lendvai_ is now known as attila_lendvai
<dnhester26>
ok, got it, thanks, a regular list I meant any lists that's not empty since you where treating the empty list as a special case
<beach>
dnhester26: A method specialized to LIST will be applicable when given a CONS, if that is what you mean.
<dnhester26>
thanks
<dnhester26>
yeah
<dnhester26>
that's what I meant
igemnace has quit [Read error: Connection reset by peer]
<beach>
Common Lisp doesn't have an abstract data type for lists. A Common Lisp list is just a (possibly empty) sequence of CONS cells.
bendersteed has joined #commonlisp
<beach>
For something to be an abstract data type in an imperative language, it has to preserve identity. But you can't write a function ADD-ELEMENT-FIRST-ON-LIST that takes an arbitrary list and adds an element to the beginning of that list while preserving the identity of the argument.
yewscion has quit [Ping timeout: 246 seconds]
ym has joined #commonlisp
danse-nr3 has quit [Ping timeout: 240 seconds]
danse-nr3 has joined #commonlisp
jonatack has quit [Ping timeout: 256 seconds]
utis has joined #commonlisp
igemnace has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
yewscion has joined #commonlisp
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
occ has quit [Ping timeout: 256 seconds]
zetef has joined #commonlisp
zetef has quit [Remote host closed the connection]
varjag has quit [Quit: ERC (IRC client for Emacs 27.1)]
a51 has joined #commonlisp
traidare has joined #commonlisp
yitzi has quit [Remote host closed the connection]
waleee has joined #commonlisp
tyson2 has joined #commonlisp
yewscion has quit [Ping timeout: 264 seconds]
<aeth>
what CL needs is icons, not econs
<aeth>
where (icons 1 (icons 2 (icons 3 nil)) = the literal list produced by evaluating '(1 . (2 . (3 . nil))) or '(1 2 3) and (ilist 1 2 3) for short.
<aeth>
since literal lists shouldn't be mutated and behave a bit differently
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
dnhester26 has quit [Remote host closed the connection]
<bike>
(defmacro icons (car cdr) `(let ((cell (load-time-value (cons nil nil)))) (setf (car cell) ,car (cdr cell) ,cdr) cell)), this is definitely a good idea.
<pfdietz>
I worked with a CL program once that used l-t-v for combining literal constants. A hash table was maintained of these constants and the l-t-v code looked up in that table to maximize structure sharing.
danse-nr3 has quit [Ping timeout: 268 seconds]
khrbtxyz has quit [Ping timeout: 256 seconds]
azimut has quit [Ping timeout: 240 seconds]
azimut has joined #commonlisp
khrbtxyz has joined #commonlisp
Gleefre has joined #commonlisp
danse-nr3 has joined #commonlisp
yewscion has joined #commonlisp
piglet_ has joined #commonlisp
vyrsh has quit [Ping timeout: 264 seconds]
mesaoptimizer_ has quit [Quit: mesaoptimizer_]
AndreiDuma has quit [Ping timeout: 256 seconds]
AndreiDuma_ has joined #commonlisp
igemnace has quit [Remote host closed the connection]
kevingal has joined #commonlisp
kevingal_ has joined #commonlisp
piglet_ is now known as vyrsh
vyrsh has quit [Quit: Konversation terminated!]
vyrsh has joined #commonlisp
wacki has quit [Read error: Connection reset by peer]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
wacki has joined #commonlisp
yitzi has joined #commonlisp
jonatack has joined #commonlisp
khrbtxyz has quit [Ping timeout: 264 seconds]
gilberth has quit [Ping timeout: 256 seconds]
ixelp has quit [Ping timeout: 268 seconds]
ixelp has joined #commonlisp
msavoritias has quit [Ping timeout: 252 seconds]
khrbtxyz has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
traidare has quit [Ping timeout: 264 seconds]
waleee has quit [Ping timeout: 264 seconds]
vyrsh has quit [Ping timeout: 264 seconds]
mgl_ has quit [Ping timeout: 256 seconds]
green_ has quit [Ping timeout: 276 seconds]
traidare has joined #commonlisp
dra has quit [Ping timeout: 256 seconds]
<Shinmera>
In Kandria I've used LTV as a hack to avoid consing when DX wasn't an option
<Shinmera>
Fortunately in recent SBCL versions DX has become a lot better
AndreiDuma has joined #commonlisp
AndreiDuma_ has quit [Read error: Connection reset by peer]
yewscion has quit [Remote host closed the connection]
yewscion has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
dnhester26 has joined #commonlisp
mesaoptimizer_ has joined #commonlisp
mesaoptimizer_ has quit [Client Quit]
yewscion has quit [Remote host closed the connection]
mesaoptimizer0_ has joined #commonlisp
yewscion has joined #commonlisp
mesaoptimizer has quit [Quit: mesaoptimizer]
mesaoptimizer0_ has quit [Client Quit]
mesaoptimizer has joined #commonlisp
<Mondenkind>
sadly ltv isn't really thread-safe
<Mondenkind>
Shinmera: wasn't there an sb-c::%really-dx-no-but-for-real or so?
<bike>
there's a truly-dynamic-extent declaration
<bike>
if you're feeling confident
<Mondenkind>
yeah, that
<jfloren_>
Can somebody hit me with a resource that'll help me really wrap my head around macros? I've written a decent amount of CL for hobby purposes but I've not yet felt the need to do a macro
Gleefre has quit [Remote host closed the connection]
<bike>
that's healthy
<bike>
i don't know of any specific resource. i guess On Lisp is mostly about macros, but it's slightly dodgy.
<bike>
they just rewrite code as other code. Try C-c C-m ing over your code and you can see all the macroexpansions that are involved.
danse-nr3 has quit [Ping timeout: 264 seconds]
attila_lendvai has quit [Remote host closed the connection]
attila_lendvai has joined #commonlisp
<Shinmera>
Mondenkind: I know, that's why I called it a hack
<Shinmera>
and truly-dx doesn't help when it can't determine how much to allocate to begin with
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dra has joined #commonlisp
luis190 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
Gleefre has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
AndreiDuma has joined #commonlisp
dra has quit [Quit: Leaving]
dra has joined #commonlisp
jon_atack has joined #commonlisp
msavoritias has joined #commonlisp
jonatack has quit [Ping timeout: 256 seconds]
mgl_ has joined #commonlisp
mgl_ has quit [Ping timeout: 260 seconds]
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pfdietz>
ISI did a lot of stuff with lisp. I wonder how much survives in some form.
gilberth has joined #commonlisp
justache has quit [Read error: Connection reset by peer]
justache has joined #commonlisp
olnw has quit [*.net *.split]
olnw has joined #commonlisp
<bike>
inter services intelligence?
Devon has quit [Ping timeout: 246 seconds]
waleee has joined #commonlisp
Devon has joined #commonlisp
<mfiano>
I would really like to recommend Let Over Lambda as a "macro book", as it really opened up my mind years after becoming fluent with them, but, I can't really recommend it as a whole, because the macros and code style is a bit...unorthodox, and you wouldn't really use any of it in real code. It's more of a "hey, look at what I can do with macros" book, moreso than anything I can recommend for
<mfiano>
utility.
utis has quit [Ping timeout: 268 seconds]
justache has quit [Read error: Connection reset by peer]
ym has quit [Ping timeout: 264 seconds]
justache has joined #commonlisp
green_ has joined #commonlisp
jon_atack has quit [Ping timeout: 264 seconds]
yewscion has joined #commonlisp
<Shinmera>
it's also insufferable to read
green_ has quit [Ping timeout: 264 seconds]
<zyd>
jfloren: How about doing a "tour" of what intro CL books say on macros. The PCL chapters on macros and looking at some of the practicals chapter. Paul Graham's ANSI Common Lisp has some stuff on macros, the individual chapter but also the Generating HTML chapter. Could also grep over Norvig's PAIP searching `defmacro' for all the times he invokes one.
<jfloren_>
Thanks everyone for the suggestions, I'll look into them
NicknameJohn has quit [Remote host closed the connection]
<edgar-rft>
oh, I just see that bike already said that :-)
NicknameJohn has joined #commonlisp
pfdietz has quit [Quit: Client closed]
NicknameJohn has quit [Remote host closed the connection]
<bjorkintosh>
what about LoL? Lisp Over Lambda?
<pranavats>
SHARP-BACKQUOTE reader macro from LoL seems useful.
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<pranavats>
(mapcar #2`(,a1 ,a2) '(a b) '(1 2)) basically zips the two lists to give ((a 1) (b 2)).
cage has quit [Quit: rcirc on GNU Emacs 29.1]
mgl_ has joined #commonlisp
<pranavats>
This also works with implicit map in SERIES macro package. Equivalent series code would be (collect (#2`(,a0 ,a1) (scan '(a b)) (scan-range))).
rogersm has joined #commonlisp
green_ has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
pfdietz has joined #commonlisp
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
varjag has joined #commonlisp
_cymew_ has quit [Quit: Konversation terminated!]
triffid has joined #commonlisp
rogersm has quit [Quit: Leaving...]
AndreiDuma has joined #commonlisp
younder has joined #commonlisp
tyson2 has joined #commonlisp
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
yewscion has quit [Ping timeout: 252 seconds]
ym has joined #commonlisp
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rendar has quit [Ping timeout: 264 seconds]
Gleefre has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
epony has joined #commonlisp
tyson2 has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
khrbtxyz has quit [Ping timeout: 246 seconds]
mala has joined #commonlisp
khrbtxyz has joined #commonlisp
yitzi has quit [Remote host closed the connection]
kevingal_ has quit [Ping timeout: 256 seconds]
kevingal has quit [Ping timeout: 256 seconds]
traidare has quit [Ping timeout: 276 seconds]
jonatack has joined #commonlisp
mgl_ has quit [Ping timeout: 256 seconds]
attila_lendvai has quit [Ping timeout: 264 seconds]
pranavats has left #commonlisp [Error from remote client]