<phoe>
I have a class with :DEFAULT-INITARGS. I manually call ALLOCATE-INSTANCE and then INITIALIZE-INSTANCE. Can I expect :DEFAULT-INITARGS to be supplied somewhere by the system or do I need to somehow do this manually?
<beach>
No, but it was a bit surprising that you referred to a function that phoe is not calling.
<jackdaniel>
[if] make-instance is responsible for providing default initargs to initialize-instance [then] if you are not calling make-instance then you must supply them manually; I thought that this implication is obvious
<doomduck>
is there something like clojure's "comment out next s-exp" reader macro where if I have say (foo (bar) (baz)) I could do (foo #_(bar) (baz)) and comment out the (bar) call this way?
razetime has joined #commonlisp
<aeth>
#+(or) (bar)
<doomduck>
the point being not having to add a newline to comment out an s-exp with
<aeth>
(or) is always NIL and (and) is always T so you can just use #+(or) and #+(and) in the same way you'd use #+sbcl or #+linux to optionally read something (or #- to not) based on *FEATURES*
<aeth>
This means that you can also use #-(and) but that's not the convention.
<aeth>
#+nil is sometimes used but that will check *FEATURES* for NIL so that's not a good idea.
<doomduck>
ohhh I was trying just #+ and was confused, but the #+(or) is the whole "thing", I get it now :D
<jackdaniel>
some people define a reader macro #; to do just that
<doomduck>
makes sense, I think I'll do that, I mostly just want this for quickly trying out things, so making it shorter would be nice
<doomduck>
thanks!
<doomduck>
still getting used to the idea of having reader macros
xlarsx has joined #commonlisp
cosimone has joined #commonlisp
xlarsx has quit [Ping timeout: 265 seconds]
aartaka has quit [Ping timeout: 244 seconds]
aartaka has joined #commonlisp
<Shinmera>
I'm lazy and typically just use #++ on the grounds that nobody in their right mind would push + to *features*
<Shinmera>
And I find it easier to parse than #+(or)
* jackdaniel
is always amazed by lengths people will go to to avoid semantical correctness
<Shinmera>
in this case the length is 3
<hayley>
#+#:make-my-day
<verisimilitude>
If I ever write an implementation of Common Lisp, I'll be putting NIL in *FEATURES* for this reason.
<jackdaniel>
and the successor should have + to signify, that it is an improved version
aartaka has quit [Read error: Connection reset by peer]
aartaka has joined #commonlisp
random-nick has joined #commonlisp
Dynom_ has joined #commonlisp
Dynom_ is now known as Guest5501
dilated_dinosaur has joined #commonlisp
causal has quit [Quit: WeeChat 3.6]
tyson2 has joined #commonlisp
<doomduck>
maybe a dumb question, but say that I have a function that takes a few other functions to fill a general algorithm, and I'm not sure if it makes more sense to define it as a macro and quote/unquote, or do the whole #'f #'g #'h and then funcall f all over the place? feels like a macro makes this a lot cleaner cuz there's no annoying funcall over the place, but it doesn't really _have to_ be a
<doomduck>
macro
<jackdaniel>
if the only reason to make a macro is not wanting to use funcall then don't make it a macro
<doomduck>
ah okay, thanks
waleee has joined #commonlisp
<phoe>
the main argument against it being a macro is that you lose function composition
<phoe>
you cannot (defmacro foo ...) and then #'foo
<_death>
if it takes several functions, you may consider using CLOS instead.. have it take an instance and pass that to generic functions to do the work (unless it calls one many times, in which case a more clever design may be worthwhile)
<jackdaniel>
that's not much of a problem when you define these in pairs, i.e foo and invoke-foo (where the latter implements the behavior, while the former does the syntax gimmics); it is just that treating (foo x y z) arguments as function names is not obvious from the syntax
<jackdaniel>
(and if there is no good justification for a macro, it just makes the program harder to read - that's my rationale at least for discouraging the use of a macro)
aartaka has quit [Ping timeout: 265 seconds]
aartaka has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
cage has joined #commonlisp
simendsjo has quit [Ping timeout: 264 seconds]
pranavats has joined #commonlisp
xlarsx has quit [Remote host closed the connection]
xlarsx has joined #commonlisp
karlosz has joined #commonlisp
dra has joined #commonlisp
McParen has joined #commonlisp
jmdaemon has quit [Ping timeout: 265 seconds]
lisp123 has joined #commonlisp
jeffrey has joined #commonlisp
karlosz has quit [Quit: karlosz]
xlarsx has quit [Remote host closed the connection]
xlarsx has joined #commonlisp
<lisp123>
how to quit sbcl
xlarsx has quit [Ping timeout: 260 seconds]
<lisp123>
whats the package name of (quit)?
<beach>
Try (apropos "quit")
<lisp123>
beach: Thanks!
<lisp123>
(sb-ext:quit) did it
<lisp123>
ehh bknr is not good for concurrent access...might revert to postmodern
aartaka has quit [Ping timeout: 252 seconds]
aartaka has joined #commonlisp
dra has quit [Quit: Leaving]
<pkal>
lisp123: Doesn't Ctrl-D in a terminal or ,quit in Slime do the job?
<lisp123>
pkal: Ctrl-D does
xlarsx has joined #commonlisp
<pkal>
It usually does, I prefer that to remembering various "exit", "quit", ... commands for different programms.
<lisp123>
pkal: Yeah makes sense. I don't use terminal much so hadn't got used to that
xlarsx has quit [Ping timeout: 246 seconds]
Devon has joined #commonlisp
munesh has quit [Ping timeout: 252 seconds]
Devon has quit [Ping timeout: 246 seconds]
son0p has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
<doomduck>
looking at sbcl not supporting mobile, is lispworks the only way if you want to say make an ios/android game?
<doomduck>
or is even that a bit of a stretch?
<beach>
Check with jackdaniel to see whether ECL works.
<doomduck>
oh interesting I forgot about ECL, the website does say android/iOS hmm
<pkal>
Doesn't ABCL have android support?
<phoe>
no, the JVMs are too different afaik
shka has quit [Quit: Konversation terminated!]
shka has joined #commonlisp
<jackdaniel>
doomduck: ecl works on both android and ios
<jackdaniel>
if you want fancy gui integration via qt, you may check out the eql5 project
<jackdaniel>
perhaps you've defined a function in a different package?
<jackdaniel>
and try to call it in the repl
<jackdaniel>
you may change the package with (in-package my-package)
<philipp_>
Yes, that was it. Of course, in the tutorial they define the package ":cffi-user".
<philipp_>
Thanks!
<jackdaniel>
sure
Inline has joined #commonlisp
<doomduck>
jackdaniel: oh wow wasm would be amazing, I guess that'll be the first way to get "CL in the browser" right?
<doomduck>
tho I just make games, so I guess cl-sdl2 should in theory work with ECS on ios/android?
<doomduck>
or cl-raylib I guess, I've been playing with that recently
<jackdaniel>
sure, it should, cffi works fine there
<jackdaniel>
there was a person who was first to run some other cl in browser (the one entirely written in c, not clisp though)
igemnace has quit [Remote host closed the connection]
<doomduck>
hmm, this sounds better than I had thought it would ... idk why I had this notion that CL is "mainly linux and everything else sucks"
<jackdaniel>
and yes, I've run ecl in browser already and it worked fine
<doomduck>
are there any downsides/limitations in ecl compared to sbcl? I've only used sbcl so far --- I guess I should google a bunch about this :>
<doomduck>
I remember iOS having restrictions about "interpreted" languages and/or anything that would allow runtime script running/mods, tho that may be ancient history since people run javascript apps on ios hmm
philipp_ has quit [Quit: Leaving]
<doomduck>
(fwiw I rembember that from like 10 years ago, so might be totally false)
<jackdaniel>
gf dispatch is slow (in comparison) - will be fixed soon; slow compilation (nothing we can address atm), no type inferencer (working on it), sbcl produces better code usually (partially implied by gf dispatch and type inference, but not only)
<doomduck>
being new to CL I'm still struggling to understand how there's this amazing ability to just connect to a running thingy and do things to it remotely and keep compiling code ...
<doomduck>
ah okay thanks! I guess none of those are dealbreakers
<tyson2>
doomduck: there are still some restrictions in place I believe
<jackdaniel>
ecl has two compilers - to native binary via a c compiler and to its own bytecode vm
<tyson2>
Meta discovered that Apple's restrictions can bite
<doomduck>
maybe a stupid question, but since ecl compiles to C does it still include a compiler in a way that lets you hot-reload in the resulting binary?
<jackdaniel>
ecl can work without native compilation on ios - performance critical parts may ve precompiled beforehand (and should be if it is an app)
<jackdaniel>
yes, ecl fasl files are shared objects loaded with dlopen
<doomduck>
omg, why isn't everyone using this? :D
<jackdaniel>
but c compilwr is not part of ecl, so to compile to native you need the c compiler (or use bytecodes one)
<jackdaniel>
as I said, it produces slower code than sbcl; there is also no save-lisp-and-die
<jackdaniel>
but yeah, ecl is cool ;)
<doomduck>
hmm, I'll definitely have to play around with this a bunch
<jackdaniel>
(I'm one of its maintainers, so this is a biased opinion)
<doomduck>
haha, maybe one more question - being new in the CL universe with no ties to anything "from the past", is there any reason I should be looking at lispworks?
<beach>
It seems their IDE is the best there is.
<doomduck>
coming from newer languages it's a strange idea for me to pay for a compiler :<
<phoe>
its paid version has nice perks, such as CAPI and what beach said, the IDE
<jackdaniel>
sure, they provide excellent implementation with support, ide and good libraries
aartaka has quit [Ping timeout: 248 seconds]
<doomduck>
hmmmmmm
<jackdaniel>
well, things are either properly funded or are driven by unpaid labor; nothing wrong with love but money can buy stuff (like dood!)
<jackdaniel>
food*
aartaka has joined #commonlisp
<jackdaniel>
also you buy from them whole environment, not only the compiler - and support
_cymew_ has joined #commonlisp
<jackdaniel>
either way in cl world you have plentu of floss choices too
aartaka has quit [Read error: Connection reset by peer]
<doomduck>
it's just so strange looking at all the webshit (I have some frontend background) where everyone and their mom makes a new shiny library ... now I come into CL land where there's multiple compilers, each doing their own thing, and even paid options ... I'm so so so confused, but in a good way
<_death>
the other day I wrote https://adeht.org/clog/ .. if there's interest I suppose both the model and UI can be fleshed out
aartaka has joined #commonlisp
<phoe>
woah, that is clog in action! nice
<_death>
it could turn into an influence diagram or a value network, I suppose..
aartaka has quit [Read error: Connection reset by peer]
<tyson2>
Clog is on my list of things to learn.
chipxxx has quit [Ping timeout: 268 seconds]
tyson2 has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 246 seconds]
McParen has left #commonlisp [#commonlisp]
<jcowan>
doomduck: In terms of multiple implementations, CL is peanuts. Scheme (another Lisp variety) has over 80, not counting historic implementations that only run on dead hardware (or its emulations)
xlarsx has joined #commonlisp
Inline has quit [Quit: Leaving]
thuna`` has joined #commonlisp
thuna`` has quit [Read error: Connection reset by peer]
thuna`` has joined #commonlisp
tyson2 has joined #commonlisp
igemnace has joined #commonlisp
thuna`` has quit [Read error: Connection reset by peer]
thuna`` has joined #commonlisp
thuna`` has quit [Client Quit]
aartaka has joined #commonlisp
ay is now known as Andrew
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
sabra has joined #commonlisp
atgreen has joined #commonlisp
Colere has joined #commonlisp
Haematophage has quit [Ping timeout: 265 seconds]
Furor has joined #commonlisp
Colere has quit [Ping timeout: 250 seconds]
makomo has quit [Ping timeout: 246 seconds]
Devon has quit [Ping timeout: 246 seconds]
makomo has joined #commonlisp
Oladon has joined #commonlisp
razetime has quit [Ping timeout: 268 seconds]
xlarsx has quit [Remote host closed the connection]
xlarsx has joined #commonlisp
xlarsx has quit [Ping timeout: 265 seconds]
tyson2 has quit [Remote host closed the connection]
xlarsx has joined #commonlisp
Devon has joined #commonlisp
akoana has joined #commonlisp
<Josh_2>
Physical copy of GISC came today :sunglasses:
<_death>
minion: what does GISC stand for?
<minion>
Gunflint Iambically Speckfall Carucated
<Josh_2>
Gentle introduction to symbolic computation
<Josh_2>
thought i'd get a physical copy
<Josh_2>
It was my first grammin' book that I worked through start to finish
<_death>
cool
cosimone has joined #commonlisp
verisimilitude has joined #commonlisp
son0p has quit [Ping timeout: 268 seconds]
son0p has joined #commonlisp
karlosz has joined #commonlisp
aartaka has quit [Ping timeout: 265 seconds]
igemnace has quit [Remote host closed the connection]
aartaka has joined #commonlisp
ahc has quit [Ping timeout: 252 seconds]
xlarsx has quit [Remote host closed the connection]
<phoe>
the right way is to ask the maintainer to export it
<phoe>
the quick way is to cl-raylib::+flag-msaa-4x-hint+
<doomduck>
oh awesome thanks! they have a TODO on this whole section, so I assume it's probably something they want changed
<phoe>
basically, in Lisp, using the foo:bar syntax means "can I please use this symbol?" whereas using foo::bar means more or less "*reloads gun* I aren't asking this time"
<phoe>
at which point lisp is nice enough to give you the symbol, but yeah at this point it's just your responsibility to use it without breaking stuff
pjb has joined #commonlisp
<verisimilitude>
Note, doomduck, that the :: syntax works even if the symbol be exported, so changing it if the symbol becomes exported isn't necessary.
akoana has quit [Quit: leaving]
Devon has joined #commonlisp
random-nick has quit [Ping timeout: 252 seconds]
<kakuhen>
It's still good practice to change it once the symbol's exported, in my opinion
<kakuhen>
no harm in always referencing a symbol SYM in a package PKG as PKG::SYM, but the reader will have no immediate answer on whether PKG::SYM is exported or not -- my argument is mostly for the reader's convenience
<phoe>
lisp is a language for nice people and nice people generally ask for access, hence using single colon is preferable
* phoe
coughs, runs off to sleep
<Shinmera>
Note that X::Y will **intern** Y in X, even if it does not exist.
pve has quit [Quit: leaving]
<doomduck>
phoe: I thought lisp was a language for people who don't ask for anything and just take what they want because they can literally patch anything in anything :D
<verisimilitude>
Say, ever heard of Erik Naggum, doomduck?
<verisimilitude>
I recommend his writings on Common Lisp.
<doomduck>
oh I haven't, I'll check it out
<verisimilitude>
I'll fetch an archive to make it easier.
<verisimilitude>
Oh, one note, he died a little over a decade ago.
<doomduck>
just reading the wiki page, damn, so sad :<
<verisimilitude>
I know the Quicklisp maintainer has an archive, but I forget the URL.
<aeth>
Ime, nobody exports their classes. Maybe because they're afraid of someone doing (make-instance 'foo) when that's not the proper way to make it, but it also stops you from doing (check-type x foo)
<aeth>
This is essentially the only time I use :: the "right" way, outside of my own unit tests or when I'm doing something I probably shouldn't do (messing with the internals of something).
SAL9000 has quit [Ping timeout: 260 seconds]
<aeth>
i.e. (check-type x your-package::foo)
<phoe>
I kinda pointed this out a few times - if a function returns some sort of type then I should be able to TYPEP it
<aeth>
yeah, it's not just check-type, it's also declare, typep, typecase, etc.
<phoe>
and if you are really paranoid about people making instances the wrong way, there's ways to guard againt that too
<aeth>
the lispy way is to use some arcane incantation of the MOP that nobody really understands, but that seems to work
<phoe>
ah yes the old holy scriptures
<verisimilitude>
Yes, Lisp doesn't really support encapsulation or whatever one wishes to call it.
pjb has quit [Read error: Connection reset by peer]
jmdaemon has joined #commonlisp
xlarsx has quit [Read error: Connection reset by peer]
<aeth>
it does, just only for lexical closures
<kakuhen>
well, being able to access internal symbols easily is convenient when you're dealing with a library and wanting to use some utility function it has but marked private, or maybe extend a function in the library and unfortunately it invokes private functions
<kakuhen>
I've ran into issues like this when writing Clojure. There is a clever workaround to it, but it's much more gross than just :: in CL
<aeth>
(let ((x 42)) (defun x () x) (defun (setf x) (value) (setf x value))) ; the variable X is actually encapsulated by the functions X and (SETF X)
<verisimilitude>
Even then, the debugger can allow a user to play with it in invalid ways.
<aeth>
verisimilitude: The debugger may or may not actually expose x. All lexical variables are only expected to show up when (optimize (debug 3)) and otherwise could be eliminated. In this toy example, it's unlikely, but who knows? As long as the getter/setter accessors still work as expected.
<verisimilitude>
I've used Ada for several years now, and it's so much better than Common Lisp in this and other ways.
<jcowan>
"Data and procedures and the values they amass / Higher-order functions to combine and mix and match / Objects with their local state, the messages they pass / A property, a package, a control point for a catch — / In the Lambda Order they are all first-class.
<jcowan>
One Thing to name them all, One Thing to define them / One Thing to place them in environments and bind them / In the Lambda Order they are all first-class."
<verisimilitude>
I can define types in a package and totally control their subprograms, initialization, and even things such as assignment or equality.
<aeth>
There are other ways to use scope/names to encapsulate that may or may not be fragile/portable. e.g. uninterning a function after having callers using it, redefining an inline function, redefining a macro, etc.
<jcowan>
I think the CL answer to that is, If you want to chop off your foot, don't let *us* stop you.
<aeth>
verisimilitude: Yes, but by your own standards, you can probably use the Ada debugger to interfere.
<aeth>
Failing that (if the Ada debuggers somehow guard this), you might be able to use a cheat program (since they're mainly used for cheating in games) to edit the memory.
<verisimilitude>
Sure, but even then I can set type invariants that would be triggered.
<aeth>
Perhaps you could edit that as well. Since it's not an Ada machine.
<aeth>
You would need hardware level protection.
<aeth>
It's not impossible
<aeth>
(not impossible that that can exist, I mean)
<verisimilitude>
No, it's not impossible at that level, but it needn't be either.
<verisimilitude>
It's a difference in attitude is all.
<jcowan>
I don't know if this has been fixed since Ada83
<verisimilitude>
Well, Ada 1983 was the very first one.
<verisimilitude>
I'll check.
<aeth>
too bad it didn't get delayed a year
<aeth>
because then it would be literally 1984
jmes has joined #commonlisp
<jcowan>
well, CLtL1 came out in 1984
<jcowan>
(but nobody calls it "Common Lisp 1984")
<aeth>
because Common Lisp is the opposite of 1984, as verisimilitude demonstrated.
<jcowan>
But that would make the name all the better
<jcowan>
Also Coq (began development), SML, and Redcode
<jcowan>
(the assembly language of Core Wars)
<verisimilitude>
Yes, it's since been mandated that they use references for passing.
epony has quit [Ping timeout: 252 seconds]
nexalam_ has joined #commonlisp
sabra has quit [Quit: Konversation terminated!]
<verisimilitude>
The oldest Ada I use is Ada 1995
<verisimilitude>
.
nexalam has quit [Ping timeout: 250 seconds]
nexalam_ has quit [Quit: Leaving]
<jmes>
I want to initialize an object with some extra necessary parameters that aren't initargs. My current approach is defining an initialize-instance :after method with some keyword params which errors when the params are not given. Is there a better way?
<jmes>
The motivation for doing this is I need some extra information to perform the initialization but that information is not going to be stored in a slot.
<kakuhen>
what's wrong with leaving the slots unbound until you're ready to provide bindings?
<kakuhen>
alternatively you can do what people do for structs, where a slot defaults to an error being signalled
doyougnu has joined #commonlisp
doyougnu has quit [Remote host closed the connection]
<jmes>
kakuhen: Well the object has a slot which should be computed based on some initial information coming from those other keyword parameters. But saying this aloud (so to speak) makes me realize I can probably expect that computation to happen beforehand, then pass the result into make-instance.
dra has joined #commonlisp
<jmes>
I'll double check my code... thanks :)
doyougnu has joined #commonlisp
doyougnu has quit [Remote host closed the connection]
doyougnu has joined #commonlisp
doyougnu has quit [Remote host closed the connection]
doyougnu has joined #commonlisp
dra_ has joined #commonlisp
ross71 has left #commonlisp [#commonlisp]
dra has quit [Ping timeout: 246 seconds]
XZDX1 has quit [Ping timeout: 265 seconds]
SAL9000 has joined #commonlisp
doyougnu- has joined #commonlisp
Devon has quit [Ping timeout: 260 seconds]
doyougnu- has quit [Remote host closed the connection]