mi6x3m has quit [Remote host closed the connection]
chops_ has joined #commonlisp
chops_ has quit [Changing host]
chops_ has joined #commonlisp
slyrus has joined #commonlisp
aadcg has quit [Ping timeout: 252 seconds]
rkazak has joined #commonlisp
bjorkintosh has quit [Ping timeout: 260 seconds]
fugata is now known as contrapunctus
contrapunctus is now known as fugata
pfdietz has joined #commonlisp
rkazak has quit [Ping timeout: 276 seconds]
chomwitt has joined #commonlisp
josrr has joined #commonlisp
JuanDaugherty has joined #commonlisp
chops_ has quit [Ping timeout: 276 seconds]
rkazak has joined #commonlisp
King_julian has quit [Ping timeout: 265 seconds]
slyrus has quit [Ping timeout: 248 seconds]
chops_ has joined #commonlisp
chops_ has quit [Changing host]
chops_ has joined #commonlisp
rkazak has quit [Ping timeout: 265 seconds]
slyrus has joined #commonlisp
msv has quit [Remote host closed the connection]
msv has joined #commonlisp
slyrus has quit [Ping timeout: 276 seconds]
manwithluck has quit [Ping timeout: 252 seconds]
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
manwithluck has joined #commonlisp
pranav has joined #commonlisp
aadcg has joined #commonlisp
bjorkintosh has quit [Ping timeout: 276 seconds]
aadcg has quit [Ping timeout: 272 seconds]
<thuna`>
Is there any utility to having an array dimension be zero? I'm not talking about zero-rank arrays but e.g. arrays of dimensions (4 0 2)
<thuna`>
,(make-array '(4 0 2))
<ixelp>
=> #3A(() () () ())
<bike>
not particularly. i'm sure someone can come up with something goofy but it's basically pub trivia.
rkazak has joined #commonlisp
<thuna`>
You can't even call AREF on that array, it seems
varjag has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.3)]
<phoe>
you have no valid indices to call AREF with, so, nope
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
slyrus has joined #commonlisp
<phoe>
they're the degenerate case of array sizes being unsigned integers in the general sense - zero or more
<phoe>
an array that contains 4*0*2 elements contains zero elements, even if it still has some meaningful information like its rank or dimensions or UAET
rkazak has quit [Ping timeout: 252 seconds]
eddof13 has joined #commonlisp
rkazak has joined #commonlisp
mi6x3m has joined #commonlisp
<mi6x3m>
hey, does anyone know of a utility function / lib that can provide good formatting for the semantic equivalent of (assert (equal list1 list2))
<beach>
What kind of formatting are you referring to? Source code indentation? Something else?
<beach>
And what is this semantic equivalent you are referring to?
<mi6x3m>
So this is a unit test for a piece of code, and I want to get structural info (1 2) is not equal to (1 2 3) maybe
<mi6x3m>
(it's a test without a specific framework)
pfdietz has quit [Ping timeout: 240 seconds]
wobbol has quit [Ping timeout: 276 seconds]
<beach>
What is wrong with (unless (equal list1 list2) (error "Structural info ~s is not equal to ~s" list1 list2))?
<bike>
i mean, most such formatting is going to come from a testing framework... but if you use the extended form of assert you might get a better message from the implementation. i think sbcl does that if you give it the actual places and stuff.
<beach>
Or that.
<mi6x3m>
oh, yeah, the extended assert
<mi6x3m>
thanks
rkazak has quit [Ping timeout: 260 seconds]
slyrus has quit [Ping timeout: 272 seconds]
mishoo has joined #commonlisp
random-nick has joined #commonlisp
kamafam has joined #commonlisp
kamafam has quit [Read error: Connection reset by peer]
rkazak has joined #commonlisp
chops_ has quit [Ping timeout: 276 seconds]
thuna` has quit [Ping timeout: 244 seconds]
slyrus has joined #commonlisp
slyrus has quit [Ping timeout: 252 seconds]
chops_ has joined #commonlisp
chops_ has joined #commonlisp
chops_ has quit [Changing host]
rkazak has quit [Ping timeout: 244 seconds]
chops_ has quit [Ping timeout: 276 seconds]
slyrus has joined #commonlisp
mi6x3m has quit [Ping timeout: 260 seconds]
mgl has quit [Ping timeout: 265 seconds]
eddof13 has quit [Quit: eddof13]
chops_ has joined #commonlisp
chops_ has joined #commonlisp
slyrus has quit [Remote host closed the connection]
rahmanlar has quit [Remote host closed the connection]
rahmanlar has joined #commonlisp
rkazak has quit [Ping timeout: 248 seconds]
amb007 has quit [Ping timeout: 265 seconds]
amb007 has joined #commonlisp
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 265 seconds]
amb007 has quit [Ping timeout: 265 seconds]
yitzi has joined #commonlisp
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 265 seconds]
kevingal has joined #commonlisp
amb007 has joined #commonlisp
rkazak has joined #commonlisp
mesaoptimizer is now known as mesaoptimizer0
slyrus has quit [Ping timeout: 265 seconds]
elderK has joined #commonlisp
yaneko has joined #commonlisp
cage has joined #commonlisp
cage has quit [Excess Flood]
cage has joined #commonlisp
slyrus has joined #commonlisp
chops_ has quit [Ping timeout: 272 seconds]
slyrus has quit [Ping timeout: 244 seconds]
slyrus has joined #commonlisp
slyrus has quit [Ping timeout: 244 seconds]
rkazak has quit [Ping timeout: 265 seconds]
chops_ has joined #commonlisp
chops_ has quit [Changing host]
chops_ has joined #commonlisp
Ruby has quit [Ping timeout: 252 seconds]
Ruby2 has joined #commonlisp
slyrus has joined #commonlisp
<fengshaun>
is there an icalendar library for common lisp? I can't find one that supports parsing ical files
<elderK>
Hey guys, I've got some design and organization questions. I've been working on a small project lately, when I've been able. It's a pattern amtching library, like optima or trivia but much simpler. The goal is just to see if I can implement something like them.
<elderK>
My first question mostly revolves around packages and name conflicts: Coming from C++, I'm used to being able to overload basically anything and methods having class scope. For instance, if I have two classes (pattern-expander and pattern-macro-expander), each of them can have their own expand method, even though the signatures of those methods are very different.
haoms has joined #commonlisp
<elderK>
I see the following three ways to avoid a name conflict here: 1) Make them have the same signature, even though a pattern-expander and pattern-macro-expander may not need to use the same arguments. 2) Have pattern-expander and pattern-macro-expander live in different packages and make use them via package local nicknames. 3) Don't give the methods the same name. Instead of expand, have
<elderK>
expand-pattern and expand-pattern-macro.
<elderK>
I was wondering which approach is the best in this case. How common is it for classes and associated generics to exist in different packages, solely to avoid name conflicts?
<elderK>
As for packages, I was even toying with trying to emulate the scoping that C allows but I imagine this is mostly due to familiarity. That is, I shouldn't write C in CL :P Package-per-file is appealing to me because then I can effectively emulate "file-scope stuff" as in C. But then, that brings a lot of overhead (more defpackage forms, either system-per-directory or package-inferred.)
trocado has quit [Remote host closed the connection]
<elderK>
I'll throw another question here, too: When does it make sense to use dynamic variables to pass state to some function rather than passing that state to a function via parameters? In my case, one of my functions takes a fair number of parameters, around 6 or 7. It'd be great if I could cut that down but they do tend to change quite often so, it seems I really do need them.
<elderK>
From my perspective, I prefer the parameters because it's easier to test what I write with them. Testing with dynamic variables takes more effort because I have establish those bindings in a let before calling the function I want to test. I also like how the parameters are explicit. That is, I know what state the function needs right from its definition.
<elderK>
Thanks in advance for any advice :)
<White_Flame>
is there something foiling DEFMETHOD? that would seem to be the obvious first approach
<White_Flame>
especially if their signatures are very distinguished
shmorg83 has joined #commonlisp
rkazak has joined #commonlisp
trocado has joined #commonlisp
mesaoptimizer has joined #commonlisp
<White_Flame>
and yeah, dynamic bindings are thread-local context, equivalent to passing in implicit parameters. I tend to make (with-* ...) scope macros to establish them for me, and it makes for easier testing syntactically
<elderK>
White_Flame: Foiling as in, being a pain? The generics have the same name but different parameter lists, which is why I have an issue. I'd prefer not to give longer names for the generic because you know, convenience. But it seems heavy-handed to put each class / generics in their own package just to avoid collision.
<White_Flame>
I tend to switch to dynamic bindings if the parameter doesn't change a lot between consecutive calls
<White_Flame>
ah, right, I keep forgetting about that
<elderK>
Thanks White_Flame :) My intuition is use DVs as you say: Only for stuff that basically remains constant across the entire call chain.
<White_Flame>
or something that multiple call chains will use, like *CURRENT-DATABASE-CONNECTION* sort of stuff
rkazak has quit [Ping timeout: 248 seconds]
<elderK>
Or perhaps, to add some extra state easily without changing signatures. For instance, one pattern-expander class might implement variable binding in patterns and another might refer to those bindings. I could support that by passing new parameters around but it would be easier just to use dynamic variables since the "current pattern bindings" are used by only two kinds of expanders.
wobbol has joined #commonlisp
<White_Flame>
or maybe you can build up some structures or lists that contain some of the parameterized config?
<elderK>
You mean what I'd call a "context parameter." I thought of that, too: Instead of say, seven paremters, I pass an object that contains those paramters. The problem is, some parts of that object would change often which would mean I'd have to change whatever "field" I'm messing with but allocate a new context object so that prior version are untouched.
<elderK>
Like say, I have a pattern-context object that contains a bindings alist: When I add to that alist, I need to allocate a new context object.
<White_Flame>
how many parameters are we talking about here? and what's the domain?
<elderK>
That would be cleaner, in terms of passing information around but would produce a lot of garbage.
<elderK>
Moment.
mesaoptimizer0 has quit [Quit: nyaa~]
<elderK>
I've been working on a pattern matcher thing. The idea is that you can easily define new patterns. A pattern expander is basically just a function that takes some state, such as the raw form of some pattern and translates it to be some code that will be executed to check if the item we're matching against satisfies the pattern.
<elderK>
The parameters for say, pattern-expander-expand are as follows: bindings (pattern variables bound to particular parts of an expression), lexical-environment (the environment the top-level macro is being expanded in, so we can use constantp), expander (the actual expander that's expanding the pattern. Needed for specialization), next (a function that is called to generate the future. I.e. When
<elderK>
we have generated code for this pattern, we call next to generate the code for the next parts of the pattern), pattern-environment (a pattern environment is just a fancy hash table mapping strings to pattern-expander instances) and subpatterns (if we have a pattern list (list a b c), a b and c would be subpatterns.)
<elderK>
A pattern macro is basically a pattern that expands to another pattern, rather than a pattern that expands to code to check if something matches a pattern. A pattern macro doesn't require anywhere near as much state to be expanded.
chops_ has quit [Ping timeout: 252 seconds]
<elderK>
All expand-pattern-macro needs is basically expander and subpatterns. expander because it lets us specialize and subpatterns so we can manipulate the raw pattern's forms. Instead of returning code, it just returns a new pattern to be translated which might itself be another pattern macro.
ajf has quit [Remote host closed the connection]
<elderK>
White_Flame: Hopefully that helps :
<White_Flame>
if the main question is about parameters on compiling the pattern, then you don't have to worry about cost at all
<White_Flame>
it's only the actual match that you'd want to avoid allocations
<White_Flame>
and if that's codegen, then you don't have to worry about syntactic clunkiness there
<elderK>
Clunkiness being how big the parameter list is?
<White_Flame>
right
<White_Flame>
if no human ever has to interact with those raw calls
<elderK>
Right but it annoys me from an aesthetic perspective :P I also try to keep lines <= 80. It is hard to do with descriptive names, which is why overloading becomes importnat.
<elderK>
I'd also like to learn the convention for breaking parameter lists across lines. I tend to use three two styles, depending on the situation.
<White_Flame>
use hit the enter key and let emacs indent them
<White_Flame>
s/use/just/
<elderK>
I use Vim with SlimV.
<elderK>
I tried Emacs, even took a week to set it up nice but evil doesn't seem work properly with sly or slime, in certain cases.
<elderK>
:( So that put me off.
<White_Flame>
also depending on your syntactic style, you might be able to have a large body with nested closures to wrangle visibility of all these many parameters as they change
<White_Flame>
but if this relies on method dispatch, maybe not
chops_ has joined #commonlisp
chops_ has quit [Changing host]
chops_ has joined #commonlisp
<elderK>
Aye, my thoughts too: No generic-flet :(
<elderK>
I could have a bind macro to you know, curry functions in a nice way but that would only get me so far.
<elderK>
I have more questions too but I have to take a break: I need to review a colleague's MR.
<elderK>
Thank you for your advice, White_Flame. Keep it coming :) I'll be back soon :D
slyrus has quit [Ping timeout: 244 seconds]
Ruby has joined #commonlisp
Ruby2 has quit [Ping timeout: 244 seconds]
shmorg83 has quit [Ping timeout: 248 seconds]
rkazak has joined #commonlisp
haoms has left #commonlisp [#commonlisp]
slyrus has joined #commonlisp
chomwitt has quit [Quit: WeeChat 3.8]
rkazak has quit [Ping timeout: 265 seconds]
slyrus has quit [Ping timeout: 260 seconds]
josrr has quit [Remote host closed the connection]
rkazak has joined #commonlisp
amb007 has quit [Ping timeout: 265 seconds]
pve has quit [Quit: leaving]
slyrus has joined #commonlisp
chops_ has quit [Ping timeout: 248 seconds]
slyrus has quit [Ping timeout: 248 seconds]
screwlisp has joined #commonlisp
chops_ has joined #commonlisp
chops_ has quit [Changing host]
chops_ has joined #commonlisp
chops_ has quit [Ping timeout: 248 seconds]
rkazak has quit [Ping timeout: 265 seconds]
amb007 has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
rkazak has joined #commonlisp
aadcg has joined #commonlisp
chops_ has joined #commonlisp
chops_ has quit [Changing host]
chops_ has joined #commonlisp
<aadcg>
please allow me to spread the news about Nyxt, a web browser written in CL