cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
sdumi has joined #lisp
saganman has quit [Read error: Connection reset by peer]
sdumi has quit [Ping timeout: 240 seconds]
sdumi has joined #lisp
ft has joined #lisp
scymtym has quit [Ping timeout: 240 seconds]
<tfb>
phoe: thanks for finding that!
<phoe>
tfb: thank the person from hacker news that posted it there
ft has quit [Ping timeout: 260 seconds]
EvW has joined #lisp
datajerk has quit [Remote host closed the connection]
datajerk has joined #lisp
nkatte has quit [Ping timeout: 272 seconds]
scymtym has joined #lisp
EvW has quit [Ping timeout: 260 seconds]
nkatte has joined #lisp
tfb has quit [Remote host closed the connection]
tfb has joined #lisp
tfb has quit [Remote host closed the connection]
tfb has joined #lisp
<gendl>
phoe: i don't see any license on any of that LISP Machine code
tfb has quit [Remote host closed the connection]
tfb has joined #lisp
tfb has quit [Remote host closed the connection]
tfb has joined #lisp
jonatack has quit [Quit: jonatack]
tfb has quit [Remote host closed the connection]
<gendl>
Oh that's Joe Marshall! I miss him! (does he ever hang around in here?)
tfb has joined #lisp
tfb has quit [Remote host closed the connection]
tfb has joined #lisp
tfb has quit [Remote host closed the connection]
tfb has joined #lisp
tfb has quit [Remote host closed the connection]
tfb has joined #lisp
tfb has quit [Remote host closed the connection]
tfb has joined #lisp
ft has joined #lisp
tfb has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
<phoe>
gendl: neither see I
tfb has joined #lisp
Noventicx has quit [Remote host closed the connection]
<daphnis>
what's the purpose of #'(lambda ..? doesn't (lambda .. already return a function?
<phoe>
not directly
<phoe>
(lambda ...) is a macro that expands into #'(lambda ...)
Stanley00 has quit []
<phoe>
the non-#' form is preferable to use because some places in Lisp code do not accept the #' form
<jackdaniel>
could you elaborate about these places taht do not accept (function …) ?
<jackdaniel>
s/taht/that/
<phoe>
I recall restart-case off the top of my head
<daphnis>
what about the (lambda .. in #'(lambda ..? i take it that can't be the macro?
tfb has quit [Ping timeout: 272 seconds]
<phoe>
daphnis: it is not macroexpanded again because the FUNCTION special operator, here hidden behind the #' reader macro, treats LAMBDA expressions speially
<phoe>
when you write (function (lambda ...)) then the LAMBDA expression is not evaluated or macroexpanded
<daphnis>
to /that/ (lambda is a special form or something?
<phoe>
to /what/ exactly?
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
<phoe>
the symbol LAMBDA itself names a macro, but lambda expressions have special meaning in two contexts
<phoe>
first context, you can evaluate ((lambda (x) (* x x)) 3) where the lambda expression is the first element of that list
<phoe>
that's a valid function call in Lisp, the above returns 9
<daphnis>
oh, so the lamdba symbol is something that the function operator understands
<phoe>
yes - exactly
<daphnis>
thanks
<jackdaniel>
I think that these "cases" fall in the same category when you pass multiple-value-list instead of #'multiple-value-list to some macros
<phoe>
the second context, it is understood in its own unique way by the special operator FUNCTION and the function COERCE when you try to coerce a lambda expression to a function object
<jackdaniel>
(i.e not a good candidate as a "general rule for lambda")
frgo_ has joined #lisp
<phoe>
jackdaniel: my approach is that if you generally write (lambda ...) you get stung 0% of the time, whereas if you generally write #'(lambda ...) then you get stung >0% of the time
<jackdaniel>
if you treat (lambda …) as any other function, then you don't need to make mental exceptions
<phoe>
so if I want to focus on more important tasks than remebering which variant to use, then I can safely always write (lambda ...)
<phoe>
yes
<phoe>
hence, I don't do #'(lambda ...)
<jackdaniel>
you don't use #'list either?
* edgar-rft
does not #'listen
<phoe>
hey wait a second, the symbol list doesn't expand to #'list
frgo has quit [Ping timeout: 260 seconds]
<phoe>
so we're comparing apples and oranges here
<jackdaniel>
that's a mental exception
* phoe
shrug
<jackdaniel>
that the symbol list doesn't expand to something
<jackdaniel>
my point is that if you treat (lambda …) as any other function, then you put #' where you put #' before the symbol, and you're not putting it when you are not putting it before a symbol
<phoe>
I see
<phoe>
I think I understand this point of view now
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
Kundry_Wag has joined #lisp
Josh_2 has joined #lisp
Necktwi has quit [Ping timeout: 240 seconds]
iarebatman has joined #lisp
SirVolta has joined #lisp
bitmapper has quit [Quit: Connection closed for inactivity]
troydm has joined #lisp
Necktwi has joined #lisp
cosimone has joined #lisp
frost-lab has quit [Quit: Connection closed]
wsinatra has joined #lisp
heisig has joined #lisp
<iarebatman>
I'm about to pitch using common lisp to my boss. I plan to demo the whole code is data and data is code concept, with the emphasis on the fact that once you can manipulate lists - your knowledge is applicable in many situations (akin to how SQL has a 'standard way' of manipulating data sets).. I also plan to demo the magic of hot-swapping functions while an application is running because that always seems magical.. Does a
<iarebatman>
any other recommendations of features/demos that would appeal to a technically-savvy boss that I show off ?
<iarebatman>
s/show off/can show off/
aeth has quit [Ping timeout: 240 seconds]
<aorst>
error handling?
<jackdaniel>
remote code execution ;-)
<phoe>
debugger-oriented programming
aeth has joined #lisp
<phoe>
play with the REPL while the debugger is still up and while the error was still not handled
<phoe>
bonus points if you fix the error in the REPL while the debugger is still up and then you just hit that CONTINUE or RETRY restart and things work
<iarebatman>
I like that one. I'll add a step in my demo to 'break' the program while it's running before I hot-swap the function
<jackdaniel>
don't forget to declaim it notinline
<phoe>
^
FreeBirdLjj has joined #lisp
<beach>
iarebatman: I don't know your situation, but don't expect your efforts to pay off.
<phoe>
beach: come on, people are actually putting in effort to promote Lisp
<jackdaniel>
he is Batman, I'd be surprised if there were no results :)
<phoe>
I know you're pretty disenchanted when it comes to the industry and I kinda share the feeling, but IMO it doesn't make these lispy attempts futile or unworthy in general
<Josh_2>
iarebatman: good luck!
<beach>
iarebatman: Also, if it *does* work, you will have a huge responsibility to make sure Common Lisp is a success where you work.
<Josh_2>
well that could be good or bad ¯\_(ツ)_/¯
<beach>
phoe: I didn't say that. Just that there are strong forces against changes like that, so iarebatman should not be disappointed if it doesn't work.
<Josh_2>
if it doesn't work iarebatman can wait until he is the boss :P
FreeBirdLjj has quit [Remote host closed the connection]
<beach>
iarebatman: When I worked in industry (briefly), the way I did it was to show real results even before even mentioning the word "Lisp".
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #lisp
<iarebatman>
beach: Yeah no worries, I'm not expecting him to fall over himself to let me use lisp or anything.
<iarebatman>
We just went through a rather large and painful project where we used the wrong tool for the job - so I think I have an opening to at least have him hear me out though.
<Xach>
I had some success when I was able to prototype a working solution in the time allocated to simply do some research into options.
FreeBirdLjj has joined #lisp
<Xach>
The ability to do that varies a lot depending on the domain.
<beach>
iarebatman: Good luck. Like they say, it is easier to get forgiveness afterwards than permission beforehand.
<Xach>
If there is a library to do it already in npm or pip or something, it's a harder sell.
<iarebatman>
Yeah - there's a decent chance I'll be able to get some time for experimentation.
<beach>
iarebatman: The other advantage of not asking beforehand is that, since you never were refused permission, it is OK to actually use it, but if you ask and permission is refused, using it anyway would be to disobey.
<phoe>
^
ft has quit [Ping timeout: 246 seconds]
astronavt has quit [Remote host closed the connection]
astronavt has joined #lisp
EvW has quit [Ping timeout: 264 seconds]
astronavt has quit [Remote host closed the connection]
pankajsg has quit [Ping timeout: 240 seconds]
Lycurgus has joined #lisp
sdumi has quit [Read error: Connection reset by peer]
astronavt has joined #lisp
sdumi has joined #lisp
renzhi has joined #lisp
ft has joined #lisp
<iarebatman>
eh, I understand the concept - but that's not what I'm going to do. It's not my intention to put the company in a bad spot just because I want to do something. I like my job and am friends with my boss (have been for 10+ years) - so I won't try to go behind his back like that.
<iarebatman>
I've got a good pitch and a decent demo - hopefully that'll sell it enough for an experiment
kiroul has joined #lisp
<beach>
iarebatman: Sounds good. Again, good luck. Let us know how it goes.
<Josh_2>
^
<iarebatman>
will do
skapata has joined #lisp
<beach>
iarebatman: Can we assume that you know that Common Lisp is not an "interpreted language" and that automatic memory management is not slower than manual memory management. And of course that automatic memory management is a prerequisite for modularity?
<beach>
But maybe you are already using a language with automatic memory management?
<iarebatman>
beach: Thanks for checking. We're mainly a SQL Server and C# shop at the moment, so pitching that aspect wouldn't really come across as an 'improvement' if you know what I mean.
<beach>
Got it.
DGASAU has quit [Read error: Connection reset by peer]
<beach>
Then, instead, you might talk about the confusion between representation and encapsulation in languages like C#. With CLOS, encapsulation is handled an orthogonal mechanism called "packages", which makes the entire thing more flexible.
DGASAU has joined #lisp
<iarebatman>
A couple of questions that I would like to have ready answers for are: How hard is it to deploy and keep a CL app up-to-date on internal employee computers? As well as: How can we take advantage of the fact that we can hot-patch systems in production to reduce down-time during updates?
ljavorsk has quit [Ping timeout: 240 seconds]
DGASAU has quit [Read error: Connection reset by peer]
DGASAU has joined #lisp
<iarebatman>
To be honest, CLOS is something I need to obtain more experience with myself - so I can't talk about it with confidence yet. My demo consists of showing me bring in the same dataset with json, csv, xml, excel, and from a database - all to demonstrate they all are lists. Then at the end, I show that these lists of data can be evaluated as code as well. During that whole talk, I plan to go into detail how in c# I'd have to
<iarebatman>
several classes to represent the given data - I think that'll come across OK.
<phoe>
re employee computers: you can piggyback on top of Quicklisp and compile-and-load your applications from source on employee machines
<phoe>
if you create your own internal quicklisp dist, then people can do (ql:update-all-dists) to fetch the newest sources
<phoe>
or you can distribute ready executable binaries just like you would do for many other languages
toorevitimirp has quit [Remote host closed the connection]
toorevitimirp has joined #lisp
<iarebatman>
internal quicklisp is an interesting idea - hadn't thought of that
Lycurgus has quit [Quit: Exeunt]
<pve>
iarebatman: I also think CL for quick prototyping and exploring data and databases in the REPL is the way to go.
<phoe>
as for hotpatching, if you know which forms to send to your live images to evaluate then you send them and they're in the image, working - zero downtime in the happiest case, minimal downtime when you pause the application for the duration of patching
<phoe>
(and see the whole book for a description of how that is done in CL, hint hint)
<iarebatman>
lol, noted - thank you
rippa has joined #lisp
<pve>
iarebatman: it is probably an easier sell if you present CL as an interactive data exploration tool to be used alongside whatever else you're using, as opposed to saying "let's replace C# with CL"
amb007 has quit [Read error: Connection reset by peer]
ljavorsk has joined #lisp
amb007 has joined #lisp
<daphnis>
what's the best way to avoid having to confirm the redefinition of every single constant when reevaluating something in sbcl/slime?
ex_nihilo_ has quit [Ping timeout: 264 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
leo_song has quit [Ping timeout: 240 seconds]
<beach>
daphnis: You should not redefine constants.
<jackdaniel>
daphnis: if you want parameters, then replace all defconstant operators with defparameter
<jackdaniel>
then you won't have to confirm the redefinition
ljavorsk has quit [Ping timeout: 240 seconds]
<daphnis>
well, the values don't normally need to change, but it's impossible to reevaluate the buffer without reevaluating the defconstants too. but i've just been assuming that values that normally don't change should be defined as constants, maybe that's wrong.
<beach>
daphnis: DEFCONSTANT is practical only for object that can be compared with EQL.
davisr has quit [Ping timeout: 272 seconds]
<jackdaniel>
daphnis: constants may be inlined in functions, that's why redefining them may /not/ achieve what you want
<jackdaniel>
what you could do is to unintern symbols first
<beach>
daphnis: If you use DEFCONSTANT with (say) the value of (LIST...) then the value will be different each time you evaluate the DEFCONSTANT form, so it is not really constant.
<jackdaniel>
and then you could recompile the buffer (new symbols will be introduced)
ex_nihilo has joined #lisp
<daphnis>
thanks. i'll just use defparameter then until the need for defconstant becomes apparent.
toorevitimirp has quit [Read error: Connection reset by peer]
sjl has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
<phoe>
beach: ALEXANDRIA:DEFINE-CONSTANT fixes this
<phoe>
you can (alexandria:define-constant +foo+ "bar" :test #'string=) multiple times and it won't trigger warnings or errors
<jackdaniel>
phoe: the reason why defconstant does not allow reevaluating constants that are not eql is to preserve identity between fasls and the image
<Bike>
the concept of define-constant in my view is for when you want to define a constant but don't care about identity, just some looser measure
<Bike>
and it does that fine
<phoe>
jackdaniel: yes, and A:DEFINE-CONSTANT does not try to work around this; it simply makes it possible to compile-and-load a file multiple times without invoking UB and/or redefinition errors
<phoe>
so, pure convenience
dnaeon has joined #lisp
Nilby has joined #lisp
ex_nihilo has quit [Ping timeout: 240 seconds]
bitmapper has joined #lisp
nkatte has quit [Ping timeout: 240 seconds]
lotuseater has joined #lisp
nkatte has joined #lisp
hnOsmium0001 has joined #lisp
nkatte has quit [Read error: Connection reset by peer]
__jrjsmrtn__ has joined #lisp
_jrjsmrtn has quit [Ping timeout: 265 seconds]
Codaraxis has joined #lisp
Codaraxis_ has quit [Ping timeout: 244 seconds]
Codaraxis_ has joined #lisp
Codaraxis has quit [Ping timeout: 265 seconds]
ex_nihilo has joined #lisp
Steeve has joined #lisp
aorst has quit [Quit: aorst]
andreyorst has joined #lisp
cosimone has quit [Quit: cosimone]
imode has joined #lisp
EvW has joined #lisp
<lotuseater>
Hi there :) Has anyone of you already read the new book "Programming Algorithms" written by Vsevolod Domkin? I ordered it from him directly last week but it takes a few weeks to be shipped to Germany.
h4ck3r9696 has joined #lisp
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 246 seconds]
X-Scale` is now known as X-Scale
yonkunas has joined #lisp
heisig has quit [Quit: Leaving]
<beach>
lotuseater: I read a draft of it, but not the final version.
<beach>
lotuseater: Why do you ask?
<lotuseater>
Just to hear opinions. :) Could be a good completion to the content of the ~15 other main CL books.
aartaka has joined #lisp
<beach>
Sure.
<beach>
I had several problems with the draft, but I think those were addressed before it got published.
<Josh_2>
lotuseater: I own a physical copy but I have not read it
<Josh_2>
I have skimmed various sections
miasuji has joined #lisp
<lotuseater>
okay, I would read and work with it over the holidays, so can give my opinion to you
<beach>
Sounds good.
<lotuseater>
It's good CL has few books but also the most are very good.
<Josh_2>
Well Imo It's more of a pick up when you need it kind of book
<Josh_2>
because It's a book on algorithms
ex_nihilo has quit [Read error: Connection reset by peer]
<lotuseater>
yes and that fills a niche
<mfiano>
I skimmed the first version, before it was picked up by Apress and was available for free, and I thought that it was very lacking and full of misinformation in regard to the actual algorithms discussed. But, maybe that has changed.
<lotuseater>
At Apress it will be available in April 2021, am I right?
<lotuseater>
Okay I'll see. Not my first book on CL or Algos :)
<Josh_2>
Apress are pretty good us
Fade has quit [Remote host closed the connection]
<Josh_2>
picking up all the Lisp books
<edgar-rft>
lotuseater: same here, book orderd but "please wait..."
<lotuseater>
Yes in October there came "CL Condition System", also some aspect which is needed to known more.
<lotuseater>
edgar-rft I have the root follow for it, but still in Ukraine
<mfiano>
phoe did an excellent service to the community with that book. The condition system is incredibly powerful, and far under-used, probably due to the lack of good resources on the topic. I'm glad the book is giving it some deserved recognition.
<lotuseater>
All other I just have in PDF.
<edgar-rft>
lotuseater: I do net even get a date *when* it will be available, to me it smells as if they first want enough orders before even start printing
<lotuseater>
But I ordered an already printed book from Mr Domkin himself.
<Josh_2>
mfiano++
<edgar-rft>
ah, I did it the wrong way :-) I ordered via my faourite book store
<lotuseater>
mfiano you're right. just looking at the special operator unwind-protect, awesome
<lotuseater>
edgar-rft I would order all other via zvab.com or so, but so much money ...
Cymew has quit [Ping timeout: 240 seconds]
andreyorst has quit [Quit: andreyorst]
andreyorst has joined #lisp
demindiro has quit [Remote host closed the connection]
dreamcompiler has joined #lisp
davisr has joined #lisp
astronavt has quit [Quit: ...]
astronavt has joined #lisp
dnaeon has quit [Ping timeout: 260 seconds]
dnaeon has joined #lisp
narimiran has quit [Ping timeout: 256 seconds]
ex_nihilo has joined #lisp
narimiran has joined #lisp
dnaeon has quit [Ping timeout: 264 seconds]
pankajsg has joined #lisp
andreyorst has quit [Quit: andreyorst]
andreyorst has joined #lisp
sdumi has quit [Ping timeout: 265 seconds]
sdumi has joined #lisp
kaftejiman_ has quit [Ping timeout: 264 seconds]
kaftejiman_ has joined #lisp
dnaeon has joined #lisp
kaftejiman_ has quit [Ping timeout: 260 seconds]
cosimone has joined #lisp
notzmv has quit [Read error: No route to host]
notzmv has joined #lisp
luckless_ has joined #lisp
h4ck3r9696 has quit [Remote host closed the connection]
h4ck3r9696 has joined #lisp
_paul0 has quit [Remote host closed the connection]
luckless has quit [Ping timeout: 240 seconds]
paul0 has joined #lisp
liberliver has quit [Ping timeout: 256 seconds]
dnaeon has quit [Ping timeout: 240 seconds]
dnaeon has joined #lisp
dnaeon has quit [Ping timeout: 272 seconds]
karlosz has joined #lisp
karlosz has quit [Remote host closed the connection]
karlosz has joined #lisp
dnaeon has joined #lisp
lotuseater has quit [Remote host closed the connection]
daphnis has quit [Ping timeout: 265 seconds]
EvW has quit [Ping timeout: 240 seconds]
dnaeon has quit [Ping timeout: 256 seconds]
h4ck3r9696 has quit [Ping timeout: 260 seconds]
<iarebatman>
Sorry for the delay - the pitch went pretty well. I have a tentative OK to go ahead and explore using CL where I see fit. His one concern was that he didn't want us to end up with 18 technology stacks, so he said if we go this route that I better not want to change languages again 6 months later.
dnaeon has joined #lisp
<shka_>
iarebatman: you should said "CL for life baby"
quazimodo has quit [Ping timeout: 260 seconds]
<phoe>
edgar-rft: you mean progalgs on Apress?
<phoe>
it is still in the process of being done - there is no concrete release date yet
Lord_of_Life has quit [Ping timeout: 240 seconds]
<phoe>
apress cannot commit to a release date before the text of the book is finalized - and I have to admit and apologize, I am still doing the last bits of technical review upon it
quazimodo has joined #lisp
<phoe>
so, in this concrete case, please feel free to blame me for the delay
Lord_of_Life has joined #lisp
Lord_of_Life has joined #lisp
dnaeon has quit [Ping timeout: 240 seconds]
Steeve has quit [Quit: end]
aartaka has quit [Ping timeout: 240 seconds]
galex-713 has quit [Ping timeout: 272 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
daphnis has joined #lisp
galex-713 has joined #lisp
dnaeon has joined #lisp
<edgar-rft>
phoe: yes, but I'm not in hurry. There are some folks running a book store here who are nearly broke, I want them to make some money.
<phoe>
yes, I see
<edgar-rft>
I'll just give them the money now and the bokk will come when it's finished.
dnaeon has quit [Ping timeout: 246 seconds]
bocaneri has quit [Remote host closed the connection]
EvW has joined #lisp
aorst has joined #lisp
dnaeon has joined #lisp
miasuji has quit [Remote host closed the connection]
andreyorst has quit [Ping timeout: 256 seconds]
dnaeon has quit [Ping timeout: 272 seconds]
ABQ has joined #lisp
<ABQ>
HI
kaftejiman has joined #lisp
ABQ is now known as YourNick
devon has joined #lisp
<YourNick>
HI
dbotton has joined #lisp
daphnis has quit [Ping timeout: 256 seconds]
<YourNick>
Invalid password for katsmeow
dnaeon has joined #lisp
<YourNick>
I AM GETTING THE ABOVE INFORMATION WHEN I TRY TO IDENTIFY IN NICKSERV
<no-defun-allowed>
YOUR TELETYPE IS BROKEN. GET A NEW ONE.
<YourNick>
HOW AM I ABLE TO TYPE "HELLO" THEN
<no-defun-allowed>
IT'S JUST NOT THAT BROKEN, ALSO #FREENODE MIGHT BE MORE HELPFUL IN THIS SITUATION
<Nilby>
stty -olcuc
dnaeon has quit [Ping timeout: 240 seconds]
<YourNick>
OH THANKS
dbotton has quit [Quit: This computer has gone to sleep]
YourNick has quit [Remote host closed the connection]
kaftejiman has quit [Remote host closed the connection]
dnaeon has joined #lisp
lotuseater has joined #lisp
mokulus has quit [Read error: Connection reset by peer]
mokulus has joined #lisp
dnaeon has quit [Ping timeout: 260 seconds]
dbotton has joined #lisp
dbotton has quit [Client Quit]
dbotton has joined #lisp
judson_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
EvW has quit [Ping timeout: 260 seconds]
dnaeon has joined #lisp
dnaeon has quit [Client Quit]
aartaka has joined #lisp
aartaka_d has joined #lisp
aartaka has quit [Ping timeout: 240 seconds]
jw4 has quit [Read error: Connection reset by peer]
* phoe
stares
<phoe>
oh well
jw4 has joined #lisp
random-nick has joined #lisp
paulj has joined #lisp
paulj has quit [Client Quit]
judson_ has joined #lisp
nckx is now known as jorts
daphnis has joined #lisp
jorts is now known as nckx
shka_ has quit [Ping timeout: 260 seconds]
dbotton has quit [Quit: This computer has gone to sleep]
pfdietz has joined #lisp
scymtym has quit [Ping timeout: 264 seconds]
dbotton has joined #lisp
bilegeek has joined #lisp
dbotton has quit [Client Quit]
Lycurgus has joined #lisp
sdumi has quit [Remote host closed the connection]
sdumi has joined #lisp
aartaka has joined #lisp
aartaka_d has quit [Ping timeout: 264 seconds]
<jasom>
Just because it's been a while since I used defclass in anger; init-forms cannot depend on initializer arguments directly, correct? So the only way to get fancy with initializing some slots based upon parameters from other slots is an :around method for one of the initialization generic functions, right?
Lycurgus has quit [Quit: Exeunt]
EvW has joined #lisp
Iolo has joined #lisp
<no-defun-allowed>
Usually you see :after methods for initialize-instance, but yes.
<jasom>
I try to stick to :around rather than :after, but yes same idea
dbotton has joined #lisp
narimiran has quit [Ping timeout: 264 seconds]
<no-defun-allowed>
Most code I've read does the opposite. Do you find yourself replacing initargs frequently?
<jasom>
no-defun-allowed: it's one of the main reason I might use defclass rather than defstruct
<coyo>
(defun fun () "Define fun." (slime))
<lotuseater>
jasom could you give a simple example so I can fully understand your question? but sounds interesting
<lotuseater>
I use defstruct the most if no inheritance (or just simple) is needed, makes objects and everything lightweight
scymtym has joined #lisp
Fade has joined #lisp
<no-defun-allowed>
Well, you can always (defmethod initialize-instance ((object <class-name>) &key some-initarg) ...) to get at the initarg, or use the relevant accessor as the primary method for initialize-instance puts initargs and initforms in their slots.
<jasom>
no-defun-allowed: right, that's what I am doing. Just wanted to make sure there wasn't a better way
<jasom>
It would be less code and more declarative if I could specify initialization forms as functions of initialization arguments inside the defclass itself.
wsinatra has quit [Ping timeout: 240 seconds]
<lotuseater>
so wouldn't it be possible to do this with another defclass macro?
ex_nihilo has quit [Ping timeout: 256 seconds]
miasuji has joined #lisp
wsinatra has joined #lisp
<jasom>
it would, but it's not yet painful enough for me to write one
<Bike>
if a parameter used by an initform wasn't provided, would you expect an unbound variable error, or for it to default to nil?
shifty has joined #lisp
<jmercouris>
I would expect an unbound variable error
<jmercouris>
I would prefer it to default to nil
<Bike>
also, would the variable name be the slot name, or could use use an initarg
<jasom>
Bike: I would expect it to be like an initarg, and if I needed it to always be bound, I could use :default-initarg
<Bike>
i don't know what "like an initarg" means. if an initarg isn't provided, a slot's value is unbound, but it doesn't signal an error. what does that mean for a variable?
<Bike>
(well, if an initarg is not provided and there's no initform and etc)
<jmercouris>
that means it doesn't matter if it is unbound
<jasom>
If the initarg isn't provided then the variable is unbound
<jasom>
unless of course there is a default-initarg
<jmercouris>
it could also be bound during initialize-instance
<jmercouris>
think about computed values
<Bike>
what would the slot initfunction be? would it take parameters or would it somehow be a closure? or would there just be no initfunction?
<Bike>
i'm not asking these as gotchas or anything. people talk about wanting this a fair bit and i'm wondering how the machinery could be set up.
<jmercouris>
I actually am not really sure what you are getting at really
<jmercouris>
what are you trying to design? features for clasp?
<Bike>
i'm just wondering how this could be implemented
<Bike>
these are the kinds of questions i'd have to ask to do so
cosimone has quit [Quit: cosimone]
igemnace has quit [Remote host closed the connection]
wsinatra has quit [Ping timeout: 240 seconds]
<jmercouris>
Bike: what is a slot initfunction? a function that initializes the value of a slot?
wsinatra has joined #lisp
<Bike>
when CLOS gets a slot with an initform, it saves the form, but also saves an initfunction, which is just (lambda () ...form...)
<Bike>
and when it needs to initialize a slot, it calls that function
<Bike>
(rather than e.g. eval-ing the initform itself)
<jmercouris>
why?
<Bike>
it's faster, and also it allows (let (...) (defclass ...)) to work like you'd expect it to
<jmercouris>
what I always have done in the past is provide an initform that is a lambda, should I have been providing initfunctions?
<jmercouris>
or is it internal to CLOS and I should not really be messing with it?
<Bike>
well, it's part of MOP, but you don't really provide initfunctions directly, no. I'm not sure what you mean by providing an initform that's a function. that just means the slot is bound to a function, not that the function is called to produce the slot's initial value.
<jmercouris>
oh OK
<jmercouris>
I see now
<jmercouris>
I meant something like ':initform (some-function-call)'
<jmercouris>
or a funcall'd lambda for some other details
<Bike>
oh, i see. in that case i guess :initfunction #'some-function-call would hypothetically make sense
<jmercouris>
perhaps it is sacrilege...
<Bike>
(except i don't think it would evaluate correctly? i don't know)
<_death>
the defmodel macro in cells defines accessors with the instance name "self" and ^reader macros that expand to (reader self) and can be used in initforms.. but I don't think something like this is necessary
<phoe>
:initform is used to construct an initfunction, internally
<Bike>
i don't understand what you are reacting to
<Bike>
is that not what i said?
<jmercouris>
I don't get it either
<jmercouris>
I believe that is what mr Bicycle said
<phoe>
oh, yes
<jmercouris>
there is something about the name "Mr Bicycle" that just makes me smile, it is funny :-)
<phoe>
I got confused with :initfunction #'some-function-call
<jmercouris>
I imagine a friendly guy on some bicycle or so
<White_Flame>
I imagine some bikeshedding goes on here
<mfiano>
Reminds me of his alt nick I haven't seen in a while (maybe even some years)
<phoe>
Bicyclidine?
<mfiano>
Yeah
<lotuseater>
or imagine a picture with lisp alien riding a lambda bike
<Bike>
Bicyclidine: Technically Legal To Ingest™
<phoe>
whenever I remember that nickname I get reminded that he's working with drmeister, and that's the kind of drug that he synthesizes with cando in order to produce chemical lisp bikes for proteins to ride on
<lotuseater>
yeah and the simulation very impressive
lotuseater has quit [Remote host closed the connection]
<jasom>
Bike: right not an around intiialize-instance that bound the initargs to a special would probably be sufficient for my needs, then I could getf or destructuring bind to get the arguments I want
sjl has quit [Ping timeout: 240 seconds]
<jasom>
Ultimately the intializer maps a set of arguments to an initialized class
lotuseater has joined #lisp
<Bike>
the way you can have multiple initargs for the same slot makes destructuring-bind difficult
<jasom>
getf then
<Bike>
yeah
paul0 has quit [Ping timeout: 272 seconds]
kaftejiman has joined #lisp
<lotuseater>
I hope some day I will understand how clasp and cando or the qvm by rigetti really work. but there is so much more great stuff out in the wilds or waits to be crafted
paul0 has joined #lisp
<Xach>
qvm isn't too hard to follow. quilc is the tricky one.
<lotuseater>
oh okay good to know :) or the math which is needed for quantum computing :D
paul0 has quit [Ping timeout: 260 seconds]
leo_song has joined #lisp
pve has quit [Quit: leaving]
<Bike>
clasp is just a lisp implementation, so the hard to understand things are just normal stuff like CLOS initialization
<Bike>
all the chemistry is in cando
dbotton has quit [Ping timeout: 260 seconds]
<lotuseater>
Bike yes I know that :) like SICL by Robert Strandh
<lotuseater>
but those are the kinds of stuff I tell about if blub people ask me what you can even do with those s-expressions
<lotuseater>
oh there's also a lot of mathematica code in cando
dbotton has joined #lisp
<jmercouris>
MATHEMATICA? is that really performant enough?
<jmercouris>
my experience with mathematica was quite slow... maybe it was the hardware I was on
dbotton has quit [Client Quit]
dbotton has joined #lisp
<jasom>
jmercouris: but of course mathematica has a lot baked in, like the famous goat code-golf
<lotuseater>
once upon a time (a few years ago before I got fully into lisp and haskell) i thought the symbolic math is so powerful. but now i see it kind of low
<lotuseater>
jmercouris the cando github repo says so
<jasom>
lotuseater: can't always trust github statistics, they are file-extension based IIRC
<lotuseater>
okay, i look on that statistic to get a feeling
dbotton has quit [Client Quit]
<jasom>
I don't know what the mathematica extension is, but if it's e.g. ".m" then one might get a lot of falsely identified mathematica files.
<lotuseater>
hehe
<lotuseater>
but the continuity and the system as a hole is great
<lotuseater>
i mean mathematica compared with e.g. maxima