freenode/#lisp - IRC Chatlog
Search
15:22:34
phoe
Hey #lisp - I would like a review for the Travis configuration that I have prepared for the CCL repository.
15:23:16
phoe
The Travis build that has just started for this commit is available at https://travis-ci.com/phoe-trash/ccl/builds/134026306
15:23:31
Cymew
Very creative to implement your own distro since you were fed up with existing package managers.
15:23:50
phoe
The build overall is supposed to fail, since ANSI-TEST and CCL-TESTS are currently failing.
17:10:33
rumbler3113
I threw together a freeform datastructure that sorta looks like a parameter list. I was thinking I'd be able to throw in "tags" that have no value into this list, for example '(scan 1 :check "grep this" fix "cat that" :optional)
17:11:04
rumbler3113
with the idea that users of the format could throw things in and I'd later be able to check for either assignment to a key or the presence or absence of given tags
17:11:38
rumbler3113
I am now coming to realize that I am essentially trying to reimplement destructuring-bind on lambda lists where I am supplying a malformed lambda list
17:13:05
rumbler3113
while it might sound silly, I was hoping to avoid requiring the users to type in the t
17:16:02
rumbler3113
so I was trying to be loose enough with the input that would allow a user to say something like (there's some special property about this check that I'd like to track" and give them a way of adding say :property1 to the list without needing to say :property1 t
17:16:36
rumbler3113
I suppose I could post process the final input and add a t to every unpaired property
17:17:44
rumbler3113
:c so I guess I am also expecting that symbols that aren't keys or properties won't be actual values
17:18:01
sjl_
I don't know what your use case is, but as a user I find it valuable when things work consistently with the rest of the language, even if it's a tiny bit more typing for me
17:18:38
sjl_
being able to say "it's just standard keyword args" is preferable to learning a custom thing, even though I have to type a couple extra chars sometimes
17:22:19
rumbler3113
I read just enough of all of this to be dangerous. I'll just postprocess the input when its all done
17:22:55
rumbler3113
these are non lisp users and their expectations are what I give them, so I'll just tell them to add the t and I'll clean up the rest
17:24:44
rumbler3113
but I would have to guarantee that all of the loose arguments come before any of the keys
17:30:11
p_l
parse it as normal list, iterate on it, and have the code that handles each function know whether it has to consume the next item or not?
17:39:46
rumbler3113
so.. is it true that the only correct usage of &rest and &key together is to expect a list of all parameters, but at the point where &rest is processed, the following arguments must be keyword/value pairs?
17:40:18
rumbler3113
as in, there will never be things in the &rest list that are not supposed to be keyword/value pairs?
17:46:42
Bike
at least, the number of remaining arguments must be even, and the keys have to be symbols.
18:05:38
Xach
ACTION often uses (&rest args &key &allow-other-keys) to define a table-create-and-populate function with string or integer keys
18:07:15
specbot
Invalid Keyword Arguments: http://www.lispworks.com/reference/HyperSpec/Body/03_eae.htm
18:30:48
fiddlerwoaroof
rumbler3113: if you insist on making that work, you'll probably want to define some sort of "schema" for your keyword arguments, so you can tell whether or not the next argument is a new keyword argument or the value of the current keyword argument
18:31:29
fiddlerwoaroof
Or, you could specify values as something like '(:keyword . value) and argumetns that don't take values as just :keyword
18:41:42
Xach
buffergn0me: no, lukego was looking to chat about it, and i saw from logs you mentioned it. was trying to matchmake a little.
18:42:47
buffergn0me
Xach: Ah, ok. I have a couple of months down time from contracts as of today, I was going to install Guix and use CL with that.
19:45:45
rumbler3113
I'm not trying to add more work, I want to leverage existing stuff. I just told my users to add the t and massaged the old data
19:53:57
rumbler3113
I was inspired by that guerrilla lisp opus to "just get started", didn't have any particular way I expected to scarf the input file
20:46:05
mfiano2
Can I somehow use UPDATE-INSTANCE-FOR-DIFFERENT-CLASS to assign slot values to CURRENT based on a list of initargs in PREVIOUS, when I don't know the slot names for the new class, but do know their initargs?
20:48:14
mfiano2
To be specific, I'm not extracting initargs from PREVIOUS. PREVIOUS will have exactly 1 slot which is a list of initargs I want to use to set the slot values of CURRENT
20:50:45
mfiano2
Right. They are dynamically generated with a custom metaclass...but that's a topic for another day...ha
20:51:54
mfiano2
Right. I'm writing a DSL where the user specifies the initargs, but I need to delay shared-initialize so I need to create a fake class with these initargs before i change-class
20:53:21
Bike
sounds like you have a lot of specific concerns. hard to say much without knowing the system. But update-instance-for-different-class should basically call shared-initialize and to do that it'll need slot names, i think.
20:53:32
Bike
i'd also say that whatever you're doing sounds like you'lll be using mop at some point anyway
20:54:28
jackdaniel
phoe: it seems that you use word "modern" with ansi-test as if there were some significant improvements - that is not true. some tests were added and a directory structure has been introduced
20:55:08
mfiano2
Yeah I am for sure. It's quite involved what I am doing, and beyond my ability to even try to explain it at the moment. Just something I've been working on for a month and nearly complete. Looks like I'll have to dig into the MOP some more to pull this off.
20:55:37
jackdaniel
real improvement would be running tests not with make but from a host lisp implementation, i.e: (load-system 'ansi-tests) (ansi-tests:run :ecl "/usr/bin/ecl")
20:57:32
jackdaniel
here is more involved example with slot moppery: https://github.com/McCLIM/McCLIM/blob/master/Core/clim-basic/utils.lisp#L595
20:57:53
phoe
jackdaniel: that's what I meant. ccl-tests has forked ansi-tests a considerable amount of time ago and there is an issue on its test repository that mentions that their fork hasn't been updated for a while.
20:58:10
mfiano2
Well i don't yet have the class even defined at the point I would need the slots. I only have what will be the keyword initargs
20:59:39
Bike
update-instance-for-different-class is called by change-class. and to call change-class you need the new class
21:01:00
mfiano2
Right. I have the old class which knows about the new initargs. I do some things on the old class, create the new class, then change-class it to be an instance of the new class. At some point in there, I need to map the initargs in a slot of the old class to new class initargs
21:02:31
mfiano2
Well I need to map a list of symbols representing initargs of the new class, to actual slot names of new class
21:03:15
Bike
the initargs don't necessarily have any relation to the slot names. if there is some relation, it's one you define yourself
21:06:26
mfiano2
Ok I just thought of a way to get the slot names that will be in the current class. I'll just build the previous class with the same structure as the new one then.
22:31:20
hydrocat
Hello everyone. I am trying to write a text tranformation program but I am not sure about all the things common lisp can do yet. Any recommendation on learning resources ?
22:32:24
hydrocat
I've found a book called "Practical common lisp" but I'd like your opinion on it :)
22:34:39
hydrocat
But for example, to read text from a file, I am using read-char. I mean, it can be done but maybe there would be a better way.
22:35:31
DataLinkDroid
hydrocat: PCL is a decent place to start, especially if (as seems to be the case) you already know something of one or more other languages.
22:38:25
hydrocat
okay, then I have a more specific question, more personal if you will. In the process of implementing a lexer, I am unsure wether I should make a token generic class and implement it multiple times or simply use symbols.
22:43:03
White_Flame
well, having just implemented a lexer, I made each token a list. (:token "foo") (:punc "(") (:whitespace " ") etc
22:43:24
White_Flame
very easy to construct & deconstruct, and Lisp has good support for ad-hoc data in lists
22:47:23
White_Flame
each package has its own instance of symbols. So lexer:foo is not the same symbol as parser:foo, or cl-user:foo. Keywords are visible and resolve to the same symbol from any package
22:47:44
White_Flame
they're intended for data that's broadly visible and self-contained across systems
22:50:01
DataLinkDroid
hydrocat: symbols beginning with a colon are "keyword" symbols belonging to the keyword package
22:50:30
aeth
So if you wanted to compare them you'd have to do something like get the symbol name and reintern them, or get the symbol-name and do a string=
22:50:39
White_Flame
hydrocat: it all depends. I woudln't say to avoid it. But you'll learn the ins & outs with use
22:51:09
White_Flame
source code is made of non keywords. in (defun foo () ..), "FOO" is interned in the package that was read in
22:51:30
aeth
e.g. LOOP takes symbols from any package so (loop for x in bar do (print x)) and (loop :for x :in bar :do (print x)) both work. Most macros will just take keywords, though, because it makes the implementation simpler and the written code more readable
22:51:30
White_Flame
so especially in macros where you're building up source code from symbols, those need to be properly packaged symbols in order to reference the right thing
22:54:23
hydrocat
aeth: But then, wouldn't the loop macro fail in some situations since it is taking symbols from any package ?
22:55:11
aeth
hydrocat: the loop macro probably is doing something like this: (eql (intern (symbol-name symbol) some-package) 'some-package:foo) instead of (eql symbol 'foo)
22:55:45
DataLinkDroid
hydrocat: The LOOP macro would not use the value associated with the symbol, but only its name.
22:56:20
aeth
Oh, and since LOOP is built-in and commonly used, there might also be some internal implementation-specific symbol-name-equal
22:57:18
aeth
(Practically, that wouldn't differ too much from doing string= on the symbol-name, though)
2:35:42
no-defun-allowed
Is there a name for the (somewhat more general) phenomenon described in https://web.archive.org/web/20001030070110/http://www.ai.mit.edu/docs/articles/good-news/subsubsection3.2.2.4.html?
2:36:36
no-defun-allowed
That's where you have code like that matrix addition code which you wouldn't ever use, but you would maybe show off with.