<Alfr>
Spawns_Carpet[m], that's a strange question to ask for common lisp; reading strings is done using a reader macro function associated with " . see ^
<Alfr>
Spawns_Carpet[m], for standard read table and when you're using CL's read.
<hayley>
What lexer?
<hayley>
The Common Lisp specification states that you read forms with a simple dispatch technique, rather than a lexer and parser. I'm aware that fancier readers, such as Eclector, are more sophisticated, but I don't know if they lex and parse.
* hayley
saw the specbot message first. Can't afford causality?
<akater[m]>
no-defun-allowed: What section of the spec are you talking about re: read?
<Alfr>
hayley, if you consider the turning streams of characters into tokens, in some sense read does that, though you immediately get the denoted objects. (But 2.2 talks about accumulating tokens.)
<hayley>
Right, I guess there is a concept of a "token", but it is usually consumed immediately, and there is no separation between reading tokens, and producing nested structure from tokens.
aeth has quit [Ping timeout: 265 seconds]
aeth has joined #commonlisp
Oladon has joined #commonlisp
akoana has left #commonlisp [Leaving]
waleee has quit [Quit: WeeChat 3.3]
lisp123 has joined #commonlisp
taiju has joined #commonlisp
lisp123 has quit [Ping timeout: 250 seconds]
karlosz has quit [Quit: karlosz]
igemnace has joined #commonlisp
lisp123 has joined #commonlisp
<Spawns_Carpet[m]>
what is the difference between a lexer and simple dispatch?
pillton has joined #commonlisp
<Spawns_Carpet[m]>
i am scanning and building up tokens and then linking those together in an SExpr data structure in rust which is a struct with car, cdr, both being an SExpr Value which is a tagged union of Symbol, String, Int, Char and SExpr which contains the next SExpr like a linked list
<hayley>
The in-memory representation of a Lisp object is not a S-expression.
<hayley>
An S-expression refers to what is written on a character device.
<Spawns_Carpet[m]>
what do you mean by that? I have another LispValue union that contains 'compiled' lisp values later on
<Spawns_Carpet[m]>
does that sound right
<hayley>
Not at all.
<hayley>
A lexer, at least to me, scans over an entire file or string or something, and produces a sequence of tokens, which a parser then consumes in another pass.
<Spawns_Carpet[m]>
what is a "lisp object" in this context
<hayley>
Anything that the Lisp system manipulates.
* hayley
reads
<Spawns_Carpet[m]>
do you consider the compiler part of the lisp system?
<hayley>
Well, the data structure with a CAR and a CDR is usually called a "cons cell".
<hayley>
Yes, I do.
<Spawns_Carpet[m]>
so what should the parser be emitting in this case
<hayley>
There is usually a READ function which produces a Lisp object.
<Spawns_Carpet[m]>
my line of thinking was that the bytecode compiler should work on an AST, and in lisp the AST is an sexpr, so thats what I was parsing and feeding into the compiler, then the compiler emits the actual lisp objects for the interpreter to work with
NotThatRPG has joined #commonlisp
<hayley>
Well, okay, but it seems weird to call the same objects both an "sexpr" and "lisp objects", and I am wondering if there is something I've missed.
<Spawns_Carpet[m]>
no i think I am confused and at some points using the wrong terms as well
<hayley>
Say, we have some code (F 'X). Presumably the whole list won't appear in bytecode, but the symbol X will.
<Spawns_Carpet[m]>
right, it would do something like EVAL(F), PUSH_SYMBOL(X), CALL 1 is my guess
<Spawns_Carpet[m]>
but the bytecode part I am still very shaky on
<Spawns_Carpet[m]>
i only got basic math operations working, like a calculator pretty much
<hayley>
What does the EVAL instruction do? It would be...odd for the bytecode VM to have an instruction which does a plain EVAL.
<Spawns_Carpet[m]>
in this case eval would load a lisp object from the environment and put it on the stack
<hayley>
Okay, sure.
<Spawns_Carpet[m]>
i guess LOAD_VALUE or something would be a better name?
<Spawns_Carpet[m]>
since eval already means something else
<pillton>
Spawns_Carpet[m]: You might enjoy the book Lisp in Small Pieces by Christian Queinnec.
<Spawns_Carpet[m]>
i am going to check that out pillton
<hayley>
The one bytecode VM I did turned everything into De Brujin indices, i.e. every local variable and constant had a number. Then I might emit GET-ENV 0; GET-CONSTANT 0; TAIL-CALL 1;
<Bike>
i would think that you'd have like PUSH_SYMBOL(F) LOOKUPF or something, meaning look up the global function named F
<Bike>
"lookupf" for "lookup function", not related to "F"
s-liao has joined #commonlisp
<Spawns_Carpet[m]>
that probably makes more sense yeah, especially since everything at the start should be a function
<Spawns_Carpet[m]>
for the most part at least? might be exceptions
<Spawns_Carpet[m]>
*no-defun-allowed*: that sounds really cool, I've never heard of that before
spiaggia has joined #commonlisp
Guest74 has quit [Ping timeout: 268 seconds]
s-liao has quit [Quit: Client closed]
s-liao has joined #commonlisp
<spiaggia>
Good morning everyone!
<hayley>
Depending on how you handle the environment, especially if functions and other bindings reside in the same "namespace" or not, having a LOOKUP-FUNCTION that is different to LOOKUP-VALUE may or may not make sense. Because this is #commonlisp I am legally obligated to assume you have separate namespaces, of course.
jealousmonk has quit [Quit: ERC (IRC client for Emacs 27.1)]
tophullyte has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
s-liao has quit [Ping timeout: 256 seconds]
<Spawns_Carpet[m]>
haha, yeah I was planning on keeping one namespace for functions and variables but I am not super dedicated to either method
phossil has joined #commonlisp
<Spawns_Carpet[m]>
so far I haven't gotten that far though
<spiaggia>
Spawns_Carpet[m]: The difficult part of a Lisp system is the evaluator. You can save yourself a lot of trouble if you write your system in Common Lisp, and use the host READ to parse your code. Then you can concentrate on the hard part.
tophullyte has quit [Ping timeout: 265 seconds]
<Spawns_Carpet[m]>
i am considering that strongly
NotThatRPG has joined #commonlisp
<Spawns_Carpet[m]>
the whole text processing step is sort of tedious anyways
<spiaggia>
And what you are doing is wrong in terms of how Lisp is typically parsed.
<Spawns_Carpet[m]>
what do you think I should change
<Spawns_Carpet[m]>
remember that I am pretty new to this, so bare with me
<spiaggia>
It is done as described in chapter 2 of the Common Lisp HyperSpec.
<Spawns_Carpet[m]>
even if I am not implementing common lisp itself?
<spiaggia>
Spawns_Carpet[m]: Sure. It is very hard to give you advice if you are implementing "a Lisp" that is not one that has a specification. Then anything you do is obviously "right" because that's how you have decided that things work in this Lisp.
<spiaggia>
Spawns_Carpet[m]: The best we can do is to tell you how the Common Lisp HyperSpec says that things must be done, since this is #commonlisp, after all.
<Spawns_Carpet[m]>
i am having trouble trying to figure out with the reader algo is an actual concrete idea of what the reader should return in terms of rust data structures
<Spawns_Carpet[m]>
or a c struct or whatever
<Bike>
you should probably just have it return lisp-manipulable objects. whatever that means in your system.
<spiaggia>
Spawns_Carpet[m]: Most code elements in Common Lisp would result in lists in the form of CONS cells, and atoms such as symbols and numbers.
<Bike>
as hayley said, a READ function is often exposed to the lisp, and that's what you're implementing. since it's a function lisp can call, it should return a lisp object.
<Spawns_Carpet[m]>
okay that makes a lot of sense when you say it like Bike, i know exactly what you mean now. I actually debated for a while whether it should return the actual internal representation of lisp data types or not, and asked around elsewhere and some people said to not do it, and others said to do it
<hayley>
Who did you ask?
<Spawns_Carpet[m]>
I asked on discord in the rust server
<hayley>
Well, there's yer problem.
<Spawns_Carpet[m]>
LOL
<Bike>
also, even if you don't expose READ, you will presumably have an EVAL function that takes a lisp object and evaluates it into another object, and you'll want to pass the result of your parse to EVAL, so
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hayley>
I mean, it can help to have some other representation with source tracking information, so that any compile-time errors (for example) can reference where the error is in a file, but that is more complicated, and I don't know what they were thinking of instead.
<Spawns_Carpet[m]>
that is the reason they gave actually
<hayley>
Okay then. But it is more effort, and I wouldn't bother for my first (few) interpreter(s).
<Spawns_Carpet[m]>
to be clear also, the bytecode compiler should be processing the actual lisp objects themselves and not the AST-like thing
<Spawns_Carpet[m]>
since the lisp objects pretty much are the source code I guess that makes sense
<Alfr>
Spawns_Carpet[m], one thing nice in most(?) lisps is that read returns a tree made of conses, that those conses are also directly manipulable using functions in lisp and certain (valid for the language in question) trees can be passed to eval to be treated as code and executed. Also those trees usually are more or less AST you asked for above.
<Spawns_Carpet[m]>
the good thing is that it will be super easy to change the reader to emit actual lisp objects. My "AST" data structure actually was pretty much exactly how I represented the lisp objects anyways, except it had a different name
<Spawns_Carpet[m]>
it also was purely immutable
<Spawns_Carpet[m]>
thanks for the information by the way
s-liao has joined #commonlisp
<Spawns_Carpet[m]>
what happens when the reader has to read multiple top level lists by the way? should I wrap the entire program in an invisible progn?
<Spawns_Carpet[m]>
or just emit each list on its own
<Bike>
usually a file loader will call READ repeatedly, advancing the input stream/port/whatever you call it as it goes
<hayley>
The reader only reads one form at a time.
semz has quit [Ping timeout: 268 seconds]
<Spawns_Carpet[m]>
is the interpreters representation of lisp objects always going to have to be the same as the lisp objects emitted from the reader? that is the idea right
<hayley>
Yes.
<Spawns_Carpet[m]>
that is strange that the compiler uses the same structure that the interpreter uses, but also really cool
<hayley>
You never mentioned a compiler.
<hayley>
As a rule of thumb, the compiler definitely does not use the list-and-symbol-based representation of Lisp code.
<Spawns_Carpet[m]>
oh shoot now I am confused again
<hayley>
The reader produces a form that can be interpreted, but the compiler usually converts this form into another representation more suitable for analysis.
semz has joined #commonlisp
bjorkintosh has quit [Ping timeout: 268 seconds]
<spiaggia>
Though, a very simple compiler for a very simple language could probably generate code directly from the S-expression representation of the program.
<spiaggia>
It would have the same structure as the evaluator, but instead of computing a value, it would emit code to compute that value.
<hayley>
Sure.
Bike has quit [Quit: sleeps]
<spiaggia>
Spawns_Carpet[m]: What hayley is referring to is that most serious compilers for serious languages do a lot of optimizations to the code, and those optimizations typically require some intermediate representation that is neither the S-expressions nor the final instructions (bytecode or native).
<Spawns_Carpet[m]>
that makes sense sure
<Spawns_Carpet[m]>
yeah I am not worried about that right now, needing an IR would be a good problem because that means your language it advanced enough and working well enough to benefit from optimizations !
<Spawns_Carpet[m]>
would be a 'good problem to have'
<hayley>
Depends on your definition of "advanced".
<hayley>
Anything that isn't assembler probably can be optimized.
<spiaggia>
Spawns_Carpet[m]: So maybe you need to think about your long-term goals with this thing. Those goals could determine how much you need to learn about compiler design and what data structures to choose.
s-liao has quit [Ping timeout: 256 seconds]
Devon has quit [Ping timeout: 250 seconds]
lisp123win has joined #commonlisp
bcasiello__ has quit [Ping timeout: 256 seconds]
edgar-rft has quit [Ping timeout: 256 seconds]
edgar-rft has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
tophullyte has joined #commonlisp
phossil has quit [Ping timeout: 256 seconds]
phossil has joined #commonlisp
taiju has quit [Ping timeout: 250 seconds]
tophullyte has quit [Ping timeout: 256 seconds]
rgherdt has joined #commonlisp
flip214 has quit [Ping timeout: 268 seconds]
flip214 has joined #commonlisp
shka has joined #commonlisp
tophullyte has joined #commonlisp
phossil has quit [Ping timeout: 256 seconds]
<jackdaniel>
uh oh, so many next steps on asdf-devel, my feet are tired
<jackdaniel>
hey o/
phossil has joined #commonlisp
<spiaggia>
Hello jackdaniel.
tophullyte has quit [Ping timeout: 250 seconds]
<spiaggia>
jackdaniel: I'll be back on #clim tomorrow or Saturday I hope. This dinky laptop does not encourage participation is very many IRC channels.
<spiaggia>
s/is/in/
attila_lendvai has quit [Ping timeout: 250 seconds]
john__ has joined #commonlisp
<jackdaniel>
sure, it is lively as always :)
<jackdaniel>
but the golden principle of a >9000 engineer is "no news is good news"
Oladon has quit [Quit: Leaving.]
<jackdaniel>
(>9000 is a reference to the internet meme involving an anime "dragon ball")
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
s-liao has joined #commonlisp
Cymew has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
paule32 has joined #commonlisp
rotateq has joined #commonlisp
lukego has joined #commonlisp
<lukego>
Hey does anyone happen to know why cffi on #+unix tries to load libffi.so.7, libffi.so.6, libffi.so.5? Can't it just use libffi.so? I ask because I need to support libffi.so.8 and it feels a bit cargo-cult to add that as the next special case. This tradition seems to go back at least a decade.
frgo has joined #commonlisp
spiaggia has quit [Ping timeout: 265 seconds]
john__ has quit [Ping timeout: 264 seconds]
amb007 has quit [Ping timeout: 265 seconds]
CrashTestDummy2 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
notzmv has quit [Ping timeout: 265 seconds]
aartaka has quit [Ping timeout: 265 seconds]
CrashTestDummy has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
<jackdaniel>
the reason for that is mentioned in the commit message
<jackdaniel>
Use soname with major version for libffi on unix as advocated on
<lukego>
"the" commit message? I went spelunking with 'git log -S libffi' and so on and turned up lots of commits but not a reason
<jackdaniel>
git blame is your friend
<jackdaniel>
then you may introspect individual lines
<jackdaniel>
magit is another handy tool to make it easier
<lukego>
I'm using magit and git blame. user error perhaps, but a comment might be more appropriate than a commit message...
<jackdaniel>
it might, perhaps the commit author would agree with you
<lukego>
ffs, I'm just trying to solve a problem here, preferably in a way that's future proof and helps other people. I don't get what's with all these sphynx-like answers. anyway.
lukego has left #commonlisp [#commonlisp]
<jackdaniel>
hm, I've helped you to find the rationale, digged the wayback archive, and still I'm getting punched on the face
* jackdaniel
gets back to work
notzmv has joined #commonlisp
aartaka has joined #commonlisp
spiaggia has joined #commonlisp
aartaka has quit [Ping timeout: 264 seconds]
aartaka has joined #commonlisp
attila_lendvai has joined #commonlisp
taiju has joined #commonlisp
attila_lendvai has quit [Client Quit]
asen has joined #commonlisp
asen has quit [Read error: Connection reset by peer]
asen has joined #commonlisp
Cymew has quit [Ping timeout: 268 seconds]
az_reth has quit [Quit: leaving]
theothornhill has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
dre has quit [Ping timeout: 250 seconds]
epolanski has joined #commonlisp
s-liao has joined #commonlisp
pillton has quit [Remote host closed the connection]
asen has quit [Quit: Leaving]
s-liao has quit [Ping timeout: 256 seconds]
ebrasca has joined #commonlisp
cosimone has joined #commonlisp
s-liao has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
Brucio-18 has joined #commonlisp
amb007 has joined #commonlisp
VincentVega has joined #commonlisp
<theothornhill>
How do I get (asdf:test-system :system) to yield an exit code of 1 when tests fail in rove? I am using `sbcl --non-interactive --load test.lisp` in a `test.sh` to run on ci, but it alwas passes with error code 0
<jackdaniel>
test-system always returns t
amb007 has quit [Read error: Connection reset by peer]
<jackdaniel>
so you need to either use whatever the /actual/ testing framework gives you to run the testing function (and take the result)
<jackdaniel>
or you may try some fancy specialization on the method operate specialized on your system and the test-op
<semz>
shouldn't test-system signal an error if tests fail? or was that just a convention
<theothornhill>
Ah right. Was hoping I could use test-system for this
amb007 has joined #commonlisp
<theothornhill>
semz: I was thinking the same
<jackdaniel>
it certainly doesn't fail for me when I run 5am tests, perhaps when the framework itself signals an error then test-system doesn't handle it?
<theothornhill>
Now the :perform inside the testsystem is (test-op (o c) (symbol-call :rove '#:run :gql/tests))
<jackdaniel>
the most silly solution (much to my liking) would be: (test-op (o c) (handler-bind ((tests-failed (lambda (c) (signal 'vroom))) (symbol-call …))) and then (handler-case (test-system ...) (vroom () (exit :code 1)))
<jackdaniel>
or something in this spirit
<jackdaniel>
or (if rove signals say tests-failed) then (handler-case (test-system ...) (tests-failed () (exit :code 1))
<theothornhill>
it looks like it just returns two values, one list with successes, and one with fails. So I guess I could just check for nil in the second value
<jackdaniel>
I wonder why test-system doesn't return whatever perform returns
<theothornhill>
Yeah, that must be a bug, or at least a missing feature?
<jackdaniel>
it might be aesthetics - the function returns t on success (instead of - the function returns undefined value(s))
<jackdaniel>
because T was deliberely put in the function body after calling operate
<theothornhill>
hmm. Well, so this works: (multiple-value-bind (foo bar fails) (rove::run :gql/tests)
<theothornhill>
(when fails
<theothornhill>
(sb-ext:exit :code 1)))
<theothornhill>
sorry for the paste
<theothornhill>
But that makes test-system useless, which is a shame
<jackdaniel>
theothornhill: you may always signal some non-serious condition that may be optionally handled from above test-system
<theothornhill>
You mean wrapping the test-system call in a handler-bind or something like that?
<jackdaniel>
even handler-case
<jackdaniel>
but yes, that's what I mean, and signal from operate. then when you call test-system interactively without handlers, it will simply return t
<jackdaniel>
but you will be able to return the exit code from a test script
<theothornhill>
Right, I see what you mean. Yeah, that is better that what I do now, at least
Cymew has joined #commonlisp
atgreen has joined #commonlisp
s-liao has quit [Quit: Client closed]
s-liao has joined #commonlisp
abrantesasf has joined #commonlisp
abrantesasf has quit [Remote host closed the connection]
<theothornhill>
jackdaniel: thanks, btw :)
spiaggia has quit [Ping timeout: 250 seconds]
spiaggia has joined #commonlisp
<phantomics>
question about ABCL: my understanding is that it supports some CFFI functionality, but when I try to load a system with a simple CFFI dependency, the dependency breaks. Does CFFI actually not work with ABCL?
<jackdaniel>
theothornhill: sure
lisp123win has left #commonlisp [ERC (IRC client for Emacs 26.3)]
theothornhill has quit [Ping timeout: 256 seconds]
tyson2 has joined #commonlisp
lisp123w has joined #commonlisp
<lisp123w>
Does asdf re-search all directories every time one runs asdf:load-system or only on startup?
<jackdaniel>
it doesn't, it caches results and uses timestamps to determine whether something has changed
<lisp123w>
If I create a new .asd after loading SBCL, will it get picked up?
<lisp123w>
(brand new one, not updating an existing one)
<jackdaniel>
asdf will do its best I'm sure ,)
Devon has joined #commonlisp
X-Scale` has joined #commonlisp
X-Scale has quit [Ping timeout: 256 seconds]
epolanski has quit [Quit: Connection closed for inactivity]
X-Scale` is now known as X-Scale
<lisp123w>
jackdaniel: great, thanks :)
<jackdaniel>
sure
<etimmons>
phantomics: ABCL needs Maven installed in order to use CFFI
<jackdaniel>
perhaps it is possible for cffi to signal error like "Please install Maven or something" when it is not installed
<etimmons>
I think ABCL does that, asking with a restart to install it, but I forget right now how it's triggered
<jackdaniel>
ah, OK
<jackdaniel>
good to know
<etimmons>
s/asking/including/
<phantomics>
thanks etimmons
<jackdaniel>
(cerror "Whatever.." "Something went wrong!")
<phantomics>
Is there a way to check whether Maven is installed within ABCL? That way I can implement a fallback option in case it's not there
<rotateq>
Java hell :)
<scymtym>
lisp123w: if you create a new system definition file after ASDF has already been initialized, (ASDF:LOAD-SYSTEM "new-system") will signal an error. in the context of that error, there will be a restart CLEAR-CONFIGURATION-AND-RETRY which instructs ASDF to re-scan the filesystem and discover the new system definition file
<jackdaniel>
Hava(na) Jell(y) - a nice codename for an application
<rotateq>
jackdaniel: :D
random-nick has joined #commonlisp
<rotateq>
and they still think they have real legacy
<jackdaniel>
but they do, systems written in java will be maintained for years to come
<jackdaniel>
even _if_ it loses traction
<yitzi>
Our Jelly in Havana
<rotateq>
wasting many man years of work for nothing over and over :)
<etimmons>
phantomics: I'm pretty sure there is, but I don't recall how. You can likely find it if you require :abcl-contrib and then apropos for maven or mvn
<jackdaniel>
I don't think that Java deserves such harsh opinion, but I'll keep quiet I'm getting into offtopic
puchacz has joined #commonlisp
<puchacz>
hi, using trivia / optima - can I match the same value in 2 or 3 places in a list?
<puchacz>
pattern like (list :foo x x) is interpreted as an attempt to rebind a variable already bound
<puchacz>
I want to match (:foo 3 3) for example
<phantomics>
puchacz: you'd need to match them separately, like (list :foo (guard first3 (= first3 3)) (guard second3 (= second3 3)))
<puchacz>
phantomics, so if I have 5 places, it means 5 guards?
<phantomics>
Yes, afaik
<puchacz>
thanks
<phantomics>
I went looking for a way in trivia to do things like "match however many elements you find that fulfill this criteria" but couldn't find any
<phantomics>
I wonder if the way the pattern-matching is optimized in those libraries prevents such a thing from being implemented
<puchacz>
maybe I should learn paip prolog instead. I don't know it, but I think you could do something like I wanted (:foo x x) at least
<puchacz>
I mean - today is my first attempt at trivia, I am not giving up yet :)
azimut_ has joined #commonlisp
aeth has quit [Ping timeout: 250 seconds]
<jackdaniel>
trivia allows defining patterns, so perhaps these guard things could be trivia()lly macroexpanded
<puchacz>
ok, I may get to it
<puchacz>
as I say - not giving up yet
aeth has joined #commonlisp
azimut has quit [Ping timeout: 276 seconds]
<phantomics>
Yes, you could use macros on top of trivia to define a heuristic to get N numbers equal to X
peterhil has joined #commonlisp
<puchacz>
in my example, I only care that both elements are the same. they don't need to be eql to 3
leo_song_ has quit [Ping timeout: 260 seconds]
<jackdaniel>
puchacz: this is tricky - how do you define "the same"?
<jackdaniel>
#'eql, #'string= or #'really-really-similar-p ?
<puchacz>
jackdaniel - I have a function "really, really similar" for floating numbers
<puchacz>
anything else can be equal or equalp or equalps (like equalp, but ignoring spaces)
<puchacz>
really, really similar is not transitive, so while in theory it would match or not depending on which pairs of bound values are checked, in practice it should not matter
Bike has joined #commonlisp
leo_song has joined #commonlisp
paule32 has quit [Quit: Leaving]
s-liao has quit [Quit: Ping timeout (120 seconds)]
s-liao has joined #commonlisp
Colt has quit [Quit: Leaving]
theothornhill has joined #commonlisp
s-liao has quit [Quit: Ping timeout (120 seconds)]
s-liao has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
pve has joined #commonlisp
theothornhill has quit [Ping timeout: 265 seconds]
tyson2 has quit [Remote host closed the connection]
s-liao has quit [Quit: Ping timeout (120 seconds)]
Guest74 has joined #commonlisp
waleee has joined #commonlisp
epolanski has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
tyson2 has joined #commonlisp
cage has joined #commonlisp
Cymew has quit [Ping timeout: 256 seconds]
<etimmons>
Is there any way to get all the possible initargs for a class? That includes any added to INITIALIZE-INSTANCE and not attached directly to a slot definition.
<etimmons>
I know I can use closer-mop to get all the initargs from slot definitions, but I see no obvious way to get the others
<Bike>
you'd probably have to do it yourself with
<Bike>
clhs method-keywords
<specbot>
Couldn't find anything for method-keywords.
<Bike>
it's so obscure and badly named that i forgot what it was.
<Bike>
i.e. do compute-applicable-methods on initialize-instance and shared-initialize, call function-keywords on all the methods, union them together
<etimmons>
Thanks! I didn't know that existed, but it looks like exactly what I need
<etimmons>
And it IS a terrible name. Why function- and not method- ???
<Bike>
no idea!
Inline has joined #commonlisp
<rotateq>
hysterical raisins maybe?
thomaslewis has joined #commonlisp
rotateq has quit [Remote host closed the connection]
jealousmonk has joined #commonlisp
ym has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
NotThatRPG has joined #commonlisp
waleee has quit [Ping timeout: 264 seconds]
waleee has joined #commonlisp
<jackdaniel>
etimmons: scraping initargs from slot definitions would not suffice, because you may have initialize-instance keywords that are not initializing any particular slot
<jackdaniel>
(the solution with function-keywords sounds like the right thing to do, I didn't know about it)
<etimmons>
Yeah, I started with slot definitions and then realized pretty quickly it was insufficient
<Nilby>
from before methods were different from functions
<jackdaniel>
Bike: the name is obscure, but its interface seems sane - what do you mean by that the function itself is obscure?
<Nilby>
There was some MOP-like things before MOP
<Bike>
just that i've only ever used it for this exact purpose
<jackdaniel>
I see, thanks
aeth has quit [Ping timeout: 256 seconds]
phossil has quit [Ping timeout: 256 seconds]
<jackdaniel>
perhaps one could specialize it on standard-class to harvest all keywords from the union of initialization methods (with caching :)
aeth has joined #commonlisp
<Bike>
in clasp we use it to precompute and cache valid keywords for when make-instance checks them. i forget if that's inherited from ECL or not
<jackdaniel>
no, ecl doesn't have anything like this
<jackdaniel>
right, but not function-keywords specializer :) perhaps we could change it
<Bike>
mop method-keywords
<specbot>
Couldn't find anything for method-keywords.
<Bike>
i guess it's internal then
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
<Guest74>
I kinda wish slime was smart enough to only display keyword arguments specialized on the objects given. Other times i think I shouldn't have separate keywords for different classes.
<spiaggia>
Guest74: What does it mean for a "keyword argument" to be "specialized on" an object?
<Guest74>
methods specialized on objects, which can have different keyword args
<spiaggia>
And what does it mean to have a "keyword for a class"?
<Guest74>
you know of &allow-other-keys right?
<spiaggia>
Guest74: You mean EQL specializers? Most methods specialize to classes otherwise.
<Guest74>
no
<NotThatRPG>
Guest74: More and more I have adopted the OO Programming in CL style of making constructor functions that wrap make-instance, because the make-instance interface is so hard to introspect
<spiaggia>
So what does it mean for a method to "specialize on an object"?
NotThatRPG is now known as NotThatRPG_away
NotThatRPG_away has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<shka>
Guest74: it does that sometimes!
<Guest74>
yeah, it's annoying.
Inline has quit [Quit: Leaving]
* spiaggia
is lost.... again.
<Guest74>
I'm not sure what the purpose of displaying key args you can't use is, but I'm guessing slime just calls some mop function that aggregates all keywords for a given generic function.
thomaslewis has joined #commonlisp
<Guest74>
spiaggia: talking about calling a generic function and what slime displays as possible keywords.
<spiaggia>
How would SLIME know what methods are applicable when you just call a generic function?
<White_Flame>
especially as slime isn't aware of what the runtime classes of the argument values would be
<spiaggia>
And it couldn't, since that would be undecidable.
<Guest74>
if you have the objects you should be able to retrieve which specific method applies.
<White_Flame>
spiaggia: in some limited very static cases it could be possible, but yeah there's not an expectation that that info is visible statically
<spiaggia>
But how does SLIME know what object would be the value of an argument form you type.
<Bike>
huh, there's a thought. editor that does type inference to narrow down the applicable methods. i suppose your average manifestly typed language editor does that nowadays
<spiaggia>
Sure it would be much easier in such a language.
<Guest74>
is that information that could be gotten from eclector?
<Bike>
eclector does not do type inference lol
<Bike>
it would be possible for a beefy editor system to do it. i think the kind of editor beach has in mind could swing it
<spiaggia>
Guest74: If you have (gf (some-function arg...)), how can SLIME know what some-function will return?
thomaslewis has left #commonlisp [#commonlisp]
Bike25 has joined #commonlisp
Bike25 is now known as Bicyclidine
<Bicyclidine>
slime does print appropriate keywords for the very special case of (make-instance 'quoted-symbol ...)
<Guest74>
hm, maybe I was thinking of trucler. That should be able to provide the needed feedback, no? A good editor would need to be able to introspect
<Bicyclidine>
maybe also change-class? i forget
<Bicyclidine>
well, it would entail more than what trucler has, in general
<jackdaniel>
if you have (make-instance 'class-name ..) surely it can infer something
<Bicyclidine>
if you have (foo (bar ...) ...), it would need to recognize that the argument to foo comes from bar, and has such and such type
<jackdaniel>
i.e by calling the running system
<Bicyclidine>
when you factor in general forms like (foo (if ...) ...) you can see how this would take a pretty hefty analysis
<Bicyclidine>
not insurmountable, and the compiler is doing that kind of thing already, but it would take a bit of thought to make it available for the editor's perusal
<Guest74>
I'm mainly concerned with the basic case of using generics in the repl.
<Bicyclidine>
that is what i'm describing
<Guest74>
Though I guess some people do do complicated things like that in their code and would want the editor to deal with it.
<Bicyclidine>
in (foo (if ...) ...), FOO would be a generic function
<Bicyclidine>
it could be more indirect, like (let ((bar (if ...))) (foo bar ...))
<Guest74>
Yes, but I'm not sure what the use case would be of using if at the repl to determine the argument.
<Bicyclidine>
oh, so you're only concerned more with repl one liners
<Guest74>
by the basic case I mean calling a generic with known objects.
thomaslewis has joined #commonlisp
<Bicyclidine>
like dynamic variables?
<Bicyclidine>
(foo *bar* ...) or something? because you're probably not writing (foo #<literal object> ...)
<Guest74>
true, I can see how that might complicate things.
<Bicyclidine>
you could handle the limited case of an argument being a dynamic variable with trucler and not much difficulty
thomaslewis has left #commonlisp [#commonlisp]
<Guest74>
so the base of a good editor would need something like both trucler and eclector?
<spiaggia>
And Cleavir, yes.
<spiaggia>
And Clostrum.
<spiaggia>
Maybe not Clostrum if you do it for (say) SBCL.
<Guest74>
what would cleavir be used for?
<Bicyclidine>
type inference
<spiaggia>
Information about functions being called to provide arguments, like type information, yes.
puchacz has quit [Quit: Client closed]
<spiaggia>
Global values of special variables if such a variable were to be used as an argument.
tyson2 has quit [Remote host closed the connection]
<Guest74>
welp, hopefully somebody writes that soon.
<spiaggia>
scymtym is working on bits and pieces.
<spiaggia>
Guest74: I must congratulate you, though. You are one of only a few people who are not convinced that Emacs+SLIME is the best development environment around, all languages taken into account.
NotThatRPG has joined #commonlisp
<Guest74>
I have bad memory, so emacs in general is not good for me.
<Guest74>
but I couldn't survive without something like M-.
<spiaggia>
Well, I wasn't referring to that particular aspect of Emacs.
<Guest74>
I mean, my wm only has one key-binding. That's how much I can hold onto emacs stuff.
<spiaggia>
NotThatRPG: I tried Keene's advice to provide specific constructors, but I backed off a bit. Now I often do an intermediate thing like MAKE-AST that trampolines to MAKE-INSTANCE, perhaps after doing some sanity checks and stuff. \
<spiaggia>
NotThatRPG: The class to be instantiated is encoded in the name of the constructor if you follow Keene's advice. but I find I often need to have the class be computed from other information, so that technique won't work then.
<NotThatRPG>
Makes sense. The big thing to me is to avoid &allow-other-keys which makes it horrible to get things right.
NotThatRPG is now known as NotThatRPG_away
NotThatRPG_away has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<spiaggia>
Yes, I see.
<lagash>
hayley: what's this "one bytecode VM" you were talking about?
<Guest74>
mfiano: what's your backtracking strategy? I'm thinking, perhaps naively, to keep a list of collapsed cells with their that had more than one possibility, the possibility it was collapsed to, and a list of cells collapsed after them.
<Guest74>
s/with their/ /
<Guest74>
and updating the list of failed possibilites each time, once it encompasses all possibilites, just add it as a cell to the previous collapsed cell with more than one possibility.
<lagash>
I was wondering why Gnuxie didn't autocomplete :P
Bicyclidine has quit [Quit: Bicyclidine]
<Bike>
what's the server op channel again? i am concerned
<Bike>
#libera, right
samps has joined #commonlisp
<Bike>
apparently some idiot was connected through matrix, and an op accidentally (?) k-lined the entire matrix instance
drmeister has quit [Ping timeout: 264 seconds]
drmeister has joined #commonlisp
katco has joined #commonlisp
hobo has quit [Ping timeout: 250 seconds]
gendl has quit [Ping timeout: 265 seconds]
victor_ has quit [Ping timeout: 265 seconds]
hubvu has quit [Ping timeout: 264 seconds]
conjunctive has quit [Ping timeout: 264 seconds]
<Bike>
and i guess it's un-k-lined now?
luis` has joined #commonlisp
alphapapa[m] has joined #commonlisp
etimmons has joined #commonlisp
sepanko has joined #commonlisp
hobo has joined #commonlisp
happy-dude has joined #commonlisp
rudi has joined #commonlisp
Mrtn[m] has joined #commonlisp
dieggsy has joined #commonlisp
akater[m] has joined #commonlisp
Gnuxie has joined #commonlisp
icepic1984[m] has joined #commonlisp
yitzi has joined #commonlisp
saltrocklamp[m] has joined #commonlisp
sp has joined #commonlisp
hayley has joined #commonlisp
zbrown[m] has joined #commonlisp
paulapatience has joined #commonlisp
MatrixTravelerbo has joined #commonlisp
Duuqnd has joined #commonlisp
CodeBitCookie[m] has joined #commonlisp
danirukun[m] has joined #commonlisp
Arcsech has joined #commonlisp
loke[m] has joined #commonlisp
rodentrabies[m] has joined #commonlisp
Spawns_Carpet[m] has joined #commonlisp
<Bike>
yeah, ok. phew.
dbotton has quit [Ping timeout: 240 seconds]
jcowan has quit [Ping timeout: 264 seconds]
alanz has quit [Ping timeout: 268 seconds]
jmercouris has quit [Ping timeout: 265 seconds]
IUSR has quit [Ping timeout: 265 seconds]
griffinmb has quit [Read error: Connection reset by peer]
travv0 has quit [Read error: Connection reset by peer]
stylewarning has quit [Read error: Connection reset by peer]
splittist has quit [Read error: Connection reset by peer]
drmeister has quit [Read error: Connection reset by peer]
iisi has quit [Read error: Connection reset by peer]
jsatk has quit [Read error: Connection reset by peer]
epolanski has quit [Read error: Connection reset by peer]
ullbeking has quit [Read error: Connection reset by peer]
pl has quit [Read error: Connection reset by peer]
<samps>
Hey folks, quick question: in Java (coming from a Clojure background) we have the `resources/` folder in which we can put assets whose path can be later retrieved using `clojure.java.io/resource`. Is such a thing possible for CL's systems?
gendl has joined #commonlisp
jmercouris has joined #commonlisp
iisi has joined #commonlisp
igemnace has quit [Ping timeout: 250 seconds]
conjunctive has joined #commonlisp
jsatk has joined #commonlisp
<spiaggia>
samps: You can just choose any folder name you like and make it the global value of any special variable you like.
<lagash>
Gnuxie: Netfarm looks interesting, a bit too niche for my interests though!
jcowan has joined #commonlisp
<spiaggia>
samps: Then you can put anything you want in that folder and retrieve it using the global value of that special variable.
IUSR has joined #commonlisp
epolanski has joined #commonlisp
stylewarning has joined #commonlisp
travv0 has joined #commonlisp
splittist has joined #commonlisp
dbotton has joined #commonlisp
<samps>
spiaggia: fair enough, but Clojure/Java's resources thing is that it is relative to the project's location within the classpath. If I understood your suggestion correctly, I would be hardcoding an absolute location, right?
victor_ has joined #commonlisp
drmeister has joined #commonlisp
pl has joined #commonlisp
alanz has joined #commonlisp
NotThatRPG has joined #commonlisp
ullbeking has joined #commonlisp
<Guest74>
samps: you can get the directory where the system is stored with asdf.
<spiaggia>
samps: I don't know Java, so I probably misunderstood what you wanted.
hubvu has joined #commonlisp
<samps>
ah, let me explain better
<spiaggia>
I guess "within a classpath" translates to "ASDF-relative".
<Guest74>
asdf:system-relative-pathname will construct a pathname relative to the system.
<samps>
the thing with `resources/` is that if I invoke `(io/resources "foo/bar.json)` it will give me an absolute path for the fragment I gave within resources, lik `/home/foobar/projects/cool-thing/resources/foo/bar.json`
<samps>
asdf:system-relative-pathname looks really nice! Thanks for this, it should work well
<Guest74>
np
Spawns_Carpeting has joined #commonlisp
<samps>
yup, asdf:system-relative-pathname is asdf's analogue to io/resource. Can't see much of a difference functionally, really
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
griffinmb has joined #commonlisp
puchacz has joined #commonlisp
Mrtn[m] has quit [Quit: Client limit exceeded: 20000]
MatrixTravelerbo has quit [Quit: Client limit exceeded: 20000]
happy-dude has quit [Quit: Client limit exceeded: 20000]
yitzi has quit [Quit: Client limit exceeded: 20000]
loke[m] has quit [Quit: Client limit exceeded: 20000]
sepanko has quit [Quit: Client limit exceeded: 20000]
rain3 has joined #commonlisp
luis` has quit [Quit: Client limit exceeded: 20000]
katco has quit [Quit: Client limit exceeded: 20000]
etimmons has quit [Quit: Client limit exceeded: 20000]
paulapatience has quit [Quit: Client limit exceeded: 20000]
Gnuxie has quit [Quit: Client limit exceeded: 20000]
saltrocklamp[m] has quit [Quit: Client limit exceeded: 20000]
hayley has quit [Quit: Client limit exceeded: 20000]
zbrown[m] has quit [Quit: Client limit exceeded: 20000]
Duuqnd has quit [Quit: Client limit exceeded: 20000]
cosimone has quit [Ping timeout: 265 seconds]
cosimone has joined #commonlisp
Catie has joined #commonlisp
etimmons has joined #commonlisp
<etimmons>
Just be a bit careful with system-relative-pathname, it only works if the source is available for the system. So if you're going to distribute an image, you need to somehow bundle those resources yourself.
<NotThatRPG>
Also remember that if you want a directory path from this function you *must* end the second argument with a "/"!
katco has joined #commonlisp
luis` has joined #commonlisp
Mrtn[m] has joined #commonlisp
sepanko has joined #commonlisp
happy-dude has joined #commonlisp
frgo has quit [Ping timeout: 260 seconds]
Gnuxie has joined #commonlisp
saltrocklamp[m] has joined #commonlisp
hayley has joined #commonlisp
yitzi has joined #commonlisp
zbrown[m] has joined #commonlisp
paulapatience has joined #commonlisp
MatrixTravelerbo has joined #commonlisp
loke[m] has joined #commonlisp
Duuqnd has joined #commonlisp
<Guest74>
tbh, I just use xdg dirs, but I think that's linux only.
rain3 has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 264 seconds]
amb007 has joined #commonlisp
<NotThatRPG>
Guest74: I tried to figure out XDG, and it just seemed like a mechanism for making it impossibly complex for me to find how any application's configuration was computed.
* NotThatRPG
is being a stupid troll
<Guest74>
it takes some getting use to reading specifications from freedesktop.
<spiaggia>
Guest74: So how would that work? Like suppose I have some Common Lisp software I would like for others to install, and in that software I would like to refer to a particular file in the CLOSER-MOP system. How would my Common Lisp code look for that to be possible with the mechanism you are describing?
<etimmons>
UIOP has an XDG like implementation for Windows, but it's a bit bonkers/not what a Windows user would typically expect
<etimmons>
But system-relative-pathname and XDG are solving two different problems
<Guest74>
spiaggia: it wouldn't help for that.
<Guest74>
it's more about finding directories where you can store data, configs, etc...
<spiaggia>
Oh, I thought you gave it as an alternative to ASDF-relative pathnames.
<spiaggia>
I guess I misunderstood.
<etimmons>
spiaggia: That's what I understood as well
<Guest74>
well, it's an alternative for finding a place to store and retrieve your data.
bcasiello__ has joined #commonlisp
<Guest74>
you can search those directories for what others might have put there, but more for where your project puts things.
<Guest74>
you also use it to find common resources like fonts, icons, sounds, etc...
<Nilby>
I've rigged it so that e.g. (path-append (config-dir "nyxt") "auto-config.lisp") gives me the right place on unix,macos,windows,…
<Guest74>
I dont use those other OSs, but wouldn't you just use logical pathnames?
<Nilby>
I would use logical pathnames ... if I wanted to suffer for eternity.
spiaggia has quit [Ping timeout: 260 seconds]
<Guest74>
what's the problem with them? Seems to work fine for my use case.
<Guest74>
huh, looks like clx uses them too, or maybe that's just my branch
<NotThatRPG>
Guest74: etimmons can tell you the sad saga of testing ASDF with logical pathnames.... The spec for how they should be translated is very loose, so their performance across implementations can be difficult to predict.
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
<Guest74>
Is there any write up of the problems? I think I should eventually be concerned about other implementations, well, at least ecl.
<NotThatRPG>
In its simplest form, the problem is that an implementation is licensed to do just about anything when it rewrites a logical pathname.
<NotThatRPG>
"translate-logical-pathname might perform additional translations, typically to provide translation of file types to local naming conventions, to accomodate physical file systems with limited length names, or to deal with special character requirements such as translating hyphens to underscores or uppercase letters to lowercase. Any such additional translations are implementation-defined. Some implementations do no additional translations."
<Nilby>
Even if I somehow had the power to fix logical pathnames, I'm not sure I would use it. They worked well in the past, on one implementation, in one organization.
<NotThatRPG>
Right: and as I have said ad nauseum, logical pathnames were invented and specified in a world where there was much more diversity in filesystems.
<NotThatRPG>
Right now, the Python approach of just pretending everything is Unix works much more predictabley
<Guest74>
so now that there's less diversity it should be easier to constrain the specification.
<Nilby>
Now there are practically only 2 kinds of pathnames, one is very sensible and easy, the other is relatively insane, and even logical pathnames can't support them properly.
<NotThatRPG>
predictably
<NotThatRPG>
Guest74: Yeah, except that the specification is a dead document.
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
<Guest74>
and yet implementations have come to agree on lots of things, like plns
<etimmons>
ABCL's behavior here seems nonsensical, yet conforming
<NotThatRPG>
plns?
<NotThatRPG>
package local nicknames?
<etimmons>
package local nicknames
<White_Flame>
particularly lettered nomenclature
samps has quit [Quit: Client closed]
<Guest74>
etimmons: so you're saying I'll be fine on ecl. :)
<yitzi>
Does anybody know if there is a character encoding system for Lisp around? I know the various implementations have their own internal functions to support stream encoding. Just wondering if anyone has made and external library.
thomaslewis has joined #commonlisp
<etimmons>
Guest74: I Guess? Just hope you don't like underscores or mixed case file names. I think file names containing more than one #\. or with non-ASCII characters might be underspecified as well? Been a while since I've seriously played with logical pathnames
<White_Flame>
yitzi: babel
<Guest74>
nope, just basic filenames, no special characters, no spaces, only hypens as separators.
<Guest74>
only lower case.
<yitzi>
White_Flame: Thanks, I completely forgot about that.
<NotThatRPG>
Guest74: The problem is that if someone wants to put something in the logical pathname structure that you have created, they can still bust it.
<yitzi>
Bike: Thanks.
<Guest74>
notthatrpg: i'll have to think on that one. I'm not sure I use them for anything that the user can modify.
<Guest74>
but having either a known allowed case/character set or a (non)trivial-logical-pathnames would be nice.
yewscion has joined #commonlisp
<NotThatRPG>
That would probably require a level of groveling over individual implementations that I don't know anyone would be excited to do.
<NotThatRPG>
Using Fare's "pretend everything is Unix" approach in ASDF/UIOP is probably easier than trying to figure out how LPNs work acrss implementations.
<etimmons>
And OSes, since logical pathname translation can be dependent on the file system in use.
Skyfire has quit [Ping timeout: 240 seconds]
<Guest74>
I would think that information is in someones brain. unless they forgot it from trauma.
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NotThatRPG has joined #commonlisp
<Nilby>
Regarding encoding, even on macOS if you make a file called "cèpe" you actually get a file called "cèpe".
asarch has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
<Guest74>
I'm seeing the same characters
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amb007 has joined #commonlisp
<Nilby>
Seeing and bytes are very different in unicode, but who knows if the ecoding changed from my irc client to yours.
<Nilby>
but for me (list (length "cèpe") (length "cèpe")) => (4 5)
NotThatRPG has joined #commonlisp
<Guest74>
yeah, that code gives me the same result.
<Nilby>
in other words macos converts NFC to NFD or something
<etimmons>
uggghhh, I hate normalizing file systems.
<Guest74>
but that's probably another reason to a known safe character set.
<Guest74>
s/to a/ to have a/
<Guest74>
but you really can't change what app users will do.
<Guest74>
even i fyou can affect library users.
<Nilby>
exactly, the web in Japan is still a lot of Shift-JIS and probably won't be unicode any time soon
thomaslewis has joined #commonlisp
asarch has quit [Ping timeout: 240 seconds]
thomaslewis has left #commonlisp [#commonlisp]
<phantomics>
I've made some changes to my ~/.bashrc and it seems that when starting Slime's inferior-lisp-program, this .bashrc isn't used. Shell variables that are supposed to be set in this .bashrc appear to not be available to the inferior lisp I'm running. Has anyone run into this?
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
<Bike>
phantomics: yes, iirc emacs does not go through the shell to start programs
<VincentVega>
Could anyone remind me of the name of the library (I saw it on github a while ago)? It aims to build the foundation of a matplotlib-like library (mentions that in the README), but more general & efficient. Something to that end. I don't remember what it does exactly, but I want to read about it again.
cosimone has quit [Ping timeout: 256 seconds]
asarch has joined #commonlisp
<VincentVega>
Also, are there any geometry libraries other than cl-geometry? I want shape intersection tests mostly, rectangle-rectangle, rectangle-circle and such would be nice.
tophullyte has joined #commonlisp
<VincentVega>
(written fully in CL)
cosimone has joined #commonlisp
theothornhill has joined #commonlisp
phossil has joined #commonlisp
tophullyte has quit [Ping timeout: 240 seconds]
aeth has quit [Ping timeout: 265 seconds]
aeth has joined #commonlisp
thomaslewis has joined #commonlisp
<Guest74>
I'm sure there's plenty stored away in game engines and mcclim. someone should abstract that all into some generic interface.
<vegai>
vellum?
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
<Guest74>
anybody know how to get pngload to load a paletted png and return an array of indices into the palette?
thomaslewis has left #commonlisp [#commonlisp]
<VincentVega>
vegai: yes, thank you!
<VincentVega>
Guest74: Indeed, those are reasonable places too look for...
Alfr is now known as Guest8572
Guest8572 has quit [Killed (calcium.libera.chat (Nickname regained by services))]
Alfr has joined #commonlisp
<mfiano>
VincentVega: Check out mfiano/origin on GH
<mfiano>
Guest74: My approach sucks, ignore that part completely.
<Guest74>
ah, i can't even remember where yours is located or what it's called :)
<mfiano>
VincentVega: for the geometry intersection testing that is
<Guest74>
hey, is there a way to get pngload to return an array of indices for paletted images?
<Guest74>
it's screwing me up cause the png object says bit-depth 4 but returns an uint8 array.
<Guest74>
yeah, i already typecase on truecolour and truecolour-alpha, so I can use that to get a correct image. Still would be nice to be able to get an array of indices so changing palettes would be simple.
<VincentVega>
mfiano: Looks good, thank you! I haven't seen you library neither on awesome-cl, nor common-lisp.net. Have you published it recently? It's nice to see there's some competition in the vector math department, e.g. rtg-math, 3d-vectors/matrices.
peterhil has quit [Remote host closed the connection]
<mfiano>
VincentVega: I haven't but as far as I'm aware it's the only one with extensive intersection testing.
<mfiano>
and it's _fast_
<mfiano>
Feel free to add it wherever it makes sense. I've been busy and its hard to keep track of all these places for me anyway :)
<VincentVega>
mfiano: Nice, I can see you took care in the declarations / inlining.
<VincentVega>
OK!
aartaka has quit [Ping timeout: 250 seconds]
thomaslewis has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
thomaslewis has left #commonlisp [#commonlisp]
resttime has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.3]
perrierjouet has joined #commonlisp
<phantomics>
Follow-up to my previous question, I've added :env properties to my Slime ABCL invocation but they don't work, they are :env ("JAVA_HOME=/home/user/src/linux/jdk-12/" "PATH=/opt/apache-maven-3.8.3/bin:$PATH")
<phantomics>
According to the Slime docs this is the correct format, don't suppose anyone's run into anything like this before?
dra_ has joined #commonlisp
thomaslewis has joined #commonlisp
ym has quit [Ping timeout: 250 seconds]
thomaslewis has left #commonlisp [#commonlisp]
didi has joined #commonlisp
<didi>
Is it possible to remove a method definition? Not the generic function, but the method.
<jcowan>
MacOS uses NFD throughout, in particular in pathnames.
<Catie>
didi: remove-method?
<didi>
Oh, I see `remove-method'. Cool.
<didi>
Catie: Indeed. Thanks.
<Catie>
Ah, nice timing
<phantomics>
Follow-up: it looks like in SBCL at least, the :env property in slime-lisp-implementations works. For ABCL, it does not
<phantomics>
For instance, I can pass the option :env ("FOO=123") to SBCL, then after starting SBCL via Slime, enter (uiop:run-program "echo $BLA" :output *standard-output*) and get 123
hayley has quit [Changing host]
hayley has joined #commonlisp
<phantomics>
The same does not work in ABCL, "echo $FOO" returns nothing
<didi>
Somewhat tricky getting the right method. SLIME could lend a hand here.
<Catie>
It might be something either closer-mop or whatever your implementation's MOP facilities are could help with. I haven't really messed with either, so I'm afraid I can't provide any specifics
<didi>
Catie: I suppose a combination of FIND-METHOD and REMOVE-METHOD will do, but still.
<etimmons>
In SLIME, I think you can inspect the generic function and remove methods from there
<didi>
etimmons: Ah, that's what I'm talking about.
dra_ has quit [Quit: Leaving]
dra has joined #commonlisp
<didi>
Sweet. Thanks, etimmons.
<etimmons>
np
john__ has joined #commonlisp
<Guest74>
oh, that's helpful! I hate haven't to write a big long find this, find that, and this.
dra has quit [Quit: Leaving]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<didi>
It's surprising how many places I'm able to use `shiftf' since I learned it.
<Catie>
didi: You've just changed my life, thank you
<Guest74>
example?
<didi>
Catie: Right?
<didi>
Guest74: In my case, simple stuff like (shiftf (aref array 0) (aref array last-pos) nil).
<Catie>
I knew about rotatef, but this is also very useful
<Guest74>
i mean, I use rotatef all the time, but I can't figure out what to swap in for shiftf
<didi>
Guest74: I started spotting them afterwards.
<Catie>
It's rotatef but it adds in a new value. And goes in the opposite direction
<Catie>
Actually that's weird that it goes in that direction
<Guest74>
I just haven't, or haven't seen, a case where I want to put in a new value.
<Catie>
Guest74: Oh yeah no, I'm just exciting to be adding another tool to my collection!
<Guest74>
lol, yeah, i've been excited about shiftf for years. I might need to see it in use to really get it.
frgo has joined #commonlisp
frgo has quit [Ping timeout: 256 seconds]
<Nilby>
One common pattern of shiftf is when you want to keep the previous value of something, like: (shiftf last-foo current-foo (new-foo x))
<Guest74>
I usually just push a new value in those cases.
<Nilby>
It's also great when you want to shift responsibily (let ((new-intern (shiftf peon 1xer 10xer (new-project "🆒")))) ...)
abrantesasf has joined #commonlisp
<Guest74>
I'm not understanding that example.
<Guest74>
So i read the clhs again. Am i reading it right that if the new-value produces multiple values it will fill multiple places with those values?
<Guest74>
that sounds more useful than just shifting one place over, not that I can think of a use of that either.
tyson2 has joined #commonlisp
<Guest74>
nope, it doesn't
<Shinmera>
If you need to step with a history of a previous item it's useful. eg: (shiftf prev cur new)
<Bike>
it probably wouldn't be possible to do that efficiently.
<Guest74>
that second paragraph in the description is kinda misleading, or perhaps it's my reading of it.
<Shinmera>
I also seem to have a bunch of stuff in my code that's similar to: (let ((old (shiftf (some-place) new-value))) ..)
<Bike>
hm, no, maybe it could be done
theothornhill has quit [Remote host closed the connection]
theothornhill has joined #commonlisp
<Guest74>
maybe, i'll just grep through shinmera's code and see what's what.
Inline has quit [Ping timeout: 250 seconds]
<Guest74>
which raises a question, what's a good name for something that does what grep does?
<Shinmera>
?
<Guest74>
I wrote something that does what grep does, but not sure grep is the name I want.
<Guest74>
huh, apparently I've used shiftf in my own code. Damn covid has been hell on my memory and thinking.
<VincentVega>
how about grope
<Shinmera>
how about no
<Guest74>
apparently it stands for "Global Regular Expression Print" and I don't do that since I just allow simple wildcards. guess i really should find another name.
<hayley>
GIEP: global irregular expression print
<White_Flame>
streamatch
<Nilby>
I suggest "pointlessly-search-the-files-again-disregarding-the-deep-structure" to keep your fingers limber.
<VincentVega>
well if you just added regular expressions now...
pve has quit [Quit: leaving]
<Guest74>
nilby: I have been thinking of adding the option to return everything from the toplevel parentheses.
<Guest74>
just a before and after n lines doesn't work well when you go past the containing sexp.
<Shinmera>
beh
<Shinmera>
wish I had time for fun lisp projects again
<Shinmera>
haven't made anything new it what feels like ages
<Guest74>
you think you'll take a break after Kandria?
<Shinmera>
That's more than a year out, and I don't know if I can afford to.
<Guest74>
I wish I had your ability to work on and finish one thing.
<Shinmera>
your livelihood depending on it helps with that
<Nilby>
Shinmera: You've already made so many times the average lisper, Almost every category of software, I can say "Oh Shinmera made a one of those."
<hayley>
Guest74: Pro-tip: there are approximately 0 libraries that correctly implement even POSIX extended regular expressions, so you have as good a claim to the name "grep" as anyone else
<White_Flame>
I need an AGI. where's Shinmera's?
<Shinmera>
Nilby: I guess? I'm not doing things because I want to hit some record or whatever though. I just enjoy doing it and I lament not having any time / energy recently to indulge in that.
<Guest74>
hayley: but I can't grok regex.
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hayley>
Guest74: Nor can they. :^)
<Shinmera>
White_Flame: it's called my brain
<White_Flame>
wow, you have an artificial one? ;)
<Shinmera>
yeah I eat a lotta junk food, gotta be artificial by now.
<White_Flame>
gotta be well-preserved for those long term projects
<Guest74>
I just know I have over 50 unfinished projects, so focusing on one thing would be nice.
<White_Flame>
I've been focusing more, just have to prioritize and intentinally sacrifice projects to the indefinite back burner
<Shinmera>
I lost count of my unfinished projects :shrug:
<hayley>
Wait, you guys work on projects?
<White_Flame>
doing presentations gives a nice deadline to push through things to some semblance of releasable completion
<Shinmera>
hayley: sometimes I think about it
<Nilby>
halley: I made I grep, but it sucks. I just used ppcre. I like it better than posix re's, but I think your one-more-re-nightmare is awesome and I wish I could have used that.
<Shinmera>
White_Flame: and making the projects tiny
dre has joined #commonlisp
<hayley>
The hayley strategy: 1. work on project for 2 years 2. publish paper 3. decide no one wants it, and burn out for a year
<White_Flame>
that's why you need to work on things for yourself
<White_Flame>
however, if you're doing peer distributed stuff, that kinda gets necessary
<Guest74>
I think i spend too much time trying to tthink of what would be useful for others.
<Shinmera>
I work on things for myself, but that doesn't mean it isn't sometimes very discouraging to realise that nobody cares lol
<White_Flame>
I've come to expect it ;)
<Shinmera>
Sure, especially in a community this small
<Guest74>
and accept it
<White_Flame>
doesn't really matter the size of the community
<White_Flame>
most of my "releases" have been in retro computing, which is larger
<hayley>
I mean, I did, but now I have to hurt my head on boring and unpublisheable things like "how to not use infinite RAM while verifying objects"
<Shinmera>
making games is like 99% boring and unpublisheable things lol
<White_Flame>
yeah, most of my stuff there has been tools & libs
<White_Flame>
retro _computing_, not retro gaming ;)
Brucio-4 has joined #commonlisp
shka has quit [Ping timeout: 250 seconds]
Brucio-4 has quit [Client Quit]
<Guest74>
I wouldn't mind an apple II emulator in lisp.
VincentV` has joined #commonlisp
<Nilby>
I've always thought it's odd how much code and work goes into game engines, but what people see is the art. And few engines survive, but the art is timeless.
tyson2 has quit [Remote host closed the connection]
taiju has quit [Ping timeout: 264 seconds]
cosimone has quit [Ping timeout: 268 seconds]
VincentVega has quit [Ping timeout: 268 seconds]
asarch has quit [Quit: Leaving]
<Shinmera>
it's not that much, actually. Most game's credits have way more artists than coders.
<Shinmera>
games also always do a great job at looking a lot simpler than they are to make.
taiju has joined #commonlisp
<Guest74>
I've been wondering how hard it would be to make modules for games that could be used across projects. I don't really have an interest in writing a game engine, but I do have plans for a quest generator.
<Shinmera>
Depends on a lot of factors :)
<Guest74>
and as far as I know, yours is the only engine actually being used in a game.
<theothornhill>
I have an ast which is a deeply nested group of clos instances. If I want to inspect that ast in the repl I can use sly for that, but is there a simpler/nicer way to look at lisp datastructures?
<Shinmera>
Only if "actually being used in a game" means "a game that is currently on steam and planned to be released commercially." otherwise there's a bunch of Lisp games that are not using my engine.
thomaslewis has joined #commonlisp
<hayley>
You could write a method for PRINT-OBJECT and make the Lisp printer do the work.
<Shinmera>
maybe not print-object but describe-object.
<Shinmera>
I've done that sometimes
<Shinmera>
But typically you're going to want to write a specialised tool to do the work, because generalised tools are bound to be too clunky.
<theothornhill>
yeah, that's possible, but generates a lot of data, which easily gets messy
<Guest74>
I'm sure some would advocate for the mcclim inspector.
<theothornhill>
Yeah, I've seen that, but that looks wild
thomaslewis has left #commonlisp [#commonlisp]
<theothornhill>
also, in sly inspector, is there a way to set a slot value to a modified value of its current value?
<theothornhill>
SLOT = '(val1 va2)
<theothornhill>
lets say I want it to become a list of the first element
Oladon has joined #commonlisp
<random-nick>
CLIM has an inspector which might or might not be nicer than sly's
<White_Flame>
would expand (λ (x) (1+ x)) to (lambda (x) (1+ x))
<Nilby>
BytesAndCoffee: This is my favorite (defmacro _ (&rest exprs) `(lambda (_) (declare (ignorable _)) ,@exprs))
<Guest74>
then you just have to figure out how to write λ
<White_Flame>
BytesAndCoffee: however, lisp isn't that big on syntactic brevity, but rather allows abstraction & code generation to shorten your code structurally
NotThatRPG has joined #commonlisp
<White_Flame>
but, easily allows syntactic brevity if that's your preference
<Guest74>
It's sometimes easier to read, I've used things like (ΔC (- C1 C2))
<Guest74>
...um, within a let, not as a function
<BytesAndCoffee>
is there a way to get nth to take NIL as a 0-y value? akin to `['a', 'b'][False]` in Python returning 'a'
VincentV` has quit [Remote host closed the connection]
<BytesAndCoffee>
oh, nvm
<Nilby>
Something like (nth (or n 0) list) ?
<hayley>
But why?
epolanski has quit [Quit: Connection closed for inactivity]