freenode/lisp - IRC Chatlog
Search
1:16:56
aeth
krwq: if you're going to do the keyword thing, I'd (1) put them after the name and (2) put them all in one list, like this: (defun+ foo (:experimental) (x) (format t "Hello, ~A!~%" x))
1:17:50
aeth
krwq: The difference is that you could add new flags without having to update every user of defun+
1:18:50
Bike
and i'd implement mark like (defmacro mark ((&rest plist) &rest syms) `(eval-when ... ,@(loop for (k v) on plist by #'cddr append (loop for s in syms collect `(setf (get ',s ',k) ',v)))))) mod actually trying it
1:19:54
aeth
krwq: It'd be defined like this, except you'd also check the flags list as well (with member perhaps?): (defmacro defun* (name flags lambda-list &body body) `(defun ,name ,lambda-list ,@body))
1:20:35
aeth
krwq: I'm not sure how you'd implement an arbitrary number of flags outside of a flag list.
1:22:43
krwq
aeth: i don't think of it as flag list, it is just a list which happens to contain flags, name args and body
1:22:45
aeth
krwq: you could have them at the top level but then they'd be boolean and it'd be hard to update the macro... like: (defmacro defun* (name experimental-p lambda-list &body body) ...) where experimental-p would be by convention :experimental or nil
1:25:31
aeth
krwq: (defmacro defun* (&rest name-args-body-and-flags) ...) would be seriously overcomplicating things, if that's what you mean. And SLIME wouldn't indent the body properly.
1:26:18
krwq
aeth: emacs is modable - i chose lisp so i can be flexible and not because i like parentheses
1:27:47
aeth
Both my solution and Bike's require considerably less work for essentially the equivalent effect.
1:29:14
krwq
Bike: aeth: i like having options - i need to consider if i prefer clumsy syntax with easy implementation or better syntax with PITA to manage implementation
1:29:27
aeth
The difference in implementation effort between (defun* :keyword1 :keyword2 ... name args &body body) and (defun* name (:keyword1 :keyword2 ...) args &body body) is very significant.
1:30:13
Bike
i like mine because it works for non-functions no problem, values are arbitrary, use is arbitrary, easy to remove and edit...
1:33:20
krwq
nyef: so i'd need to i.e. add a file to a system which reads asd and then all the files and finds it?
1:47:50
fiddlerwoaroof
Is there a way to make sure that a class is finalized? ensure-class doesn't seem to do it.
1:57:35
fiddlerwoaroof
Anyways, I'm working on a slackbot that reacts to commands embedded in messages (where a command is a white-space delimited sequence of characters beginning with ;)
1:58:19
fiddlerwoaroof
I'm trying to figure out the best way to encode the command tabl: right now, I just have a global hash-table, but I'm starting to wonder if it'd be better to have a class-allocated slot with a hashtable
1:59:23
fiddlerwoaroof
Or just define a generic function with an around method that determines if the string is valid command, and then converts it to a symbol
3:22:20
treexform
I've been trying to find some reference tree pattern matching and subtree replacemente code for an hour now... can anyone help me find it?
3:23:02
treexform
something like BURS but without the tile-matching if that makes sense... I just want to see one implemented, the matcher and the recursive replacement function for tree nodes.
10:28:35
edgar-rft
loke: probably yes, but there are *many different* package formats. Which one are you talking about?
10:29:40
iago
that was what I was thinking, binary format is so application dependent that it would be hard to write a generic library to decode it
10:29:56
loke
edgar-rft: Specifically, I need to decide TCP headers. I know the format, and I can easily do it manually using lots of LOGAND and ASH
10:30:15
loke
But if there a package that allows me to neatly declare the format, things would be easier.
10:33:39
ogamita
iago: it's not hard to write a generic library: you define a DSL to describe binary format and to get generated automatically the functions to access it.
10:34:50
ogamita
iago: see for example https://gitlab.com/com-informatimago/com-informatimago/blob/master/common-lisp/data-encoding/data-encoding.lisp
10:35:56
ogamita
iago: and https://gitlab.com/com-informatimago/com-informatimago/blob/master/common-lisp/data-encoding/data-encoding-test.lisp
10:37:10
ogamita
iago: notice in data-encoding-test.lisp how definining a binary format and using it as easy as defining and using a structure or a CLOS class.
10:41:27
Xach
loke: binary-types and possibly others. and a core example in PCL is doing it via CLOS.
10:41:30
loke
iago: However, libpcap itself doesn't include any functions to parse packets. You get binary blobs.
10:42:07
loke
Here's my pcap code in case anyone is interesting. It's a work in progress: https://github.com/lokedhs/trivial-pcap
10:43:17
Xach
loke: i've often thought about rolling my own, so often that i think probably many others have, but i can't remember names
11:10:29
_death
also I once wrote a python.struct-like thingy for ad hoc munging https://github.com/death/constantia/blob/master/struct.lisp
11:52:17
sjl
cool, ELS schedule is posted http://european-lisp-symposium.org/editions/2017/content-programme-full.html
12:31:39
beach
easye: There is a tradition, but things are different this year because of the co-location with <programming>
12:32:06
beach
easye: So the banquet is on Wednesday, and it's for the entire <programming> conference.
12:33:10
beach
There is nothing organized for just ELS, and the banquet is not included in the price for just the symposium and the workshops.
12:36:00
easye
+1 on an April 3d dinner. But I have no cycles to help organize (working on abcl-1.5.0)