<dnhester>
Bubblegumdrop: thanks for your comment and your code. I read through it, but then went back to finishing my problem at hand, I'll take a look at it again once I have a chance
<dnhester>
Bubblegumdrop: ah, I just read it again, it looks pretty cool and useful
<dnhester>
Have you made any other mito prjects you can share?
josrr has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
josrr has joined #commonlisp
tyson2 has joined #commonlisp
amb007 has joined #commonlisp
<Bubblegumdrop>
I wrote a whole CRUD web app using MITO
<dnhester>
Bubblegumdrop: your app is amazing, I wish I would've had that when I started my current project
<dnhester>
I was flying in the dark, but I see we thought about very similar solutions.. I made my own with-user-logged-in macros as well, slightly different but the same idea
<Bubblegumdrop>
I'm glad!
<Bubblegumdrop>
It was clear to me from the bugtracker for caveman2 a lot of people are using it for a lot of projects.
<Bubblegumdrop>
I regret not littering my source code with more links to the resources I used to learn any of this stuff.
<Bubblegumdrop>
I tried my best to take notes.
<dnhester>
Was this project just to learn or are you deploying an app?
<Bubblegumdrop>
I was hired as a contractor to write this app, but the guy stopped paying me, so I released it for free.
<dnhester>
By the way, if you want to make a guide or help with making tutorials I made a website to add those lisp-docs.github.io
<Bubblegumdrop>
Thanks, I will check it out.
<Bubblegumdrop>
I have a lot on my blog.
<dnhester>
was common lisp your choice or theirs?
<Bubblegumdrop>
It was clear to me he had no software experience whatsoever so I buckled up for a wild ride, and I figured since we were doing that, I was going to be comfortable. I chose/recommended lisp for the task.
<Bubblegumdrop>
He had originally contracted me as a Ruby developer but after discussing what the project is/was, ...
<dnhester>
Bubblegumdrop: oh haha I see you also made your own RBAC
<Bubblegumdrop>
Well, the code sort of reflects that. It changed week to week.
<Bubblegumdrop>
indeed
<Bubblegumdrop>
Actually, I coped from openbookstore
<dnhester>
I was thinking of making a quick sharable library once I have to coded it
<Bubblegumdrop>
Theirs supports more use cases though.
<Bubblegumdrop>
I coped a lot of code from this project.
<Bubblegumdrop>
The i18n stuff, too. Although theirs doesn't work, and mine does. I need to contribute my patches back to them.
jon_atack has joined #commonlisp
<bjorkintosh>
Bubblegumdrop, which DB did you choose for your project?
<Bubblegumdrop>
It's using MITO ORM so you could theoretically use PSQL, MSQL, etc
<Bubblegumdrop>
I did everything using SQLite.
<Bubblegumdrop>
Because, comfy.
<dnhester>
I had a lot of problems with sqlite, I thought it was a mito issue, but it was not, they do not support long SQL queries and complicated joins very well, beware!
<Bubblegumdrop>
SQLite is amazing tbh
<Bubblegumdrop>
Oh
<dnhester>
that's awesome, thanks for the source!
<Bubblegumdrop>
dnhester the src/models/sqlite-schema was very useful for me
<dnhester>
I always loved sqlite becuase it's quick and easy
<ixelp>
Bubblegumdrop/cl-deck-builder2: Yu-Gi-Oh! Deck Building and Card Inventory Management web interface written in Common Li [...]
<dnhester>
but if you are doing complicated queries it breaks
<Bubblegumdrop>
You can meta inspect the database ... with the orm
<dnhester>
thanks for the link, will take a look
<dnhester>
how?
<bjorkintosh>
dnhester, it breaks? but does the query then work with postgres?
jonatack has quit [Ping timeout: 264 seconds]
attila_lendvai_ has joined #commonlisp
<Bubblegumdrop>
dnhester SQLite keeps the query that created the table/database *in* the .sqlite3 file
<Bubblegumdrop>
So this code will let you extract the query, then you can pass it to e.g. SxQL to build a new query,
<Bubblegumdrop>
You kinda get the idea?
<Bubblegumdrop>
I never got that far, but SQL introspection is 100% possible with this.
<Bubblegumdrop>
Tables that write new tables sort of deal
<dnhester>
ah I see, in your sqlite schema file
<dnhester>
bjorkintosh: yeah, postgres and mysql worked, I switched and all my problems disappeared
<bjorkintosh>
dnhester, how long ago was this?
<Bubblegumdrop>
SQLite syntax is a bit restricted
<dnhester>
it took me a long time to reaize until I gave up on doing it in lisp and just opened the sqlite prompt and realized it was a sqlite problem
<Bubblegumdrop>
at the same time, it lets you do wonky stuff like put an int into a text field
<dnhester>
I just installed postgres, changed the connection details in the project and everything worked
<dnhester>
bjorkintosh: maybe 3 months
<dnhester>
i was using their latest
<dnhester>
I think I even submitted a github issue
<bjorkintosh>
oh good.
igemnace has joined #commonlisp
<dnhester>
or once I googled it I found out it was not so uncommon
<dnhester>
the syntax was just basic joins, I think I was doing 3 joins and listing the column name to give them individual aliases to avoid name conflicts so that parsing the resulting plist would work as expected
<Bubblegumdrop>
Yeah I used a lot of intermediate tables for that
<dnhester>
but the sqlite broke, don't remember if it was because of the aliases, the query lenght, or the joins
<dnhester>
Bubblegumdrop: of all your files, is there one where you are fetching data with a few joins? I'd like to see how you are dealing with parsing the data
<dnhester>
even one join will do if it's not the mito 'includes'
<dnhester>
i just want to see how other people have dealt with parsing the resulting data
<Bubblegumdrop>
dnhester that code is pretty horrible
<dnhester>
ah, ok, I know basics of SQL but mostly db design, not so much writing things like this
<Bubblegumdrop>
I knew SQL had BEGIN TRANSACTION, so I just looked for a way to use that
<Bubblegumdrop>
And I think MITO is using CL-DBI under the hood?
<dnhester>
I've had to optmizie complex queries, but have generally just used the lbraries available and haven't actually had to deal with writing much sql except for joins
<ixelp>
Searching, Sorting and Pagination in a Common Lisp web application - DEV Community
<Bubblegumdrop>
It will walk you through how to use caveman2 and HTMX, which my app uses.
<Bubblegumdrop>
htmx+lisp was pretty cool, update the repl and the page updates live
<Bubblegumdrop>
I had originally thought to use that other one,
<Bubblegumdrop>
clog
<Bubblegumdrop>
But that ended up not working out.
<dnhester>
Oh, I had to implement my own pagination because it wasn't provided by mito only to find out that the way most frameworks do it in python groovy etc is broken, so I ended up with better stuff
<Bubblegumdrop>
My pagination is based on that blog post from dev.to
<Bubblegumdrop>
You can see it in src/toolkit, I believe
<ixelp>
Bubblegumdrop/cl-deck-builder2: Yu-Gi-Oh! Deck Building and Card Inventory Management web interface written in Common Li [...]
<dnhester>
ha, I have a one to many join and wanted to do pagination on the one side of the join, the solution is to add a join of that table to itself and do the offset in that join
<Bubblegumdrop>
fun stuff right?
<dnhester>
haha yeah
<Bubblegumdrop>
This was a wild project.
<dnhester>
thats cool
<Bubblegumdrop>
Yeah, there's a ton of cool stuff I wrote to support it, so I figured it would be best to share.
<dnhester>
I love CL, I actually came because of MOP, not macros, and MOP is amazing!! I want to learn the other chapters on macros and conditions and obviously the Keene book, I just haven't had the time because of pressure to finish deadlines
waleee has joined #commonlisp
<Bubblegumdrop>
Haha, yes, I often see "I wish I had spent more time reading the docs, so I could have spent less time writing code" or something to that efect.
<dnhester>
macros have been amazing as well
<dnhester>
but yeah, that's life, hopefully in the next couple of months things will calm down a bit and I'll get some time
<Bubblegumdrop>
I only used one real macro hack in the code
<ixelp>
Bubblegumdrop/cl-deck-builder2: Yu-Gi-Oh! Deck Building and Card Inventory Management web interface written in Common Li [...]
<Bubblegumdrop>
I have figured out a better way to do this since, and need to write about it.
<Bubblegumdrop>
I've read that macros are "unhygenic"
<Bubblegumdrop>
I try not to use them.
<Bubblegumdrop>
er, try not to define my own. make use of existing ones.
jonatack has joined #commonlisp
jon_atack has quit [Ping timeout: 272 seconds]
awlygj has quit [Ping timeout: 272 seconds]
rgherdt__ has joined #commonlisp
awlygj has joined #commonlisp
danse-nr3 has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
rgherdt_ has quit [Ping timeout: 255 seconds]
<beach>
Bubblegumdrop: The "unhygienic" should be considered term in the war of words between language followers. I am guessing the Scheme people named their macros "hygienic" precisely so that people like you would consider (say) Common Lisp macros as "dirty" or "unhygienic".
<beach>
Bubblegumdrop: If you are not using Common Lisp macros when they are needed, you will have a lot of boilerplate code.
<Bubblegumdrop>
yes
<beach>
Bubblegumdrop: Other terms to look out for are "strongly typed" and "weakly typed" defined by the crowd that wants Common Lisp to look "weak" and their favorite language to look "strong". To counter that, we use the terms "statically typed" and "dynamically typed" instead, so that their language looks "static" and Common Lisp looks "dynamic".
<Bubblegumdrop>
indeed
<beach>
Bubblegumdrop: So, in summary, there is nothing wrong with Common Lisp macros. Go ahead and use them when they are called for.
<Bubblegumdrop>
Yes. How about defining your own macros?
<Bubblegumdrop>
I've seen some pretty crazy stuff out there, like eval-once
<beach>
I meant, go ahead and define your own macros when that is called for.
<beach>
Macros exist in Common Lisp for very good reasons.
<beach>
It would be sub-optimal to avoid them when you have a situation for which they were meant.
<beach>
I recommend you read the book On Lisp by Paul Graham. It is almost entirely about the use of Common Lisp macros.
<Bubblegumdrop>
I have ANSI CL from him
<Bubblegumdrop>
Thanks for the rec
<beach>
Sure.
unl0ckd has joined #commonlisp
<random-nick>
the lack of hygienic macros in CL is not that big of a deal compared to Scheme because of differences between Scheme modules and Common Lisp packages
rgherdt has joined #commonlisp
<random-nick>
in Scheme, there is only one interned symbol for a given symbol name, and modules map those unique symbols to their values in that module
Inline has joined #commonlisp
<random-nick>
and symbols in expanded unhygienic macros (when they exist, some schemes only have hygienic macros) are resolved in the macro caller's module instead of the macro's module
<beach>
random-nick: Thanks for the explanation.
rgherdt__ has quit [Ping timeout: 256 seconds]
occ has quit [Read error: Connection reset by peer]
X-Scale has quit [Quit: Client closed]
mulk has left #commonlisp [#commonlisp]
occ has joined #commonlisp
lucasta has joined #commonlisp
unl0ckd has quit [Ping timeout: 268 seconds]
zxcvz has joined #commonlisp
<beach>
Maybe we should use "rigid" instead of "hygienic" and "flexible" instead of "unhygienic" :)
pfdietz has joined #commonlisp
zetef has joined #commonlisp
danse-nr3 has quit [Ping timeout: 272 seconds]
a51 has joined #commonlisp
zetef has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
bendersteed has quit [Quit: bendersteed]
pfdietz has quit [Quit: Client closed]
pfdietz has joined #commonlisp
yitzi has quit [Remote host closed the connection]
ymir has joined #commonlisp
kevingal_ has quit [Ping timeout: 256 seconds]
kevingal has quit [Ping timeout: 256 seconds]
Odin-FOO has joined #commonlisp
OlCe`` has quit []
lucasta has quit [Remote host closed the connection]
OlCe has joined #commonlisp
josrr has joined #commonlisp
<dnhester>
does anyone know why this works (eql (mito:object-id (fourth (slot-value curr-obj obj-slot-name)))
<dnhester>
(mito:object-id join-obj)) but the following returns NIL `(member join-obj (slot-value curr-obj obj-slot-name)
<dnhester>
:key #'mito:object-id)` ?
<dnhester>
I thought member would call the key function every time and compare the value obtained by that
<dnhester>
somehow when calling eql I get T, but member returns Nilby
<dnhester>
ahh emacs auto complete... NIL
<dnhester>
sory for the multi line code
<aeth>
random-nick: I think what really makes hygienic macros seem unnecessary in CL is being a Lisp-2... FLET-based accidental name collision is rare. And if only CL is :USEd and CL is package locked, then you'd really have to go out of your way to FLET redefine a function that's used by a macro.
<beach>
dnhester: You probably have to pass (mito:obj-id join-obj) to member if I read your code correctly.
<aeth>
In Scheme, if you (let ((list (list 1 2 3))) ...) you're not safe by not calling LIST yourself because some macro in the ... can still call it.
<aeth>
But this also applies to any procedure name, some of which aren't as obvious.
<dnhester>
beach: ah, got it, thanks, so key is only applied to the list, not to the other element, that makes sense
<beach>
Correct.
kevingal has joined #commonlisp
kevingal_ has joined #commonlisp
<dnhester>
beach: thanks
<beach>
Pleasure.
<aeth>
As for strong vs weak typing, it's not the same as static vs dynamic typing. It's not well-defined, but "weak typing" is basically "coercively typed", especially in a world full of overloaded operators (as in, 4 + "4" is a meaningful operation and could produce "44" or 8). Although coerce/convert/etc. is also not well-defined between languages.
<aeth>
Although you can also have completely untyped, e.g. asm.
<beach>
aeth: You are cheating by not taking into account what those other language people say.
<aeth>
Even the Wikipedia article is a bit confused with itself, but counts runtime type checking and is mostly talking about runtime type conversion/coersion. https://en.wikipedia.org/wiki/Strong_and_weak_typing
<beach>
aeth: You are just citing our preferred way to define those terms. So you are preaching to the choir.
<aeth>
Programming language terminology is a bit confusing. Even e.g. "pass by value" or "call by value" (which? both, apparently!) is misleading because it's basically just "pass by implicit copying" (but using that word "implicit" makes it sound "weak", I guess, just like weak typing).
<beach>
It does not mean that at all. It means that arguments are evaluated before the function is called.
<beach>
The C++ people rudely redefined something that has been defined in CS for more than half a century.
<beach>
... so Common Lisp definitely uses call by value. Haskell does not. Nor does C++ when you pass a reference.
rogersm has joined #commonlisp
jelewis2 has quit [Ping timeout: 240 seconds]
Inline has quit [Quit: Leaving]
<beach>
But I guess you are right in some sense. Common Lisp also implicitly copies the value of the argument. It is just that the value is a reference.
dnhester has quit [Ping timeout: 272 seconds]
danse-nr3 has quit [Read error: Connection reset by peer]
danse-nr3 has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
mulk has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
rogersm has quit [Remote host closed the connection]
rogersm has joined #commonlisp
dnhester has joined #commonlisp
dnhester has quit [Read error: Connection reset by peer]
dnhester has joined #commonlisp
occ has quit [Ping timeout: 272 seconds]
josrr has quit [Remote host closed the connection]
epony has quit [Remote host closed the connection]
igemnace has quit [Quit: WeeChat 4.2.1]
X-Scale has joined #commonlisp
danse-nr3 has quit [Ping timeout: 272 seconds]
epony has joined #commonlisp
benkard has joined #commonlisp
mulk has quit [Ping timeout: 276 seconds]
benkard is now known as mulk
zxcvz has quit [Quit: zxcvz]
amb007 has joined #commonlisp
yitzi has joined #commonlisp
ec has quit [Read error: Connection reset by peer]
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
ec has joined #commonlisp
unl0ckd has joined #commonlisp
awlygj has quit [Quit: leaving]
josrr has joined #commonlisp
Inline has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #commonlisp
jmdaemon has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #commonlisp
pfdietz has quit [Quit: Client closed]
thuna` has joined #commonlisp
bubblegum has quit [Ping timeout: 256 seconds]
tyson2 has joined #commonlisp
bubblegum has joined #commonlisp
jmdaemon has quit [Ping timeout: 240 seconds]
Inline has quit [Ping timeout: 268 seconds]
jmdaemon has joined #commonlisp
chomwitt has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
ym has joined #commonlisp
Devon has joined #commonlisp
Inline has joined #commonlisp
NotThatRPG has quit [Ping timeout: 256 seconds]
unl0ckd has quit [Ping timeout: 268 seconds]
pfdietz has joined #commonlisp
puke is now known as Guest4665
puke has joined #commonlisp
Guest4665 has quit [Killed (platinum.libera.chat (Nickname regained by services))]
kevingal_ has quit [Ping timeout: 256 seconds]
kevingal has quit [Ping timeout: 256 seconds]
puke has quit [Remote host closed the connection]
puke has joined #commonlisp
brokkoli_origin has quit [Remote host closed the connection]
NotThatRPG has joined #commonlisp
brokkoli_origin has joined #commonlisp
<yottabyte>
can I get some recommendations of connecting to a mysql 8 database? I used https://github.com/qitab/qmynd a while ago, but it appears to not play nice when trying to connect to mysql 8
<ixelp>
GitHub - qitab/qmynd: QITAB MySQL Native Driver for Common Lisp
<yottabyte>
I don't need a full ORM, but if there's an easy to use library I'm not opposed to it. I don't mind getting result sets back as a list or a map
rogersm has quit [Remote host closed the connection]
<ixelp>
GitHub - CodyReichert/awesome-cl: A curated list of awesome Common Lisp frameworks, libraries and other shiny stuff.
<Bubblegumdrop>
Oh huh, mito is *not* using CL-DBI?
jonatack has quit [Ping timeout: 264 seconds]
<aeth>
On terminology between languages, it's actually quite hopeless. You can't even get people to agree on what a "vector" is. To C++, it's necessarily adjustable. And Python calls them "lists" despite not being linked lists. Etc.
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rogersm has joined #commonlisp
rogersm has quit [Remote host closed the connection]
NotThatRPG has joined #commonlisp
rogersm has joined #commonlisp
rogersm has quit [Remote host closed the connection]
rogersm has joined #commonlisp
rogersm has quit [Remote host closed the connection]
rogersm has joined #commonlisp
X-Scale has quit [Quit: Client closed]
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jmdaemon has quit [Ping timeout: 272 seconds]
azimut has quit [Ping timeout: 255 seconds]
cage has joined #commonlisp
NotThatRPG has joined #commonlisp
rogersm has quit [Remote host closed the connection]
akoana has joined #commonlisp
rogersm has joined #commonlisp
rogersm has quit [Remote host closed the connection]
unl0ckd has joined #commonlisp
rogersm has joined #commonlisp
josrr has quit [Remote host closed the connection]
rogersm has quit [Remote host closed the connection]
<yottabyte>
trying mito, I got: Unable to load foreign library (LIBMYSQLCLIENT). Error opening shared object "libmysql.dll": The specified module could not be found. [Condition of type CFFI:LOAD-FOREIGN-LIBRARY-ERROR]
<yottabyte>
I know where this dll is located on my machine, can I specify the symbol somehow?
rogersm has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NotThatRPG has joined #commonlisp
rogersm has quit [Ping timeout: 272 seconds]
cstml has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
varjag has joined #commonlisp
bubblegum has joined #commonlisp
josrr has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
jmdaemon has joined #commonlisp
bubblegum has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #commonlisp
varjag has quit [Ping timeout: 264 seconds]
Odin-DECK has joined #commonlisp
Odin-DECK has quit [Client Quit]
bubblegum has quit [Ping timeout: 272 seconds]
bubblegum has joined #commonlisp
Odin-DECK has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #commonlisp
unl0ckd has quit [Ping timeout: 268 seconds]
Pixel_Outlaw has joined #commonlisp
Inline has joined #commonlisp
cstml has quit [Quit: WeeChat 4.1.1]
mariari has quit [Ping timeout: 276 seconds]
bubblegum has quit [Ping timeout: 268 seconds]
bubblegum has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #commonlisp
wacki has joined #commonlisp
bubblegum has quit [Ping timeout: 272 seconds]
bubblegum has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
<jcowan>
What CL calls functions, CL calls procedures, because "function" implies returning a single value
bubblegum has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #commonlisp
rogersm has joined #commonlisp
mariari has joined #commonlisp
<NotThatRPG>
jcowan: ??? Should one of those "CL"'s supposed to be something else?
rogersm has quit [Ping timeout: 252 seconds]
<jcowan>
oopa, s2/CL/Scheme
<thuna`>
I don't think you can really consider VALUES as "multiple values" from a function-or-not standpoint
<jcowan>
In Scheme it's an error to invoke a procedure with the wrong number of values, except that begin (= PROGN) can take 1 or 0 values for hysterical raisins
<gilberth>
Isn't "procedure" commonly used to stress that there are side effect? And that the thing is invoked for side effect and not for values? See e.g. Pascal.
<jcowan>
depends on whether you think multiple values are a side effect.
<gilberth>
It would be odd to consider CL:VALUES having side effects.
<jcowan>
not so much having a side effect as being a side effect
<jcowan>
in any case, in Scheme (+ 1 (values 2 3)) the result is undefined
alex_p has joined #commonlisp
<gilberth>
UB? Like in "Machine might consider preparing coffee."?
<jcowan>
yes, although most implementations specify what happens: drop excess values, signal a "wrong number of values" condition, or signal an implementation-specific condition (e.g. (values 2 3) => ((values) 2 3), where the car is a unique cons.
<gilberth>
This looks like someone tried to sneak in multiple values into something that has no real support for them. Like those fake multiple values for elisp.
<jcowan>
Pretty much. But because wrong number of values is UB, it is legitimate
<thuna`>
I always read VALUES as "a primary value and optional values", but that reads more like "a non-cons tuple".
<thuna`>
s/non-cons//
rogersm has joined #commonlisp
<gilberth>
Quite. But, you could pass that tuple around. You can't with multiple-values. I mean (defun id (x) x) (nth-value 1 (id (values 1 2))) doesn't work. Not with CL.
<thuna`>
Passing the optional values around implicitly sounds like a disaster in the making
<jcowan>
That's because CL imposes a fixed behavior for "wrong number of values"
<gilberth>
Nah, this tuple-like implementation misses the point of multiple values. That is, the convenience of multiple values is that I can say (+ (floor 10 3) 42) without error as CL doesn't bother me to look at the second return value of FLOOR.
<gilberth>
Or I can say (FOO (GETHASH HASH KEY)) without being bothered either.
<josrr>
Kingsy: route-template is a reader, check the class route.
bubblegum has quit [Read error: Connection reset by peer]
<gilberth>
For the tuple-like semantics I won't need any language support, I could do that myself.
bubblegum has joined #commonlisp
<jcowan>
You can also do it yourself with "success and failure continuation arguments"
<gilberth>
jcowan: I can't. How could I say (+ (floor 10 3) 42) then?
<Kingsy>
josrr: ahhhhh right
tyson2 has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
<thuna`>
I find MULTIPLE-VALUE-BIND to be quite cumbersome. LET should have just accepted multiple VARs.
<gilberth>
Write your own. We have macros, no?
<thuna`>
Maybe in alexandria I could see it. Otherwise, having to pull a new thing in defeats the purpose IMO.
<thuna`>
s/thing/package/
<kagevf>
that macro would be an interesting exercise
<kagevf>
(let-mvb ((single-value (single-value-form) ;; use normal let binding syntax ... then (multiple-value1 multiple-value2 (multiple-value-form)) ;; switch to m-v-b for this one
jmdaemon has quit [Ping timeout: 264 seconds]
<kagevf>
I think you could switch to m-v-b if there were 3 or more forms in the bind expression
<gilberth>
A test would be: (let* ((x 10) (y (symbol-value 'x))) (declare (special x)) y)
bubblegum has quit [Read error: Connection reset by peer]
<gilberth>
That is you would need to pull declarations inbetween the nested LET/MULTIPLE-VALUE-BIND. That would involve parsing declarations, which would need to tell whether symbols are types, which is not possible with ANSI-CL.
<gilberth>
You can play tricks with &AUX, but that would break, when you name one of your variables by a lambda-list keyword.
bubblegum has joined #commonlisp
<thuna`>
That helps my case for having this be handled by the standard LET, I guess.
<thuna`>
Not that that will happen anytime soon/ever
rogersm has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gilberth>
I have code to parse DECLAREs and pulls them out, but that won't fit a page.
<jcowan>
gilberth: you are right
<thuna`>
I imagine it's also a lot worse performance-wise
<thuna`>
(Due to the LAMBDA)
<gilberth>
And as ANSI-CL cannot tell me whether (DECLARE (FOO X)) is a type declaration or not, can't be 100% correct. Another crucial missing piece of ANSI-CL IMHO.
NotThatRPG has joined #commonlisp
<gilberth>
thuna`: When ((LAMBDA (&AUX X) ...)) compiles differently from (LET (X) ...) get a new compiler.
Odin-DECK has quit [Quit: Gone now.]
rogersm has quit [Quit: Leaving...]
<thuna`>
How/why would ((LAMBDA (&AUX X) ...)) be converted to (LET (X) ...)?
<gilberth>
It's the same, isn't it?
<gilberth>
Also ((lambda (x) ...) 10) and (let ((x 10)) ...) is the same.
<gilberth>
thuna`: I mean, once the Lisp code has been converted to whatever intermediate language there is, both should look the same. It would be a poor compiler would it actually compile crafting a closure and then invoking it.
<thuna`>
Is that right? Works the same, sure, but I would expect that to be true literally only with the SPEED optimization set to a high value
<thuna`>
Maybe I am underestimating how clever compilers are
<gilberth>
thuna`: I would be surprised if SPEED would make a difference. I mean this ((lambda (..) ..) ..) is very deeply rooted with the language. Actually predates LET.
<gilberth>
The very first LISP had that construct. And no LET.
<gilberth>
Still, I don't like the multiple-value-list in there and I doubt that compilers would be clever enough to skip consing just there. So would I be serious I would go with the parsing declarations part and just assume that (declare (foo x)) is a type declaration and not something else. That's not too hard, just tedious.
<thuna`>
That makes sense, I guess I had a misconception wrt. how it worked under the hood
<thuna`>
gilberth: It should be ok to move the non-type-declarations on X to the relevant body as well, I would imagine. Well, with LET, at least.
jonatack has joined #commonlisp
<gilberth>
thuna`: When I split hair, I can't be sure. E.g. I must make (declare (special x y z)) into (declare (special x)), when I'm at X.
bubblegum has quit [Read error: Connection reset by peer]
<gilberth>
And (declare (foo x (blah 10))) might make sense to whoever came up with FOO declarations, but when I pull that X, I would get (declare (foo x)) and (declare (foo (blah 10))), which might not.
<gilberth>
Splitting hair.
<thuna`>
Fair enough
<gilberth>
Anyhow, ANSI-CL could have provided a means to ask whether FOO is a type, or whether it is a declaration.
bubblegum has joined #commonlisp
<gilberth>
&AUX is a nice trick to get around that. But (lambda (&aux (&aux 10)) ...) is forbidden. While (let ((&aux 10)) ...) is perfectly fine.
bubblegum has quit [Read error: Connection reset by peer]
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
bubblegum has joined #commonlisp
traidare has quit [Ping timeout: 255 seconds]
tyson2 has quit [Remote host closed the connection]
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #commonlisp
<Kingsy>
in a macro, how coem I cant do this `(make-instance 'some-class :body ,@body) ? if I do this then later do a (funcall (get-body some-class-object)) <- it fails, it trys to call a function on the output of the @body, it doesnt run the body itself.
<Kingsy>
its worth noting that I tried wrapping the ,@body in a (lambda () ,@body) but I get the same behaviour
pillton has joined #commonlisp
<_death>
what do you mean by "the same behaviour"? the lambda version seems like it should work
<Kingsy>
oh hmm yeah I thought it should too.. let me try it again
<Kingsy>
hmmm so strange. it now works after just restarting my repl and just running again. are there issues with just recompiling macros?
<Kingsy>
the lambda version I mean
<_death>
you also need to recompile the forms using them
<Kingsy>
must have just missed something. well that ended up being easy. haha
<Kingsy>
_death: thanks for answering!
tyson2 has joined #commonlisp
kevingal has joined #commonlisp
kevingal_ has joined #commonlisp
jfloren has quit [Quit: Ping timeout (120 seconds)]
rgherdt has quit [Quit: Leaving]
jfloren has joined #commonlisp
<_death>
np
dino__ has quit [Ping timeout: 255 seconds]
azimut has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
pve has quit [Quit: leaving]
donleo has quit [Ping timeout: 264 seconds]
bubblegum has joined #commonlisp
ymir has quit [Ping timeout: 272 seconds]
shka has quit [Ping timeout: 272 seconds]
boigahs has quit [Remote host closed the connection]