libera/#commonlisp - IRC Chatlog
Search
12:41:13
lotuseater
nice :) I had also get used to that LAST returns a list rather than the element alone
12:42:16
hayley
I recall the book Land of Lisp did mention that exact use-case for LAST returning the last cons cell, funnily enough.
12:44:48
Cymew
I might be weird, but I actually think "(setf (car (last list)) 3)" is clearer than last-elt as it forces you to think through the procedure in details. There are a few gotchas in that one.
12:46:09
jackdaniel
you may open code most setf expansions too to better understand low-level operations
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.