freenode/#lisp - IRC Chatlog
Search
9:52:24
Demosthenex
https://bpaste.net/show/9c4e3ef16975 very exciting that croatoan's starting to add form support!
9:55:27
_death
I think the verisimilitudes guy made a good point.. and his acute-terminal-control library works OK, mostly.. I started using it for some project.. it would make sense to have a TUI library based on it
9:56:36
Demosthenex
_death: i think my issue is that while many low level terminal control libs exist, there are no tui environments. there were a few tries to make turbovision work, but they're all dead
9:58:46
_death
I know. thing is, it's not a big deal to come up with a basic TUI library.. in the DOS days, everyone wrote their own TUI/GUI libraries anyway
9:59:27
White_Flame
but there you had direct screen access, instead of sending terminal commands, too
10:00:59
_death
White_Flame: it's not very important.. you can easily come up with a "frame buffer" abstraction
10:03:43
_death
but it's not even clear that you'd want to do that.. back then you'd still have abstractions like gotoxy and friends
10:07:43
beach
I WIN! Here is what I ended up with for MAKE-METHOD and CALL-METHOD: https://pastebin.com/TaXeRVWe
10:11:49
beach
I think there is still some minor problems. The call to MAKE-INSTANCE should probably be evaluated at macro-expansion time.
10:20:11
no-defun-allowed
is there a consise way to FORMAT eight items on a line, then another eight on the next line and so on?
10:28:38
beach
So here, you must subclass GENERIC-FUNCTION and specialize your method to that new class.
10:29:55
jackdaniel
from other "the more you know" things if you create a handler-case you may want to handle serious-condition (which error inherits from), not error
10:30:19
no-defun-allowed
i had a need to make a readable signature generator kinda thing for hand checking diffie-hellman keys
10:30:22
jackdaniel
some conditions are not errors still you want to "catch" them (i.e timeout is not an error, same goes for out of memory)
10:30:38
no-defun-allowed
[so here's one, just cause i think the output is funny](https://gist.github.com/TheEmacsShibe/511b4fd71b5d9712e09b0408033a8d5b)
10:32:48
specbot
Constraints on the COMMON-LISP Package for Conforming Programs: http://www.lispworks.com/reference/HyperSpec/Body/11_abab.htm
10:33:31
beach
19. Defining a method for a standardized generic function which is applicable when all of the arguments are direct instances of standardized classes.
10:51:31
_death
Demosthenex: I think I already mentioned that some years ago I started writing bindings for it.. but my conclusion was that tvision's API was too convoluted because it adopted old C++ "OO" dogmas of the day (lots of inheritance and needless interaction within hierarchy levels) and a Lispy interface is too much work for too little
10:53:06
_death
Demosthenex: I think it's better to start afresh.. may have turbovision look and feel if you like
11:02:08
Demosthenex
_death: i could see that, but it's a shame to discard the architecture. i'd work on one, but i have so little experience with user interfaces that it'd come off shoddy
11:05:20
_death
well, I started a simple general purpose TUI thingy not long ago.. I touch it infrequently but at some point it will be good enough for Microsoft GitHub :)
11:11:26
Demosthenex
i don't care for github myself. i don't normally post code so i hadn't looked for an alternative, but i'm using hg and fossil
14:00:40
xificurC
I have malformed json, there's a \- sequence which falls through an ECASE in both cl-json and yason. The json output isn't mine and cannot change it. What would be the best aproach to combat this? There's no reasonable restarts provided since they are just an ECASE. Maybe I can wrap the stream in a stream that corrects this sequence?
14:16:22
dlowe
xificurC: the usual thing is to use regexes to fix your crummy data to fit into the parser
14:23:23
Shinmera
hacking in a restart to skip a char and continue seems easier and more robust to me
14:57:16
xificurC
skipping that I still get an error (using yason now) later on parsing an object. This seems to be getting a bit weird, e.g. jq parses all lines fine and yason chokes on the first ones. I'm reading a stream with (loop for line = (read-line stream nil nil) ...), that shouldn't alter anything right? Running cmd |& while IFS= read -r line; do jq . <<<"
15:39:27
makomo
pfdietz: right that is clear -- and now that the body has been fully expanded and the results have been computed, how does the outer macro fetch the results? does this transfer happen via global state or in some other way? you mentioned the inner macros "stashing" the results away, how?
15:42:22
pfdietz
It has to walk over the expanded form and somehow retrieve it from there. The inner macro will have placed it there in some form the outer macro's function can recognize.
15:43:46
makomo
pfdietz: i see, but i can't think of any way how it might do that, without affecting the code in the body.
15:46:19
pfdietz
Or into something that has useless but valid code. (progn (hey-look-at-this (quote ...)) <actual form>)
15:48:41
makomo
pfdietz: so when passing information top-down, it's possible to do it portably. when passing information bottom-up, i need MACROEXPAND-ALL to fully expand the body?
15:52:47
pfdietz
In practice, it's de facto portable. https://github.com/cbaggers/trivial-macroexpand-all
15:53:42
makomo
pfdietz: ok, i'll try to apply the technique to my case. thanks for taking the time to explain
15:55:31
makomo
MichaelRaskin: hello. this one should be fine since it's not a "user-level" implementation
15:56:26
makomo
MichaelRaskin: does the caveat concern the representation of environments? you mentioned it a few days ago but i didn't completely understand
15:57:52
makomo
MichaelRaskin: also, i wanted to give agnostic-lizard a go but i didn't find any comprehensive explanation of the whole thing. where should i start?
16:03:02
MichaelRaskin
The same page (bottom) contains the proceedings link, there is a write-up there
16:03:52
MichaelRaskin
I do follow the most popular way of writing a code walker, just with a few heuristics to approximate a solution to the impossible problem.
16:09:30
MichaelRaskin
Hm, quite a lot of implementations where trivial-macroexpand-all just ignores the env parameter
17:04:24
pfdietz
Is there a way in ASDF to say "if systems FOO and BAR are both loaded, then also load system BAZ"?
17:05:20
scymtym
there is a system called asdf-system-connections but it caused many problems when i tried it
17:05:29
pfdietz
The use case for this is when FOO has some special case handling in case BAR is loaded (for example, defines some methods on classes defined in BAR), but doesn't otherwise require BAR to work.
17:05:54
pfdietz
The specific use case was trying to use COVER and finding it didn't work on macros from ITERATE.
17:08:00
pfdietz
I'd want it to work if I loaded FOO before BAR, and also if I loaded BAR before FOO. When the second of the two loaded, BAZ would also be loaded.
17:10:40
Bike
"We do NOT recommend you use this feature. If you are tempted to write a system foo that weakly-depends-on a system bar, we recommend that you should instead write system foo in a parametric way, and offer some special variable and/or some hook to specialize its behaviour; then you should write a system foo+bar that does the hooking of things together."
17:14:32
whartung
but that sounds to me, pfdietz, that you’re trying to make some kind of “smart”, “universal” project. Why should the “project” figure out what your code needs. YOU know what it needs, and you know what you want it to do. So, do it. If you want BAZ loaded with FOO and BAR, then do that. Why have logic hanging around for BAZ if you’re not using BAR in the first place?
17:18:56
pfdietz
I want to be able to load COVER and have it work, without me (as the user) having to manually specify those dependencies.
17:19:32
pfdietz
And I don't want loading COVER to then cause all those other packages it has interactions with to also get loaded.
17:55:11
stylewarning
I wonder if the ASDF folks would be open to having a :LICENSE-FILE option for system definitions
17:55:45
stylewarning
That would be monumentally more orderly and convenient---at least for commercial folks---than the paltry license description in the :LICENSE argument.
18:16:04
_death
the asdf manual gives an example with :license but it's not actually specified in the grammar.. so I guess you could have :license (:file "LICENSE" :executive-summary :MIT)
18:28:26
oni-on-ion
i do a similar thing to use .cl extension, (defclass cl-file (cl-source-file) ((type :initform "cl")))
18:31:18
oni-on-ion
idk. this works for me, i was not sure of the expanded and fully resolved name. although naming the subclass cl-file does not clarify matters
18:33:27
oni-on-ion
ohhh i see what you are saying. it is already built in to asdf for .cl , sorry i did not see what you mean.
18:35:02
oni-on-ion
i've developed a particular interest in ".?l" extensions as of late -- prolog .pl, elisp .el, julia .jl, ocaml .ml - and i did not want CL to be left out. also it is semantically more practical to me when extensions are acronyms rather than full words
18:35:28
oni-on-ion
yes. i remember DOS Abuse game, my first exposure to lisp i think. unless i used emacs before this i cant recally
18:35:34
aeth
Don't use .LSP on Unix or NT-based Windows because three character file names have a ton of collisions
18:41:24
oni-on-ion
.pl is the same as perl, already github thinks some of my projects are not in prolog hehe.
18:44:24
aeth
It doesn't just go by extension. I've seen some 'Newlisp' and even some *Python* in CL projects as a false identification
20:05:35
Shinmera
pfdietz: I added my own system to handle that ASDF case. Essetially it defers evaluation and compilation of specific forms until a specified system is loaded.
20:07:38
Shinmera
In radiance all systems that can make use of this deferral must be a subclass of a special system, for which theres an asdf:perform :after method that triggers evaluation
20:09:03
Shinmera
you could add a method on the standard asdf:system, but who knows how long that would work for (since upstream could add a method of its own)
20:12:01
Shinmera
Typically in radiance you use this optional mechanism to provide extra functionality if an implementation of a certain interface is loaded. Since the interface's symbols are always available even without an implementation, symbol resolution in the optional code is also no problem
20:12:55
Shinmera
example: https://github.com/Shirakumo/radiance-contribs/blob/master/r-simple-auth/auth.lisp#L225-L241
20:15:47
Shinmera
The lack of a proper optional dependency spec in ASDF has always bothered me though. Would make this problem much easier
20:18:36
Xach
Well, this does help me in the quicklisp world, because I can statically set the dependencies.
20:19:34
Shinmera
Since then you could do something like: throw the optional code into an optional.lisp, then add (when (find "thing" (asdf:already-loaded-systems) :test #'string=) (load (merge-pathnames "optional.lisp" #.*compile-file-pathname*)))
20:22:54
Xach
Shinmera: the Old ways of doing it made it hard to discover optional dependencies. a new, explicit way would be ok though.
20:23:15
Xach
Like, you might not ever find out that system X required system Y because you never loaded X while Z was also loaded.
20:23:47
Shinmera
Well, in any case, I have a looong list of things I want from my own, future build system :)
21:28:46
jasom
fwiw quicklisp still has to dynamically resolve dependencies in many cases (one-package-per-file systems come to mind).