libera/#commonlisp - IRC Chatlog
Search
13:58:50
didi
If something is EQ+, it has to be EQ too, right? i.e., if (EQL a b), or (EQUAL a b), or (EQUALP a b), it is also true that (EQ a b), isn't it?
15:09:55
rain3
how to make asdf automatically load files specified in (uiop:define-package ... (:use-reexport #:HERE ) for systems with :class :package-inferred-system ? it is not right to have to add an extra (:import-from #:HERE)
15:18:30
rain3
that code with duplication, works. If I remove the duplicate code (the :import-from form) , asdf won't load the files any more
15:32:23
rain3
I think one the :use-reexport ed file failed to compile and instead of telling me that it failed to compile it said 'that package doesn't exist' and only after adding :import-from it would tell me 'that file doesn't compile'
15:40:19
_death
well, if you still have the failing case, you can look deeper.. as a rule giving up in debugging is bad..
15:43:58
rain3
it seems the failing case is gone for now, if it appears again I will continue investigating
17:41:14
rain3
ok. adding it doesn't fix this issue; if "asdf-package-system" should be added, the manual should be updated to specify that https://common-lisp.net/project/asdf/asdf/The-package_002dinferred_002dsystem-extension.html
17:50:06
rain3
ok I removed the newer asdf, now I am using "3.3.1" . same thing happening , any idea what's the quickest way to compile sbcl for windows 32 bit ? maybe moving to a newer version will fix this
18:04:41
_death
well, you could try with something that's not cffi.. maybe it does have something to do with this specific system
18:27:26
rain3
_death: with :alexandria instead of :cffi, the issue is gone (in the minimal example. but in the non-minimal project other related issues seem to pop up)
18:29:55
CptKirk
I'm very confused... I had a (defpackage #:my-package (:use #:cl #:april #:str)) now that doesn't work for some reason. So I used quickproject to define something for me with the (depends-on ...) property set, and when I (asdf:load-system my-system) I still can't seem to do anything
18:30:13
CptKirk
none of the functions are defined, none of the dependencies are met... idk what I'm doing wrong
18:36:10
CptKirk
I'm in the repl trying anything I can think of (apropos 'aoc-15) (aoc-15:day 2015 1) (day 2015 1)
18:37:55
Bike
if you've tried loading it before in the same image you may need to force? try (asdf:load-system whatever :force t)
18:42:22
CptKirk
So I defined a package within the system. Then from the slime repl I had to "in-package" that package name
18:44:12
Bike
Okay, so what's going on here is that your "solutions" package does not _export_ the given symbols
18:47:19
Bike
particularly, nothing you do to your defpackage form is going to change how asdf loads the system
18:50:22
CptKirk
no, I did the quickproject from the slime repl, then I did asdf load. then I messed around, and then slime-restart. now I can't asdf-load
18:50:22
lotuseater
yeah when you symlink the .asd file to the local-projects dir you can ql:quickload the system
18:51:02
Bike
okay. i think quickproject might add it to the configuration, and it's not doing that now. so do local projects instead, probably.
18:53:13
lotuseater
but when slime is reset i would assume the path gets set to default as a sideeffect so asdf can't see it anymore with a relative path string
18:55:39
Bike
CptKirk: I know basically nothing about april, but is that not because you don't execute the april-load until day1 is called?
18:56:19
CptKirk
yes, while technically that's not correct, I also need to figure out how to load the april file dynamically because I'm constantly working in that file
18:59:14
CptKirk
I wonder if its because its in the `solutions` package if there's something wrong with the namespace reference
19:02:29
pjb
CptKirk: Note: (package-name (defpackage :foo)) #| --> "FOO" |# (asdf:component-name (asdf:defsystem :foo)) #| --> "foo" |#
19:02:46
pjb
CptKirk: by default, package names are uppercase strings, while system names are lowercase strings!
19:03:50
pjb
CptKirk: of course you can do (package-name (defpackage :|MixedCase|)) #| --> "MixedCase" |# but this doesn't work for system names that remains in lowercase: (asdf:component-name (asdf:defsystem :|MixedCase|)) #| --> "mixedcase" |#
19:04:11
pjb
For systems, you have to use a string: (asdf:component-name (asdf:defsystem "MixedCase")) #| --> "MixedCase" |#
19:04:44
pjb
This may also pose problem when trying to find the asd file, since some file systems are case-sensitive, and some are not…
19:08:04
pjb
CptKirk: Should we assume ⍝ is a reader macro that switch to APL syntax? and that APL is case sensitive? when you do (defun day1 …) above, what is actually read, assuming the default *readtable*, is (CL:DEFUN SOLUTIONS:DAY1 …) On the other hand, when you read day1←{…} I suppose that what is read there is SOLUTIONS:|day1| an entirely different symbol.
19:08:56
pjb
CptKirk: So depending on where you read the symbol, and what (READTABLE-CASE *READTABLE*) setting you have at the time of reading, you will want to use uppercase or lowercase and perhaps force the case using |day1| or |DAY1A|.
19:10:07
CptKirk
`The variable APRIL-WORKSPACE-COMMON::|day1| is unbound.` This makes me think that this is somehow relative to the package its in
19:11:31
CptKirk
I don't think your projects organization is described in aprils docs. This seems to be a problem with how my project is arranged more than anything
19:11:48
pjb
Also, if just loading april switches to an apl readtable, this is bad. Switching readtables should be done explicitely, at run-time, not at load time…
19:14:03
CptKirk
yes I know that's not the right way to do things with `(eval '(april-load #P"file"))` but at the same time, I've said this a few times now, when I'm working in the loaded file, its rather annoying to have to not only recompile the input file, but also reevaluate the expression which uses the names exported from the compilation
19:14:24
CptKirk
I would move this somewhere else once `day1` actually returns the correct solutions
19:14:54
CptKirk
I don't actually need to dynamically compile the APL input for the program to run, I just need it for development
19:15:05
CptKirk
if you know of any alternative development patterns for this sort of thing, I'm all ears
19:17:50
pjb
CptKirk: I mean (asdf:load-system "aoc-15) (solutions:day1) ; the aoc-15 system loads the april system.
19:20:17
pjb
(apl-repl) RET and then you can enter apl expressions at the REPL, without havint to reload a file.
19:26:12
pjb
Why should it accept only single line expressions? a lisp repl can take multiple lines.
19:26:55
pjb
This can also be done with stranger syntax, by repeating reading until a syntactically complete expression is read.
19:28:02
moon-child
CptKirk: there's no reason you can't have an apl repl that accepts multi-line expressions
19:28:08
pjb
It's a matter of user interface there. Things are different in a bare terminal, than eg. in emacs with slime.
19:28:33
CptKirk
no there isn't... but I don't think this is a useful approach to wanting to dynamically load the file with april
19:28:41
pjb
In emacs, we can edit multi-line input without sending it (ie. using C-RET to insert a new line without sending the input to the swank process).
19:28:56
CptKirk
moon-child and also it was difficult enough that Dyalog didn't add EXPERIMENTAL multiline expressions in the REPL until version 18
19:31:02
pjb
For asdf, you could define a specific class of apl file, with a specific function to compile and load them.
19:31:10
Bike
you'd have to define a custom component type. people do it with grovel files and stuff. i haven't done it enough to know the details.
19:32:00
pjb
Not only once, but it would reload it when needed because of changes on the file or its dependencies.
19:32:47
pjb
And indeed, Defining an C-c C-k (or C-c C-l) in apl-mode hooked to april could be nice.
19:33:04
Bike
asdf doesn't have anything like watching for filesystem changes, far as i know. you'd still have to hit the reload command somewhere
19:33:20
CptKirk
but it isn't "hooked to april" its "hooked to my lisp code" because that's where april is called
19:33:45
CptKirk
not only do I need 3 buffers open, one for apl to edit, 1 for lisp to recompile, and one for slime, its annoying
19:36:08
Bike
well, if you make the apl file part of the system, you could just use the asd system reload function and get both the apl and the lisp reloaded.
19:38:59
Bike
https://common-lisp.net/project/cffi/manual/html_node/Groveller-ASDF-Integration.html here's what it looks like for grovel files
19:39:24
Bike
the definitions to make it work are here https://github.com/cffi/cffi/blob/master/grovel/asdf.lisp
19:40:39
Bike
phantomics or someone might be interested in doing the work, since it seems like a useful way to use april
19:45:10
CptKirk
Then I could specify the files, their workspaces, and have all those names aviailable on load
19:46:53
CptKirk
then the solutions would just be like... `(defsol ws.day1)` which would be a macro to call the function day1 in workspace ws using april
19:49:42
CptKirk
how does that file get loaded and definitions available before asdf finishes loading?
19:50:44
Bike
it tells asdf to load the cffi-grovel system before even starting to deal with the example-software system definition
19:55:56
Bike
:defsystem-depends-on ("cffi-grovel") tells asdf to find and load the system named cffi-grovel
19:56:43
Bike
usually packages have about the same names as the system defining them, but that's not required and asdf doesn't care either way
19:57:48
phantomics
Just read the chat here, getting asdf integration for April is something I'll look into
20:17:58
CptKirk
@bike it appears that this works because the output of the files in question are lisp source files
20:18:44
Bike
isn't it? i thought it was an apl-to-lisp compiler. but even if it isn't, i think you can tell asdf to do arbitrary things to "load" a file
20:21:58
Bike
i see asdf itself defines a java-source-file component type, though it doesn't seem to do much
20:38:04
phantomics
Bike: April doesn't produce Lisp files, it directly compiles and evals code. Do you know if asdf extensions can be used to do things that compile Lisp code directly rather than producing Lisp code that is fed to asdf?
20:38:34
Bike
I am reasonably sure that you can tell asdf to do literally anything in as a "load" action.
20:39:20
Bike
so you could for example just have it call this april-load function kirk is using, probably
20:41:57
Bike
https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations i think what you would do is something like (defmethod perform ((op load-op) (component april-file)) ...)
20:58:57
CptKirk
ok I'm getting super peeved. I just created a blank quickpackage:make-package and it can't compile
20:59:56
CptKirk
`(quickproject:make-project #P"/mnt/c/d/aoc/cl" :name "apl-load" :depends-on '(april))
21:00:26
CptKirk
so I made the project, I symlinked to the local-projects folder just as I did before
21:09:31
etimmons
Hmmm, there goes that idea. But I'm surprised ASDF isn't giving you any other information than what you've copied
21:16:05
CptKirk
nice, I got the pattern working for creating a new component and then doing stuff with it
21:49:16
CptKirk
https://common-lisp.net/project/cl-mathstats/documentation/asdf-package/generic-efunction-perform.html
22:01:17
Bike
CptKirk: #1=aoc-15 ... #1# means that the #1# is also aoc-15. like #<ASDF/USER::APRIL-FILE aoc-15 "15.apl">
22:02:27
Bike
what this error means is that asdf expects something to be either a string, a pathname, or a file stream, but you gave it an april-file object instead
22:04:52
CptKirk
https://common-lisp.net/project/cl-mathstats/documentation/asdf-package/class-source--file.html
22:05:24
Bike
okay. so look at this page here. See how, next to name, it says "Accessors: component-name"
22:17:08
CptKirk
I don't know how you're supposed to just know HOW to use something from someone giving you a picture of it