jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.5, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
Demosthenex has quit [Ping timeout: 268 seconds]
Demosthenex has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
LiamH has quit [Quit: Leaving.]
Guest12374 has quit [Ping timeout: 252 seconds]
dale has quit [Quit: dale]
jack_rabbit has joined #lisp
<no-defun-allowed> s/good discussions/jabs at OP cause they're a dick/g
<aeth> no-defun-allowed: Well, I said the discussion (in the reddit comments) was good, not the OP article.
<no-defun-allowed> that's true
<aeth> It's the most popular thread since yesterday's discussion of ITERATE in the LOOP thread, but I suspect it'll pass it very soon.
<no-defun-allowed> oh shit, i started that?
<aeth> With 43 comments already the gamedev thread is well on the way to be the most commented. 60 might do it, at least sorting by top all time and looking at the comment count (and, hey, unlike the Arc forums, I don't get banned for quickly going through thread listings!)
<no-defun-allowed> haha
<aeth> no-defun-allowed: and no /u/theangeryemacsshibe started the ITERATE thread
<no-defun-allowed> that's me actually
dddddd has quit [Remote host closed the connection]
lmy9900 has joined #lisp
<no-defun-allowed> never heard of the "don't use :USE" mentality except from beach though
<aeth> what about from me?
<aeth> And my style is pretty different from beach's!
<no-defun-allowed> just a moment
<no-defun-allowed> ah, you use :IMPORT-FROM
<aeth> yes
lmy9900_ has joined #lisp
<aeth> For the most part, I only :USE other packages in the same system.
<aeth> (And CL, obviously)
<no-defun-allowed> i probably should, i like that as a compromise between "i hate typing" and "oh god not another symbol collision"
<aeth> Shadowing also works... but that's not going to help you if it's a *future* conflict.
<aeth> Libraries shouldn't be able to break user code.
<no-defun-allowed> iirc in netfarm there's some packages required that do collide so i'll clean that up soonish
lmy9900 has quit [Ping timeout: 250 seconds]
<no-defun-allowed> i have more important things to redo in that right now though
fikka has quit [Ping timeout: 250 seconds]
xkapastel has joined #lisp
<PuercoPop> no-defun-allowed: yeah, I though of beach as well when they mentioned don't use :use, but the only package-per-file style also advocates for explicit import statements
nirved has quit [Ping timeout: 252 seconds]
Essadon has quit [Read error: Connection reset by peer]
smokeink has joined #lisp
lmy9900 has joined #lisp
makomo has joined #lisp
lmy9900_ has quit [Ping timeout: 268 seconds]
<no-defun-allowed> i'm not sure about package-per-file though
makomo has quit [Client Quit]
lmy9900__ has joined #lisp
patrixl has quit [Read error: Connection reset by peer]
lmy9900 has quit [Ping timeout: 250 seconds]
nirved has joined #lisp
lmy990___ has joined #lisp
<aeth> no-defun-allowed, PuercoPop: Package per file works best when the project is very, very, very large. Most Lisp libraries and applications aren't like that, and the largest ones are probably Lisp implementations, which probably can't use that style while implementing the things that defpackage requires.
lmy9900__ has quit [Ping timeout: 240 seconds]
lmy9900__ has joined #lisp
lmy99____ has joined #lisp
lmy990___ has quit [Ping timeout: 246 seconds]
lmy990___ has joined #lisp
lmy9900__ has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
lmy99____ has quit [Ping timeout: 268 seconds]
lmy9900__ has joined #lisp
lmy99____ has joined #lisp
lmy990___ has quit [Ping timeout: 250 seconds]
lmy990___ has joined #lisp
lmy9900__ has quit [Ping timeout: 244 seconds]
lmy99____ has quit [Ping timeout: 268 seconds]
lmy990___ has quit [Ping timeout: 252 seconds]
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
Lycurgus has joined #lisp
lmy9900__ has joined #lisp
lmy990___ has joined #lisp
lmy9900 has quit [Ping timeout: 268 seconds]
lmy9900_ has quit [Ping timeout: 244 seconds]
lmy9900__ has quit [Ping timeout: 250 seconds]
adolby has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
adolby has joined #lisp
lmy9900 has joined #lisp
lmy990___ has quit [Ping timeout: 246 seconds]
milanj has quit [Quit: This computer has gone to sleep]
adolby has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
esrse has joined #lisp
arescorpio has joined #lisp
adolby has joined #lisp
emar has quit [Ping timeout: 250 seconds]
adolby has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
Arcaelyx has joined #lisp
dale has joined #lisp
lmy9900_ has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
lmy990___ has joined #lisp
lmy9900 has joined #lisp
lmy9900_ has quit [Ping timeout: 246 seconds]
lmy990___ has quit [Ping timeout: 246 seconds]
lmy9900_ has joined #lisp
emar has joined #lisp
arescorpio has quit [Remote host closed the connection]
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
lmy9900_ has quit [Ping timeout: 268 seconds]
impulse has quit [Quit: Lost terminal]
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 250 seconds]
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 240 seconds]
dorketch has joined #lisp
lmy9900 has joined #lisp
lmy9900_ has quit [Ping timeout: 244 seconds]
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 250 seconds]
panji has joined #lisp
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
graphene has quit [Remote host closed the connection]
lmy9900_ has quit [Ping timeout: 246 seconds]
lmy9900 has joined #lisp
graphene has joined #lisp
lmy990___ has joined #lisp
lmy9900__ has quit [Ping timeout: 250 seconds]
arescorpio has joined #lisp
lmy9900 has quit [Ping timeout: 246 seconds]
arescorpio has quit [Max SendQ exceeded]
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
robotoad has joined #lisp
lmy990___ has quit [Ping timeout: 246 seconds]
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 268 seconds]
lmy9900_ has quit [Ping timeout: 250 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
lmy9900 has joined #lisp
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
arescorpio has joined #lisp
lmy9900__ has quit [Ping timeout: 244 seconds]
troydm has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
<beach> Good morning everyone!
<beach> emaczen: Thanks. I think I found it.
Bike has quit [Quit: Lost terminal]
dorketch has quit [Quit: WeeChat 2.1]
Lycurgus has quit [Quit: Exeunt]
emaczen has quit [Quit: ERC (IRC client for Emacs 26.1)]
nirved has quit [Ping timeout: 252 seconds]
arescorpio has quit [Remote host closed the connection]
lmy9900 has joined #lisp
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
lmy990___ has joined #lisp
jasmith has joined #lisp
shka_ has joined #lisp
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 246 seconds]
lmy99____ has joined #lisp
lmy990___ has quit [Ping timeout: 250 seconds]
lmy9900 has quit [Ping timeout: 240 seconds]
lmy9900_ has quit [Ping timeout: 268 seconds]
lmy99____ has quit [Ping timeout: 246 seconds]
dale has quit [Quit: dale]
lmy9900 has joined #lisp
panji has quit [Ping timeout: 245 seconds]
lmy9900_ has joined #lisp
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 244 seconds]
sauvin has joined #lisp
lmy9900 has joined #lisp
lmy9900_ has quit [Ping timeout: 250 seconds]
lmy990___ has joined #lisp
lmy9900__ has quit [Ping timeout: 246 seconds]
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 245 seconds]
lmy9900 has joined #lisp
lmy990___ has quit [Ping timeout: 268 seconds]
lmy9900__ has quit [Ping timeout: 240 seconds]
lmy9900_ has joined #lisp
lmy9900 has quit [Ping timeout: 245 seconds]
lmy9900_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marusich has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #lisp
marusich has quit [Quit: Leaving]
Inline has quit [Quit: Leaving]
jochens has joined #lisp
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
jochens has quit [Ping timeout: 268 seconds]
lmy9900 has quit [Ping timeout: 246 seconds]
lmy9900 has joined #lisp
lmy990___ has joined #lisp
lmy99____ has joined #lisp
lmy9900_ has quit [Ping timeout: 244 seconds]
lmy9900_ has joined #lisp
lmy9900 has quit [Ping timeout: 268 seconds]
lmy990___ has quit [Ping timeout: 250 seconds]
lmy99____ has quit [Ping timeout: 268 seconds]
lmy9900__ has joined #lisp
lmy990___ has joined #lisp
lmy9900_ has quit [Ping timeout: 250 seconds]
lmy9_____ has joined #lisp
drl has joined #lisp
lmy9900__ has quit [Ping timeout: 240 seconds]
lmy990___ has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
shka_ has quit [Ping timeout: 250 seconds]
lmy9900_ has joined #lisp
lmy9_____ has quit [Ping timeout: 240 seconds]
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 268 seconds]
lmy9900_ has quit [Ping timeout: 245 seconds]
lmy9900 has joined #lisp
lmy9900__ has quit [Ping timeout: 244 seconds]
lmy9900_ has joined #lisp
elderK has quit [Quit: Connection closed for inactivity]
lmy990___ has joined #lisp
lmy9900 has quit [Ping timeout: 272 seconds]
lmy9900 has joined #lisp
lmy9900_ has quit [Ping timeout: 244 seconds]
lmy9900_ has joined #lisp
lmy990___ has quit [Ping timeout: 240 seconds]
cyraxjoe has quit [Read error: Connection reset by peer]
cyraxjoe has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
lmy9900__ has joined #lisp
lmy990___ has joined #lisp
lmy9900_ has quit [Ping timeout: 246 seconds]
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 246 seconds]
Kaisyu has joined #lisp
lmy990___ has quit [Ping timeout: 250 seconds]
lmy9900__ has joined #lisp
lmy9900_ has quit [Ping timeout: 246 seconds]
lmy9900 has joined #lisp
kristof has joined #lisp
lmy9900_ has joined #lisp
<kristof> Does anyone know of any discussion on why MAKE-PACKAGE takes a string designator and not a symbol-designator? I thought I read something by kent pitman once but I can't remember...
<White_Flame> packages aren't named by symbol
<kristof> That's the real question I'm asking ;)
<White_Flame> why would it need to be anything more than a string?
lmy990___ has joined #lisp
<White_Flame> what would the package of the naming symbol do? if it's ignored, then a string is appropriate
<kristof> it would intern the symbol and set it's PACKAGE-VALUE (does not exist, I know) to # <PACKAGE ...>
lmy9900__ has quit [Ping timeout: 250 seconds]
<White_Flame> different symbols can have the same name. different packages cannot. package names are not namespaced
<White_Flame> symbols are for namespacing
<kristof> right, there would be a clear advantage to using symbols instead of strings so that packages could be namespaced
<beach> kristof: If a package were named by a symbol, what would be the package of that symbol?
<White_Flame> (well, and for holdling values, etc. but a symbol as a name is because it can be namespaced and locally interned)
<White_Flame> kristof: yes, nested packages would be nice
<kristof> beach: whatever *PACKAGE* is when you DEFPACKAGE.
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 252 seconds]
<kristof> oh, I think I remember what it is that I read. kent said he (often) writes his own machinery on top of defpackage that "does what he wants", and he detailed some specifics in a usenet post somewhere
<pillton> kristof: Post the link when you find the article.
<pillton> kristof: Please.
<kristof> I think I saw you in the thread!
<kristof> lol
lmy9900_ has quit [Ping timeout: 268 seconds]
<pillton> Me?
<kristof> you're kenny, aren't you?
<pillton> No.
<kristof> mistake identity, sorry.
<kristof> *mistaken.
lmy990___ has quit [Ping timeout: 246 seconds]
<beach> Oh, pillton, kilton.
<pillton> Hmm.. I don't think I am ... (how do I put this) ... as forth coming as kenny is.
<beach> :)
drewes has joined #lisp
lmy9900_ has joined #lisp
lmy990___ has joined #lisp
lmy9900__ has quit [Ping timeout: 252 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
lmy9900__ has joined #lisp
lmy9900_ has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
lmy990___ has quit [Ping timeout: 250 seconds]
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 244 seconds]
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
kristof has quit [Remote host closed the connection]
lmy9900 has joined #lisp
lmy9900_ has quit [Ping timeout: 250 seconds]
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 246 seconds]
lmy9900 has quit [Ping timeout: 240 seconds]
lmy990___ has joined #lisp
Jesin has quit [Ping timeout: 246 seconds]
lmy9900_ has quit [Ping timeout: 250 seconds]
<phoe> Is there a format control that will automatically print ordinals? As in, 1 -> "1st", 2 -> "2nd", ...
<beach> No, but you can get "first", "second", etc.
<no-defun-allowed> ~:r makes first, second, and so on
<LdBeth> make 1st 2nd 3rd 11th 12th 14th and the rest are simple
lmy9900 has joined #lisp
lmy990___ has quit [Ping timeout: 240 seconds]
lmy990___ has joined #lisp
lmy9900 has quit [Ping timeout: 246 seconds]
lmy9900 has joined #lisp
shrdlu68 has joined #lisp
lmy9900__ has joined #lisp
lmy990___ has quit [Ping timeout: 240 seconds]
vlatkoB has joined #lisp
lmy9900__ has quit [Client Quit]
chens has joined #lisp
lmy9900 has quit [Ping timeout: 272 seconds]
elderK has joined #lisp
<elderK> Moin all!
<no-defun-allowed> morning elderK
<elderK> Hey defun! :)
<shka__> good morning
<shrdlu68> 'morning
hajovonta has joined #lisp
<hajovonta> hi
<no-defun-allowed> hi
actuallybatman has quit [Ping timeout: 250 seconds]
<elderK> Guys, do the :type specifiers have any teeth wrt to classes or structures?
<elderK> Are they just like, the same as most Lisp stuff: Information that an implementation can use but may not.
<elderK> Like, experimentally, it seems that SBCL does care about about the :type specified for a structural slot.
<elderK> I haven't tested wrt instances of classes, though.
<elderK> And of course, just because SBCL uses them, doesn't necessarily mean other implementations do.
drl has quit [Quit: Ex-Chat]
<elderK> Yeah, "It is implementation dependent whether ...."
<flip214> elderK: what did you test to find out SBCL doesn't care?
<hajovonta> he wrote it does care
<elderK> flip214: SBCL /does/ care.
<flip214> what are your DEBUG, SAFETY, and SPEED settings?
<flip214> ah yes, it _does_ care.
yvy has joined #lisp
<flip214> but why are you asking about :type specifiers then, if you already see that SBCL uses them?
scottj has quit [Quit: leaving]
<elderK> flip214: Because SBCL is a single implementation.
<elderK> What it does is not necessarily what all do.
TMA has quit [Ping timeout: 268 seconds]
TMA has joined #lisp
<jackdaniel> you've said it: it is implementation dependent behavior
<jackdaniel> so you have no guarantees whatsoever
<elderK> Okay, thank you.
<elderK> Just wanted to verify that with others :)
angavrilov has joined #lisp
rumbler31 has joined #lisp
shymega has quit [Quit: Ciao.]
lmy9900 has joined #lisp
edgar-rft has joined #lisp
lmy9900_ has joined #lisp
<shka__> sbcl's type errors are rather neat devolping helper, allowing you to realize quicker that you messed up types
<hajovonta> what is a devolping helper? I can't resolve that :)
frgo_ has quit [Remote host closed the connection]
<shka__> so it is useful even despite being non portable
kushal has quit [Excess Flood]
kajo has quit [Ping timeout: 260 seconds]
<shka__> hajovonta: sbcl with safety high enough will verify standard-object slot types
<shka__> and will signal type error if verification fails
<no-defun-allowed> hajovonta: a good spoonerism
<no-defun-allowed> ... rather neat helping developer, allowing ...
<shka__> what the heck is 'spoonerism'?
<shka__> eh, i should go back to work :/
lmy99____ has joined #lisp
<hajovonta> lol
<hajovonta> confusing conversation we have here :)
lmy9900 has quit [Ping timeout: 252 seconds]
kajo has joined #lisp
<no-defun-allowed> a spoonerism is when parts but not all of two words get switched
<no-defun-allowed> so if you have a word AB and a word CD, the words CB and AD are produced
lmy9900_ has quit [Ping timeout: 246 seconds]
<shka__> why it is called spoonerism?
<beach> A man's name.
<beach> Spooner.
<no-defun-allowed> reverend william archibald spooner spoke those a lot
lmy9900__ has joined #lisp
rumbler31 has quit [Remote host closed the connection]
lmy990___ has joined #lisp
<flip214> shka__: elderK: for another nice sbcl feature, try (setf sb-ext:*derive-function-types* t)
lmy99____ has quit [Ping timeout: 250 seconds]
shymega has joined #lisp
lmy99____ has joined #lisp
kooga has joined #lisp
kooga has quit [Read error: Connection reset by peer]
lmy9900__ has quit [Ping timeout: 252 seconds]
lmy990___ has quit [Ping timeout: 268 seconds]
smokeink has quit [Remote host closed the connection]
lmy9900_ has joined #lisp
Jesin has joined #lisp
shrdlu68 has quit [Ping timeout: 246 seconds]
lmy99____ has quit [Ping timeout: 272 seconds]
robotoad has quit [Quit: robotoad]
nirved has joined #lisp
lmy9900 has joined #lisp
heisig has joined #lisp
lmy9900__ has joined #lisp
varjag has joined #lisp
lmy990___ has joined #lisp
lmy9900_ has quit [Ping timeout: 250 seconds]
lmy9900 has quit [Ping timeout: 244 seconds]
lmy9900__ has quit [Ping timeout: 250 seconds]
kushal has joined #lisp
jochens has joined #lisp
jochens has quit [Read error: Connection reset by peer]
jochens_ has joined #lisp
flip214 has quit [Read error: Connection reset by peer]
lmy99____ has joined #lisp
lmy990___ has quit [Ping timeout: 268 seconds]
lmy990___ has joined #lisp
jochens_ has quit [Read error: Connection reset by peer]
jochens has joined #lisp
lmy99____ has quit [Ping timeout: 268 seconds]
lmy990___ has quit [Ping timeout: 240 seconds]
lmy9900 has joined #lisp
hhdave has joined #lisp
lmy9900_ has joined #lisp
lmy9900__ has joined #lisp
smokeink has joined #lisp
hhdave has quit [Ping timeout: 268 seconds]
lmy9900 has quit [Ping timeout: 272 seconds]
lmy9900_ has quit [Ping timeout: 250 seconds]
actuallybatman has joined #lisp
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 272 seconds]
fikka has quit [Ping timeout: 268 seconds]
lmy9900 has joined #lisp
lmy9900_ has quit [Ping timeout: 244 seconds]
fikka has joined #lisp
lmy9900_ has joined #lisp
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
lmy990___ has joined #lisp
lmy9900_ has quit [Ping timeout: 240 seconds]
lmy9900 has joined #lisp
lmy9900__ has quit [Ping timeout: 244 seconds]
<splittist> morning
lmy990___ has quit [Ping timeout: 250 seconds]
flip214 has joined #lisp
<beach> Hello splittist.
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 240 seconds]
eminhi has joined #lisp
lmy990___ has joined #lisp
Mr-Potter_ has joined #lisp
lmy9900 has joined #lisp
jmercouris has joined #lisp
lmy9900__ has quit [Ping timeout: 250 seconds]
lmy9900__ has joined #lisp
lmy990___ has quit [Ping timeout: 246 seconds]
lmy990___ has joined #lisp
lmy9900 has quit [Ping timeout: 268 seconds]
h11 has quit [Quit: The Lounge - https://thelounge.github.io]
lmy9900__ has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
quipa has joined #lisp
lmy990___ has quit [Ping timeout: 250 seconds]
<elderK> Guys, is there anything obscenely wrong with this?: https://pastebin.com/DBH2MRBg
<elderK> To me, it feels obscene.
<shka__> elderK: wow
<shka__> elderK: you can use check-type macro to test types (first of)
lmy99____ has joined #lisp
lmy9900 has quit [Ping timeout: 268 seconds]
<Xof> you're not checking for invalid keywords (something that's not :type/:accessor/:count)
<elderK> Xof: No, I'm not. That would be a good idea.
<elderK> Xof: Still, this is horrible enough without adding more. So the question is, how to do this in a cleaner way?
<elderK> I have been studying Xerox' PCL as well as Closette.
xkapastel has joined #lisp
<elderK> They seem to do a similar thing.
<shka__> elderK: move checks to separate functions
<elderK> shka__: I initially had slot-name-valid-p and such
lmy9900_ has quit [Ping timeout: 250 seconds]
<Xof> well, to what extent do you really care about more-than-one :accessor given?
<elderK> shka__: Validation was done by those functions. Same with slot-count-valid-p and such
themsay has joined #lisp
<shka__> elderK: that seems to be better, also when type mismatches, you signal type-error specificly
drewes has quit [Quit: Textual IRC Client: www.textualapp.com]
figurelisp has joined #lisp
<elderK> shka__: The problem with using check-type here, is that they will have to look at the backtrace to know "Oh, right, COUNT is meant to be an integer..."
<elderK> Other than the documentation.
<Xof> you could try (destructuring-bind (&rest sdlist &key (accessor (error ":accessor not supplied")) ...) (assert (= (length sdlist) 6)) (check-type accessor symbol) ...)
<shka__> ok
<Xof> (approximately)
<elderK> Xof: I was using destructuring-bind previously. But it felt too... adhoc.
<shka__> elderK: honestly i don't think that this is all that horrible
<shka__> at least you are DOING the check ;-)
<elderK> Like, if the slot description was blatantly foobar, then you'd get a destructuring error, rather than something meaningful.
<flip214> elderK: would you prefer a runtime or a compiler macro expansion?
lmy9900 has joined #lisp
<elderK> flip214: A function like this would be used during macro expansion. It would be one of many helpers.
themsay has quit [Read error: Connection reset by peer]
<elderK> In general though, I guess... like, I'm unsure of how aggressively to test such... stuff. Like, I could just do what many other systems appear to do: Just assume the client uses the macro as documented.
<shka__> elderK: what i like to do in situations like this is to pack relevant arguments into some sort of object and perform check in initialization-instance
themsay has joined #lisp
<elderK> But that makes me feel uneasy.
<shka__> but this may not be the better way
lmy9900_ has joined #lisp
themsay has quit [Read error: Connection reset by peer]
<elderK> shka__: Well, you would still need to destructure the input list, so to construct an instance of whatever "parameter pack" Object you had.
themsay has joined #lisp
<elderK> I tried actually just say, funcalling a function and using the slot-description as raw arguments. But then, a malformed slot-desc would generate an error when that function was called.
<flip214> elderK: well, I guess I'd just check whether the slot description has the same length after REMOVE-DUPLICATES, and then do a DESTRUCTURING-BIND with (ERROR) defaults.
<elderK> Maybe it doesn't matter. Maybe people will just see the BT and be like, oh, right.
<shka__> elderK: yes, but i am always trying to play around that so i can just apply #'make-instance arguments
<shka__> again, it may be not the better way to do it
chens has quit [Remote host closed the connection]
<shka__> but it somewhat works for me
<elderK> flip214: You mean handler-case around the destructuring-bind? But then, you'd be signalling an error while validating the stuff that was successfully destructured.
lmy99____ has quit [Ping timeout: 240 seconds]
<flip214> elderK: or you just go the default lisp way and allow overriding of such slot definitions with key/value pairs in earlier positions...
<elderK> Unless you say, broke it apart: destructure-slot-description and validate-slot-description
<elderK> *break
shrdlu68 has joined #lisp
<flip214> then there's no need to check for duplicates at all, just GETF the required arguments from the spec.
<elderK> flip214: Right, but then you'd still accept junk.
<elderK> (slot-name :fuzzbar 123 :accessor zug :accessor foo :count 'a :count 9)
lmy9900 has quit [Ping timeout: 272 seconds]
<flip214> elderK: no, I meant (DESTRUCTURING-BIND (&key (accessor (ERROR "no accessor")) (count (ERROR "..."))) spec ... )
<elderK> As long as the final "value" was sane, it would be happy. And you wouldn't be checking for invalid keywords.
<elderK> flip214: Right. The thing is, if you wrapped that in handler-case, you'd have to tease out the difference between a destructuring error, and a validation error.
lmy9900 has joined #lisp
<elderK> And you'd still need to validate that say, count was a non-zero unsigned integer and the like.
<elderK> Out of curiosity, what is the convention for functions that validate something, but are not expected to return if the validation fails?
<elderK> AMOP uses "ensure-...."
<flip214> elderK: these errors are compile-time only, aren't they?
<elderK> Yes.
<elderK> I was thinkign of simply: validate-slot-name. It would return the name if it was valid, and signal an error otherwise.
<flip214> well, so there's no real need to handle the errors - the developer will see the backtrace and can act accordingly?
<elderK> flip214: Yeah, but that feels really horrible. Is that the usual... idiom?
<elderK> I mean, it'd certainly simplify my life..
<elderK> :P
<flip214> elderK: just as additional data point, CLOS allows to specify multiple :accessors....
<elderK> flip214: I'm ware.
<elderK> *aware
lmy9900__ has joined #lisp
lmy9900_ has quit [Ping timeout: 240 seconds]
<flip214> elderK: well, in my experience having a good (ERROR "I expect :accessor to be a SYMBOL!") message and the backtrace
<elderK> Take for instance, defclass itself. If you say, provide it random keywords or say, something foobar like (name :accessor)
<flip214> is 97% of what a developer needs in such a case.
<elderK> It gives you a meaningful error.
<elderK> It doesn't just say "NOT A PLIST!"
<elderK> (which Alexandria's doplist will signal)
<flip214> elderK: well, how about defining a struct type instead of the 4 variables, setting them as the arguments come in, and then just check SLOT-BOUNDP?
<elderK> Sure. But now you have to generate a meaningful name for such a structure.
<flip214> that would at least move the "no ... specified" into one loop, and the "already given" can be checked the same way
<elderK> Not to mention allocate it.
<elderK> I'm going to try an alternative idea. I'll post it shortly, if that's okay/
<elderK> I really do appreciate the input, guys.
<flip214> well, allocating that structure isn't much different from having the 4 variables - both can be done on the stack.
<elderK> flip214: Naming the structure would be more difficult :P
lmy9900 has quit [Ping timeout: 250 seconds]
<elderK> It's like, should parse-slot-description return a slot-description object? Or should it simply return the stuff it parsed?
<elderK> I've considered both.
lmy990___ has joined #lisp
drewes has joined #lisp
lmy9900__ has quit [Ping timeout: 250 seconds]
<_death> when the end user is a programmer, there's no need to obfuscate your code with so many checks.. and then, you're bound to miss some, for example (:accessor foo :type bar :count 1 42 "hi") .. for common errors or something particularly nasty it's ok
lmy9900_ has joined #lisp
lmy990___ has quit [Ping timeout: 250 seconds]
<flip214> elderK: how about this slight modification? https://pastebin.com/biA7sv1E
<flip214> at least repeated code is eliminated.
quipa has quit [Remote host closed the connection]
lmy9900 has joined #lisp
quipa has joined #lisp
<_death> and I don't understand why you don't use check-type
lmy9900__ has joined #lisp
actuallybatman has quit [Ping timeout: 250 seconds]
lmy9900_ has quit [Ping timeout: 246 seconds]
hhdave has joined #lisp
<elderK> _death: Because I'm not sure how... well, friendly, errors should be.
milanj has joined #lisp
<elderK> I mean, if say, the error signalled by destructuring-bind is good enough, then fine.
<_death> elderK: note that check-type can take a type string..
<_death> elderK: and for other kinds of checks you can use assert
lmy9900 has quit [Ping timeout: 250 seconds]
Kaisyu has quit [Quit: Connection closed for inactivity]
lmy9900 has joined #lisp
lmy9900__ has quit [Ping timeout: 250 seconds]
lmy9900_ has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
lmy9900_ has quit [Client Quit]
fikka has joined #lisp
<elderK> How about something like this, https://pastebin.com/zkBWxDbA
<elderK> I'm not sure if this is any better.
lmy9900 has quit [Ping timeout: 268 seconds]
<elderK> _death: My problem isn't like, that I am unaware of assert and check-type and stuff. But rather, I'm not sure how I /should/ signal errors regarding to the use of say, whatever macro I create.
<elderK> From the code I've studied, it doesn't seem to be all that common that people really verify their macros are being used correctly.
<elderK> If that's the like, general idiom. Then cool, I'll do that.
<elderK> But it feels weird :P
<elderK> I mean after all, defclass and stuff seem to properly validate things.
<elderK> Although Closette doens't seem to :)
fikka has quit [Ping timeout: 252 seconds]
phadthai has quit [Ping timeout: 272 seconds]
fikka has joined #lisp
<_death> defclass and stuff is used by everyone and pretty stable and documented, so the balance lies in a different place
<_death> and still, it wouldn't be hard to find something that's not checked in a given implementation
fikka has quit [Ping timeout: 240 seconds]
<elderK> _death: Perhaps this is better? https://pastebin.com/eRYPcYHm
drewes has quit [Quit: Textual IRC Client: www.textualapp.com]
Guest12374 has joined #lisp
dddddd has joined #lisp
<elderK> I could, of course, replace the validate-... calls with (check-type ... ...)
<_death> yes..
<pjb> minion: memo for kristof: note that symbols are named by strings too. concatenating a package name, one or two colons and a symbol name gives you a qualified symbol: (concatenate 'string "CL-USER" "::" "STRING") #| --> "CL-USER::STRING" |# (read-from-string (concatenate 'string "CL-USER" "::" "STRING")) #| --> string ; 15 |#
<minion> Remembered. I'll tell kristof when he/she/it next speaks.
drewes has joined #lisp
<elderK> That would yield: https://pastebin.com/q10M2AMu
<_death> (check-type name symbol "a slot accessor name") .. validation functions would be useful if more complex or used in multiple places or exposed.. you could also (deftype slot-accessor-name () 'symbol) and check for that type, for the same purposes
<flip214> pjb: that won't work with colons in the package or symbol name.
<_death> and yes, it's likely you want to parse something like this to a slot-description object..
<pjb> flip214: exact. add (escape-colons …).
<pjb> also spaces, etc.
<flip214> elderK: with explicite validate-calls, why not make these methods? (validate-slot :count arg)
<jmercouris> hi everyone, I've shared a technical article about Next: https://www.reddit.com/r/lisp/comments/a3b8m0/browsing_with_lisp_next_browser_new_architecture/
<jmercouris> basically beach suggested almost a year ago now I think, a lisp core, with a separate GUI process controlled via some remote protocol to keep the core safe and free from foreign code
<z0d> where's the link?
<jmercouris> anyways, we've done it, and we're at alpha, interested to hear feedback on the design, even the codebase itself, I'm of course a Lisp noob, and there are many mistakes throughout
<z0d> thx
<elderK> _death: Something like this? https://pastebin.com/VrR1rSkb
<z0d> thx
<elderK> flip214: I'd need a more elaborate example to see the value in that.
graphene has quit [Remote host closed the connection]
<elderK> I figure :count is the name of whatever you're validating. It would be eql-specialized?
<jmercouris> also, we managed to finally produce a binary that works for Linux, it's like flatpak, but its called a guix pack
<jmercouris> so Next is now a first class citizen on Linux
<z0d> maybe M$ should develop a browser in Lisp instead of forking Chromium
<elderK> jmercouris: Congrats!
<elderK> z0d: They didn't fork Chromium?
<z0d> elderK: they're about to
<jmercouris> elderK: thank you :)
<elderK> Edge is new, based on Trident.
<z0d> they'll ditch Edge
graphene has joined #lisp
<elderK> Interesting
<z0d> not really. Edge sucks
<jmercouris> beach: since you inspired the design, I would be most interested in your feedback on the technical article
<beach> You need to remind me. Today my favorite coauthor is coming over for lunch, so I'll be busy. And then I will (of course) forget.
<jmercouris> beach: should I send you an email instead?
<_death> elderK: the deftype tradeoff is similar to the validation functions.. if it's a one-off a simple check-type with a type string (or not) is great. characters like "%" in names.. I stopped using such decorations a few years ago and they've become a pet peeve.. the class name should likely be "slot-description"; after all it's not a slot, but a description of it
<beach> jmercouris: No, reminding me here is fine.
<jmercouris> ok
<_death> elderK: in CLOS/MOP the corresponding class is called slot-definition
<elderK> _death: Aye.
<elderK> _death: Other than the prefixes and naming, is that style of validation good enough?
<_death> elderK: yes.. hopefully there's documentation too ;)
<elderK> _death: There will be :)
<elderK> Although, I've decided I don't like docstrings inline anymore. :P
<elderK> I will take after beach, and define the docstrings elsewhere.
<_death> (I'm just kidding.. documentation is for nonprogrammers ;)
<elderK> I may wind up using the CLOS MOP, maybe. Not sure yet. I'd need to alter standard defclass semantics so that inheritance follows defstruct semantics.
<elderK> And even if I did like, create a new metaclass and all that stuff, the user would not be intended to use defclass :metaclass raw. They'd still be meant to use a wrapper macro.
<shka__> jmercouris: does it work on linux?
<jmercouris> shka__: Yes it does!
<jmercouris> and we now have binaries for Linux!!!
<jmercouris> somethign like flatpak
<shka__> cool, i will check it out
<jmercouris> its called a guix pack
<jmercouris> shka__: Great, I look forward to it!
<_death> elderK: right.. using a macro like define-binary-class is a good idea, even if it's just a matter of adding a metaclass or inheriting from some superclass.. it's more future-proof
<jmercouris> _death: so you approve of my macro then: https://github.com/atlas-engineer/next/blob/master/source/mode.lisp#L6 ?
<_death> jmercouris: yes, although I would return the mode's name
fikka has joined #lisp
<_death> also consider providing a indentation hint
<_death> *an
<jmercouris> _death: an indentation hint? how can I do that?
<_death> you can always get more fancy.. providing describe-object method, pprinter functions, etc.
<_death> may want to inherit from a MODE class..
jellopudding has quit [Ping timeout: 245 seconds]
jello_pudding has joined #lisp
<jmercouris> mode is the base class though
<jmercouris> all modes inherit from mode
<_death> yes.. so use defclass for it and have define-mode provide it as a superclass
<jmercouris> I'm sorry, I meant to say NOT all modes inherit from mode
<jmercouris> you could have a mode inherit from another mode, my apologies!
<_death> so?
esrse has quit [Ping timeout: 268 seconds]
lucasb has joined #lisp
<jmercouris> well, let me ask what is perhaps a very basic question
<_death> it doesn't have to be the only superclass..
<jmercouris> if a -> b -> c, that is c inherits b, and b inherits a
<jmercouris> would it be necessary within c to make it explicitly inherit from a and b or, just from b?
<jmercouris> would there be a difference?
<_death> just from B, but if you also specify A then the order may matter
<jmercouris> I just don't understand why I would want to add mode explicitly as a superclass
<jmercouris> so that I would guaranatee that all defined modes have mode as a superclass?
<_death> for example, to test whether something is a MODE..
<jmercouris> aha, I see
<jmercouris> that is making a lot of sense, yes
<_death> (defclass ,name (,@superclasses mode) ,slot-definitions)
<jmercouris> so with regards to order
<jmercouris> does the order determine which slots shadow others?
<_death> slots don't "shadow" anything.. they are merged
<jmercouris> ok, bad question, let me try again
<jmercouris> why does order matter from a practical point of view when inheriting from multiple superclasses?
<_death> one of the phases in generic function dispatch is ordering the applicable methods..
shka__ has quit [Ping timeout: 250 seconds]
<beach> jmercouris: Since I am fairly busy with SICL and paper writing, it looks like you can improve a bit before I look at it by following the advice of _death and others.
<jmercouris> beach: well, yes, but I mostly wanted you to actually try the browser! :D
frgo has joined #lisp
MetaYan has quit [Ping timeout: 272 seconds]
<jmercouris> I mean, it could be years until I am proficient in Lisp...
<beach> I see. OK, I will do that, but probably not today. Again, remind me.
<jmercouris> I will remind you
<jmercouris> _death: ah, so the implications are on the dispatch, not the slots
<jmercouris> or have I misunderstood?
<jmercouris> okay, I seem to have understood, I just saw your message above
<jmercouris> I read your link before reading your message!
frgo has quit [Ping timeout: 268 seconds]
shka__ has joined #lisp
<_death> it's good that next now supports linux.. I may give it a try on the weekend
m00natic has joined #lisp
hajovonta has quit [Read error: Connection reset by peer]
<jmercouris> _death: that makes me very happy!
<jmercouris> please bear in mind, it is still alpha since this is now like the 5th rewrite... it feels like we can finally focus on polishing it and adding new features now that the architecture is finally stabilized
<Bronsa> j
<jmercouris> Bronsa: definitely
<Bronsa> :)
<Bronsa> the embarassing result of using ERC and missing my CTRL key once again
quipa has quit [Remote host closed the connection]
quipa has joined #lisp
quipa has quit [Remote host closed the connection]
quipa has joined #lisp
<shka__> when calling map 'vector, presence or absence of the fill pointer, or vector being adjustable is undefined by the standard
<shka__> is that correct?
milanj has quit [Quit: This computer has gone to sleep]
frgo has joined #lisp
pjb has quit [Remote host closed the connection]
eminhi_ has joined #lisp
<loke`> shka__: I can't see anything in the spec that clarifies that, so I'd assume it's unspecified.
pjb has joined #lisp
eminhi has quit [Ping timeout: 250 seconds]
<shka__> loke`: thanks
<pfdietz> clhs 17.1
<pfdietz> "Whenever a sequence function must construct and return a new vector, it always returns a simple vector."
<shka__> pfdietz: excellent! thank you
<pfdietz> An implementation is allowed to make any array adjustable; the spec has a distinction between "expressly adjustable" and "actually adjustable".
<pfdietz> Note also that simple vector != simple-vector.
lmy9900 has joined #lisp
<shka__> pfdietz: what simple vector means in this context?
<pfdietz> Something like (and vector (simple-array *))
<pfdietz> However:
<pfdietz> "It is implementation-dependent whether displaced arrays, vectors with fill pointers, or arrays that are actually adjustable are simple arrays. "
<shka__> very well
<pfdietz> So it's possible to have an implementation in which all arrays have the frills. Lisp machines, perhaps?
<pfdietz> Not sure what Open Genera does.
<elderK> Hey, does anyone know a neat way to say, "I want a list of N times this"
<elderK> Other than say, using loop or something?
<pfdietz> make-list
<elderK> Thanks :)
<pfdietz> clhs make-list
Necktwi has quit [Remote host closed the connection]
Necktwi has joined #lisp
yvy has quit [Read error: Connection reset by peer]
mindCrime has joined #lisp
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
pillton has quit [Read error: Connection reset by peer]
eminhi_ has quit [Ping timeout: 272 seconds]
milanj has joined #lisp
pfdietz has quit [Remote host closed the connection]
shifty has quit [Ping timeout: 244 seconds]
nicksmaddog has joined #lisp
quipa has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 245 seconds]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 268 seconds]
Bike has joined #lisp
SaganMan has joined #lisp
mindCrime has quit [Ping timeout: 240 seconds]
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fikka has joined #lisp
pfdietz has joined #lisp
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
warweasle has joined #lisp
rumbler31 has joined #lisp
FreeBirdLjj has joined #lisp
<dim> was not so happy with my code, using CCL: 1414.644ms; using SBCL: 69ms; ok then
<jmercouris> let's not implementation shame now :P
<jmercouris> I'm just totally kidding in case it is not clear from my usage of :P
<dim> just mentioning because rme said CCL compiler would welcome smarts
<_death> did you help the compiler by adding declarations etc.
<dim> just saying the main parameter is a string, but then nothing else, neither in the flets nor in the loops
drewes has joined #lisp
Demosthenex has quit [Ping timeout: 244 seconds]
<jmercouris> I think CCL is a monumental task for RME to go at it alone, I look at the commit history, and he seems to be far and above the most active
<Xach> It has a very long history that predates rme, too
<jmercouris> at least if you look at 2017 onwards
<_death> dim: I think when ccl is helped with declarations it can generate OK code.. anyway, for day 5 I created a screencast https://adeht.org/casts/aoc2018.html
<_death> (there's obvious ugliness and inefficiency, but it works ;)
dale_ has joined #lisp
dale_ is now known as dale
<dim> I found day5 quite difficult, I think I attacked it the wrong way and then my mental model was kind of stuck
<_death> interesting.. to me it immediately screamed "string rewriting", even before reading the problem, so I found it a bit boring
rumbler31 has quit [Remote host closed the connection]
<dim> my first approach didn't resist to the string beginning with a reaction (e.g. Aa), and then it was busted and I needed something else, from scratch
<dim> char-equal, nice
<dim> ah yeah you went the recursive way
<dim> I don't know why but I didn't want to ;-)
<_death> not really recursive.. it's an iterative fixed point process
<_death> here's a gist with minor cosmetic changes https://gist.github.com/death/e0e216ca41eee99da609f01c64d2725a
rippa has joined #lisp
gxt has quit [Ping timeout: 252 seconds]
<dim> it's recursive, the definition of eval-reactions calls eval-reactions
lmy9900 has left #lisp [#lisp]
<_death> it's tail recursive, i.e. iterative..
<Odin-> Mmmmno.
<_death> it can easily be replaced with loop
<Odin-> Tail recursive can be made iterative, but it's not iterative as such.
<_death> without the need for a stack
smokeink has quit [Remote host closed the connection]
<_death> I suggest reading SICP :)
<Odin-> That's an optimisation step that's not always present. :p
<Odin-> Common Lisp doesn't mandate tail call optimisation.
aja042 has joined #lisp
<_death> I am not talking about tail call optimization, but about the process described by the code
fikka has quit [Ping timeout: 246 seconds]
<Odin-> Fair enough, but in practice you can only make that distinction if you have tail call optimisation.
phadthai has joined #lisp
<Odin-> (Which is, I believe, the very reason Scheme mandates it.)
<_death> the process is iterative, and what the compiler decides to do with its description is an implementation detail, which in practice matters of course
<dim> with char-equal and a very small code clean-up now CCL and SBCL are about on-par, 1414.644ms became 100.259ms; thanks!
<dim> I smell inlining opportunities in the code clean-up
<_death> ;)
<dim> _death: I see what you mean yeah, but I refrained myself for doing it that way and I don't know why really, I like recursive definition for their simplicity usually, not today though…
<dim> well I like *your* solution ;-)
mindCrime has joined #lisp
<alandipert> _death I'll check out your screencast! I haven't done it 2 yet, have this so far https://github.com/alandipert/advent-of-code-2018/blob/master/day05.lisp
eminhi has joined #lisp
Inline has joined #lisp
<_death> in general concatenate/subseq usually have more efficient alternatives
fortitude has quit [Remote host closed the connection]
<Odin-> _death: If we get right down to it, the only reason you ever need to use iterative processes is an implementation detail. :)
<Odin-> (That is, the fact that any actual implementation is going to have a finite limit on call stack depth.)
<_death> Odin: what is meant is that the process, by its "nature", is iterative.. i.e. without any relation to computers or compilers, just logic
fortitude has joined #lisp
<_death> Odin: and Guy Steele in one of his lambda papers, flipped the situation with regards to implementation techniques and showed that the "stack" can be artificial
<heisig> Damn, you guys lured me into this advent of code thing. Well, here is my take on it: https://github.com/marcoheisig/adventofcode
<Odin-> _death: Algorithmic analysis is one way of looking at it. Looking at it from the implementation is another.
shrdlu68 has quit [Quit: WeeChat 2.2]
<_death> ok
<Odin-> _death: I'll concede that saying "no, it's not" wasn't justified, but at the same time it's not _wrong_. :p
figurelisp has quit [Ping timeout: 250 seconds]
<Odin-> Because the implementation is recursive and leaves it to the compiler to recognise that the underlying process is iterative.
<Odin-> If it doesn't, the process that actually gets run _is_ recursive, with significant practical consequences.
<_death> I think we agree then
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
<jkordani_> dim: so essentially, char-equal is slower on ccl than sbcl right now?
<jkordani_> _death: its funny this topic came up. I'm going through sicp right now and last night I finally understood what they were saying about iterative v recursive
<_death> they also explain it well on the videos you can watch on youtube, iirc
<jkordani_> I was confused because the iterative examples look recursive to me, if I go by my old definition which was "the function calls itself" but I see now that that's an incomplete model to describe the behavior
cage_ has joined #lisp
<Odin-> Well, it's a behaviour question.
<Odin-> And tail call optimisation makes the code behave different from what it looks like it should. :p
<_death> if you understand this, then the semantic arguments about appropriate terms etc. are unimportant..
<jkordani_> ^
Demosthenex has joined #lisp
jmercouris has quit [Remote host closed the connection]
kajo has quit [Ping timeout: 268 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
robotoad has joined #lisp
Demosthenex has quit [Ping timeout: 245 seconds]
<elderK> :| Well, I've been tinkering for a few hours.
<elderK> This is what I've written so far. Yet another thing to toss into the trash.
<elderK> Feels like too much is going on in too many places.
<elderK> And I keep hitting the margin, so that's also a bad sign
Demosthenex has joined #lisp
Demosthenex has quit [Ping timeout: 245 seconds]
Demosthenex has joined #lisp
<_death> doesn't look too bad.. as for the margin, maybe it's best to ignore that rule for now, so that you indent things in a way that makes the code shape familiar
mindCrime has quit [Read error: Connection reset by peer]
<_death> by familiar I mean something like https://plaster.tymoon.eu/view/1020#1020
nicksmaddog has quit [Remote host closed the connection]
mindCrime has joined #lisp
nicksmaddog has joined #lisp
heisig has quit [Quit: Leaving]
<elderK> _death: Thanks for taking a look. I appreciate it. Aye, I'm aware of the "familiar" shape. But... the margin.
<elderK> What I want to do, is break this out into multiple files. One that deals with the slot stuff, one that deals with the structure stuff.
<elderK> But of course, some of the slot stuff needs to access the structure, and vice versa.
<elderK> So it's cyclic. Which is horrible.
<elderK> I have learned, however, that storing the offset for the slots doesn't really buy me much.
<elderK> And it adds a bit of complexity.
<pjb> Speaking of horros: Chopin with a hammer: https://www.youtube.com/watch?v=mrmGMlijAzY
<elderK> Heh
<elderK> :( I've been at this for about twelve hours. I should take a break, ponder more. But at the same time, I'm determined to get something decent. At least /some/ progress.
<elderK> Well, more like six.
<_death> elderK: in make-array-initform you should likely use `(vector ,@(loop repeat count collect initform)) for initial contents.. which also does away with double backquotes
Demosthenex has quit [Ping timeout: 246 seconds]
<elderK> _death: Ah, nice. I didn't know about repeat. I missed it
<elderK> _death: The thing is, initform might be a function to be evaluated.
<elderK> I'd need `(vector ,initform ,initform ...)
<_death> elderK: indeed, so putting the function call form in a vector literal is wrong.. and also, you need to decide whether to evaluate it multiple times (as it is right now) or once (say, using once-only)
vtomole has joined #lisp
<elderK> _death: Good point about the literal. But it's intended to evaluate the initform multiple times.
<_death> elderK: `(vector ,initform ,initform ...) is exactly what my suggestion expands to
<elderK> Ah, my bad. Awesome :)
marvin3 has joined #lisp
<elderK> _death: Is it bad form for a file to use a function that's defined in another file, if that other file is compiled / loaded after the first?
<elderK> Or is it best to declaim something in that case, to let the compiler know that ahead of time?
<_death> I'd say it's bad form, yes
<elderK> It's crazy. I can deal with much larger files in other languages. But, Lisp... it is so much more dense, if that makes any sense.
marvin2 has quit [Ping timeout: 252 seconds]
<_death> yes, Lisp is dense.. so you need self discipline and separating sections clearly
<Odin-> Lisp and assembly sometimes seem to have similar requirements for exactly the opposite reasons.
<Odin-> Assembly because it's doing things at such a low level that you need to see a lot of it to understand what the hell is going on, and Lisp because it's doing things at such a high level ... that you need to see a lot of it to understand what the hell is going on.
<elderK> Odin-: Hehehe.
<elderK> _death: :| I'm not sure how to break this up better.
matijja has joined #lisp
<_death> elderK: well, it's not too big yet.. with practice you'll find it easier deal with chunks like that
shka_ has joined #lisp
matijja has quit [Ping timeout: 246 seconds]
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
sigjuice has quit [Quit: ZNC - http://znc.in]
sigjuice has joined #lisp
jochens has quit [Ping timeout: 272 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
<elderK> _death: Another problem is that, atm, I haven't really developed an intuition for what *is* horrible.
kajo has joined #lisp
varjag has joined #lisp
<_death> well, there's #lisp, you are not alone :)
lucasb has quit [Quit: Connection closed for inactivity]
m00natic has quit [Read error: Connection reset by peer]
<elderK> :)
<_death> but did you read the Tutorial on Good Lisp Programming Style ( http://norvig.com/luv-slides.ps ) ?
meepdeew has quit [Remote host closed the connection]
<pfdietz> elderK: the use-before-def of functions is interesting if it's a generic function. There, the idea is to put the defgeneric forms early, sort of like the declaration of function signatures in C go in .h files. The actual methods can be all over the place.
Zaab1t has joined #lisp
hhdave has quit [Ping timeout: 250 seconds]
gravicappa has joined #lisp
gxt has joined #lisp
gendl has quit [Ping timeout: 264 seconds]
CEnnis91 has quit [Ping timeout: 252 seconds]
physpi has quit [Ping timeout: 252 seconds]
vlatkoB has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
CEnnis91 has joined #lisp
physpi has joined #lisp
vlatkoB has joined #lisp
<elderK> _death: I did. There are a couple things I break on purpose, though.
<elderK> Although, I try to follow it closely.
<elderK> I think I've managed to simplify my stuff :)
lucasb has joined #lisp
fikka has joined #lisp
Demosthenex has joined #lisp
gravicappa has quit [Ping timeout: 246 seconds]
fikka has quit [Ping timeout: 250 seconds]
Essadon has joined #lisp
Essadon has quit [Max SendQ exceeded]
Essadon has joined #lisp
cage_ has quit [Remote host closed the connection]
malice has joined #lisp
Guest12374 has quit [Ping timeout: 252 seconds]
dyelar has quit [Quit: Leaving.]
sauvin has quit [Read error: Connection reset by peer]
aja042 has quit [Ping timeout: 252 seconds]
eminhi_ has joined #lisp
eminhi has quit [Disconnected by services]
eminhi_ is now known as eminhi
Demosthenex has quit [Ping timeout: 272 seconds]
Demosthenex has joined #lisp
eminhi has quit [Ping timeout: 246 seconds]
Demosthenex has quit [Ping timeout: 246 seconds]
Demosthenex has joined #lisp
fikka has joined #lisp
hiroaki has joined #lisp
Demosthenex has quit [Ping timeout: 245 seconds]
nicksmaddog has quit [Ping timeout: 244 seconds]
Demosthenex has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
malice has quit [Ping timeout: 256 seconds]
lucasb has left #lisp [#lisp]
eminhi has joined #lisp
malice has joined #lisp
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
gxt has quit [Ping timeout: 252 seconds]
meepdeew has joined #lisp
<elderK> _death: Any chance you know a good way to write a forwarding constructor?
<elderK> Like, one that checks all the provided keyword args are of the correct type. Then forwards them all?
<elderK> I get the feeling what I'm doing is the wrong approach :)
<elderK> (Generating a bunch of keyword parameters with suitable defaults, checking them /all/ always, and then calling the "real" constructor)
<_death> what are you doing, and why do you feel it's wrong?
<elderK> Well, it seems like it is excess work. Like, if the keyword args default, I know they are avlid.
actuallybatman has joined #lisp
<elderK> So, it makes sense to check only those that are provided.
milanj has quit [Quit: This computer has gone to sleep]
<elderK> It would be interesting to see how implementations implement the constructors for like, structures.
<elderK> _death: Basically, if all the structure's slots are say, A, B and C. I generate a gigantic list of keyword parameters, (A initform) (B initform), etc. I also generate a giant list of (check-type A type), etc.
<elderK> Then I have a (funcall real-constructor-name all-the-arguments)
<_death> in this approach it's likely that you want a boa constructor
janivaltteri has joined #lisp
makomo has joined #lisp
<elderK> :) Gotta read up on how Boa constructors work with structure inheritance.
<_death> you may want to look for a macro named DEFINE-STRICT-FUNCTION
<elderK> I imagine the Boa list is <all inherited slots> <... all direct slots>
zhlyg has joined #lisp
<_death> you write the lambda list yourself
vlatkoB has quit [Remote host closed the connection]
<zhlyg> Does this CPS vs SSA comparison holds true today http://mlton.org/pipermail/mlton/2003-January/023054.html
<dim> zhlyg: no idea, but I like the work on Andy Wingo on this topic, at https://www.wingolog.org among other things
emar has quit [Quit: WeeChat 2.3]
<zhlyg> dim: Oh, it was from there I got that link (article "guile 2.2 omg!!!")
<elderK> _death: This is what I have now. I'm feeling a bit happier about it's shape now. https://pastebin.com/1YeL8zC1
nolanv has quit [Quit: WeeChat 2.2]
emar has joined #lisp
<elderK> _death: There's still stuff to do, like writing make-load-forms and stuff. And a bit of rearranging, too.
<elderK> Maybe I'll just do a cop out and say "Results are undefined if..."
<_death> do you plan on setting up a repository
<elderK> And embrace dynamic typing :
<elderK> :P
<elderK> Sure do.
<elderK> If it'd help, I can make one now and push :)
<_death> I guess it's better than a pastebin..
anamorphic has joined #lisp
gxt has joined #lisp
<anamorphic> In my project I have a bunch of static files I need at runtime. I have them all referenced in ASDF e.g ((:static-file "foo") (:static-file "bar"...), but it's starting to get a bit unwieldy. They're all in the one path though -- Is there a way to just specific, "all the files in this path" somehow?
Demosthenex has quit [Ping timeout: 240 seconds]
<shka_> anamorphic: don't refer to static files with asdf during runtime
<_death> elderK: 'tis likely k.binary.structures should depend on k.binary.integers...
milanj has joined #lisp
<elderK> _death: :P For the test to work, yes :D
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<elderK> _death: Also, there's a bug I just fixed. ,(structure-accessors ...) should be ,@
<_death> elderK: yep.. it's a good idea to replace #<%structure ...> in the expansion with the form to create that instance
<elderK> I'll need to do the same for %slot, too.
<_death> elderK: and then you'll want to only create it once, i.e. "intern" it
<elderK> :) How do you mean?
Demosthenex has joined #lisp
<elderK> I'd like to evaluate the "literal" only once, but I'm not sure how to do that when I've got the eval-whne as it is.
<_death> (or (lookup x) (create x))
<elderK> Right - but then how would you handle redefinitions? You'd have to be able to differentiate between "This was defined in the compile, now we're loading" and "We're redefining the entire thing"
<_death> could have a FIND-BINARY-STRUCTURE and a (SETF FIND-BINARY-STRUCTURE), like FIND-CLASS and (SETF FIND-CLASS)...
<elderK> _death: That's the purpose of %symbol-type.
<elderK> It's used to associate type metadata with a symbol in general - for any "binary type." Not just structures.
<_death> if you want to handle redefinition, you shouldn't use defstruct
drewes has joined #lisp
<elderK> Aye. You're right. Given defstruct's semantics, if you redefine it, you really should reload the system, rihgt?
<elderK> Like, a clean reload.
<_death> clhs defstruct
<Bike> if you redefine a defstruct anything can happen. you shouldn't redefine a defstruct.
ealfonso has joined #lisp
<_death> "The consequences of redefining a defstruct structure are undefined."
<buffergn0me> zhlyg: That CPS vs SSA comparison still has some valid points (IDK of any recent work on common subexpression elimination, which seems to be a sore point), but there is recent work to show you can do things with CPS that don't have SSA equivalents yet: https://smartech.gatech.edu/bitstream/handle/1853/16289/might_matthew_b_200708_phd.pdf https://dimvar.github.io/ (CFA2)
<_death> in some implementations it's ok to redefine, if you also recompile code using the access functions and such
<buffergn0me> Both Olin Shivers' students
<elderK> _death: Right then. So, interning it is :)
<elderK> I imagine it is the same if you like, redefine deftypes and stuff you've used elsewhere. Obviously, if you have check-types and stuff using them, compiled into functions, you'd need to redefine them I guess.
<elderK> _death: If you were doing what I am trying to do, how would you go about it?
eschatologist has quit [Read error: Connection reset by peer]
eschatologist has joined #lisp
anamorphic has quit [Quit: anamorphic]
<_death> elderK: kind of a broad question.. I wrote things like that years ago after I read PCL, and I tried different approaches when I needed to do "binary parsing", but I did not need to create anything like that in recent years..
<elderK> _death: Broad indeed. I basically want to use CL for the stuff I'd normally use C for. That is why I need something like this.
anamorphic has joined #lisp
<elderK> And, while I could use say, frodef's binary-types or... a few others, I thought building my own would be a good learning experience.
<elderK> I get the feeling though that I simply need to let go of any... desire for "static typingness" :P
yvy has joined #lisp
<_death> elderK: there are many libraries to do that, and other languages also have features of interest (e.g., I remember erlang's bit pattern syntax was neat, or some python library that used similar syntax to define packet structure), but I guess you already checked them out.. so if you're writing it to fix issues with other people's libraries you should already have a good idea of what you want
<elderK> It's crazy how much that... lingers.
<elderK> _death: I haven't looked into how other languages like Python deal with this. But, I have spent quite a bit of time studying various "binary parsing libraries" on Cliki, and Github.
<elderK> Of course, it's not a once-off "skim the code", I refer to them often, over and over, as I encounter new things or want to double-check something
<dim> elderK: you'll find very good inspiration in Erlang binary syntax (with pattern matching) for binary, really
<_death> elderK: well python had that struct thingy.. which I tried some years ago https://github.com/death/constantia/blob/master/struct.lisp but I'm thinking about some specific library whose name I don't remember.. at the time I thought it was cute
<zhlyg> buffergn0me: thank you!
<_death> elderK: sometimes it's easy to just use nibbles or simple stuff like with-binary-readers in https://github.com/death/dbus/blob/master/utils.lisp
<elderK> Aye, I've seen nibbles. And things using it.
<elderK> But whn you're parsing lots of different structures from on-disk format, say.
<elderK> It would be nice to have some functionality to help automate that.
<elderK> :)
<_death> elderK: nowadays the things I write are aimed at concrete problems, so I don't have any grand designs for such a library..
* elderK nods
<elderK> :( I feel that my ambitions here are pretty modest, really. I'm not trying to create anything overly advanced. Just, useful for my purposes.
<elderK> And with an eye to helping some others who are working on Mezzano.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<_death> elderK: the define-binary-class -like stuff I wrote were proprietary (it was 10 years ago or so) so can't give a link.. but they were similar to the PCL stuff, I guess
* elderK nods
<elderK> I think I'm just going to take a big breath and accept like, dynamic typing.
<elderK> :P I will have type checks and stuff where it makes sense. But trying to force Lisp to be a statically typed langauge is frankly a waste of time.
<_death> try it ;)
<elderK> I wish I realized that sooner.
<_death> as long as you document your stuff you should be fine
<elderK> If someone like, populates a "binary structure" with garbage and tries to serialize it, it'll fail - but they might write some bogus stuff in the process.
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aja042 has joined #lisp
<elderK> Mostly, it'll be fine. But I mean, it's not transactional. STuff that is valid, will be written and then FAIL! Something isn't the right type.
drewes has joined #lisp
<elderK> _death: Thank you so much for your help over the past few hours. I really, really appreciate it.
<elderK> You've been extremely useful.
<elderK> :)
<_death> me, I'm very inconsistent with style and documentation for my personal projects, and I don't mind other people's undocumented lisp code (I like code), so I'm a preacher giving advice ;)
nolanv has joined #lisp
<elderK> _death: Well, as you can see, I've docstring documented some stuff. But, I intend to tear that out and do better, nicer docstrings "out of line."
<elderK> And of course, eventually, I'll write a README that covers the basics of how to use it, examples, etc.
nolanv has quit [Client Quit]
<_death> cool, always good to have client code in mind
nolanv has joined #lisp
<dim> README Driven Development FTW
<_death> yeah.. I don't think there's one way to do things, but when that approach works it's pretty cool
<elderK> :) I'm really hoping that my little library helps someone in Mezzano.
<elderK> And, in general, I'm hoping it lets me do binary tinkering in CL.
<elderK> I've been working on this for awhile now. It'll be good to move on :)
jello_pudding has quit [Quit: Leaving]
<elderK> Perhaps one of these days I'll rewrite it all using the MOP, as shka_ originally suggested.
<elderK> :) The next thing is to unit test the shit out of it :D
Demosthenex has quit [Ping timeout: 250 seconds]
Demosthenex has joined #lisp
Guest12374 has joined #lisp
Demosthenex has quit [Ping timeout: 245 seconds]
Demosthenex has joined #lisp
vtomole has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
anamorphic has quit [Quit: anamorphic]
angavrilov has quit [Remote host closed the connection]
anamorphic has joined #lisp
graphene has quit [Remote host closed the connection]
lavaflow has quit [Read error: Connection reset by peer]
graphene has joined #lisp
kajo has quit [Ping timeout: 250 seconds]
lavaflow has joined #lisp
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mindCrime has quit [Ping timeout: 268 seconds]
Guest12374 has quit [Ping timeout: 252 seconds]
kajo has joined #lisp
meepdeew has quit [Remote host closed the connection]
graphene has quit [Remote host closed the connection]
pillton has joined #lisp
graphene has joined #lisp
Zaab1t has quit [Quit: bye bye friends]
robdog has quit [Ping timeout: 252 seconds]
fitzsim has joined #lisp
anamorphic has quit [Quit: anamorphic]
shka_ has quit [Ping timeout: 246 seconds]
yvy has quit [Read error: Connection reset by peer]
<elderK> I wonder how like, Genera and stuff managed binary IO
shenghi has quit [Ping timeout: 250 seconds]
Guest12374 has joined #lisp
ealfonso has quit [Read error: Connection reset by peer]
ealfonso has joined #lisp
shenghi has joined #lisp
Guest12374 has quit [Ping timeout: 252 seconds]
<Xach> elderK: all function calls all around!
<elderK> ? :D
<elderK> I really wish I could get Genera working here :)
Bike has quit []
warweasle has joined #lisp
MetaYan has joined #lisp
fikka has joined #lisp
varjag has quit [Ping timeout: 252 seconds]
<elderK> Guys, is the type specifer in (typep ... spec) evaluated?
<elderK> If so, that would be very useful.
<elderK> Given that you need to quote it, I figure it is.
<permagreen> I'm pretty sure it is. Should be easy enough to test though
ealfonso has quit [Ping timeout: 252 seconds]
<elderK> permagreen: :) Neat. I might be able to use this to strength like, type checks :)
<elderK> permagreen: Also - it's awesome that on Weechat, your name /is/ green.
<pfdietz> Yes it is.
<elderK> :P
<pfdietz> It is NOT evaluated in check-type.
<elderK> pfdietz: Neat :D
ebrasca has joined #lisp
<elderK> ebrasca: Yo!
<elderK> ebrasca: I've finally made some progress with my "binary" library. There are a few more things to add support for, and a few other "chores" I want to do. But, it should be ready for "alpha use" very soon :)
<elderK> It'll be a priority soon to get it running in Mezzano proper.
<elderK> I'll try using it for some actual stuff, though. Dog-food it :) Fix / refine it as necessary.
<permagreen> I'd like to say my name is often displayed as green in chat clients, for whatever reason, but really I think people are just more prone to point it out to me when it is
<elderK> :P I consider it a neat coincidence.
<elderK> :D
ebrasca has quit [Remote host closed the connection]
Essadon has quit [Quit: Qutting]
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
Bike has joined #lisp
smokeink has joined #lisp
zhlyg has quit [Remote host closed the connection]
ebrasca has joined #lisp