freenode/#lisp - IRC Chatlog
Search
6:02:51
no-defun-allowed
re "strange order of design": it's like someone took SICP's wishful thinking and applied it to a whole project
6:09:14
no-defun-allowed
"problem solving methodology? more like problem starting methology: the book"
6:17:06
no-defun-allowed
at school we're taught "analysis, plan, design, evaluate" or words to those meanings
6:21:10
beach
I won't tell you the name of the book because it is so witty (in my opinion) that someone might steal it before I get the book out.
7:02:08
beach
I wrote this page on "uniform reference semantics" several years ago, but there have been some recent questions about what it means, so here is a link: http://metamodular.com/Software-engineering/uniform-reference-semantics.html
8:16:10
flip214
best time might be in winter... then I'd spend a week in Bordeaux or so, having +20°C more than here ;)
8:16:47
flip214
oh, and BTW, I rebased all the SICL typo commits into one-commit-per-file and did a PR.
8:19:48
beach
flip214: January and February are generally rotten here when it comes to the weather. December is usually nice, though.
8:32:38
shka_
why do you have parent slot here? https://github.com/robert-strandh/Clump/blob/master/2-3-tree/2-3-tree.lisp
8:40:52
beach
shka_: It is not strictly necessary. I have written versions without the parent reference. But in certain applications, you might want to avoid inserting and deleting elements by always starting the search at the root.
8:41:40
beach
shka_: For example, let's say you are implementing an editor buffer and you want to keep lines of text in the leaves.
8:42:29
beach
... then you can keep a pointer to the current line and when it splits, you can use the parent pointer to accomplish the new insertion.
8:50:00
shka_
jackdaniel has this nifty reader macro that simply turns [foo bar] into (funcall foo bar)
8:53:28
heisig
You can also write a with-functions macro that generates appropriate FLET bindings, such that (with-functions (g) BODY) turns into (flet ((g (&rest args) (apply g args))) BODY).
9:05:11
jackdaniel
the most useful macro I have is the one ripped from cmuutils, namely the collecting macro
9:07:55
jackdaniel
at least Alan Perlis did, it is a paraphrase. original was: "Syntactic sugar causes cancer of the semi-colons"
9:53:06
beach
A third one is to have a generic function LEAF-CLASS that dispatches on the container class. The MOP does things like that.
11:20:59
frgo
Question (off topic): What kind of API authoring tools (Non-REST) and code generation tools are there that you guys are considering good stuff?
11:46:50
frgo
Shinmera: Some editor that allows me to create and maintain an API spec for functional APIs during design phase and then generate code from that API spec for a set of languages.
11:47:43
Shinmera
Then I can only say that everything I've seen that advertises to do this is a catastrophe in practise.
11:48:26
frgo
Me too, so far. All the tools that are kind of doing the trick are for REST APIs. I don't need that yet.
11:55:22
jackdaniel
what is nice such protocol may be used to interoperate between different languages (i.e Go vs CL)
12:12:04
pjb
frgo: but actually, any generator can be good, for example, cl-ometa. or just your own custom macros.
13:25:01
AeroNotix
Are there any webrtc libraries available? A quick google doesn't turn up anything
14:45:54
loke
Well, remember that the issue I had was to find out a way to extend DEFINE-COMMAND such that it's possible to know the presentation type?
14:53:38
loke
I type the command "Copy to clipboard" and it will prompt me for an object to copy. At this point, all objects become clickable (since the command is specialised on T)
14:54:27
loke
I click the command, then it records the actual object. Once I press return, it simply calls the COM-COPY-TO-CLIPBOARD function with this object as argument.
14:55:01
loke
The issue, I think, is that the knowledge of the presentation type is lost at the point of clicking on the object. Everything after that only deals with the object.
14:59:46
loke
I was wondering why when I clicked on a Maxima equation, the copy-to-clipboard thing decided to copy the Lisp Sexp form... Turns out that since i have multiple presentaton-translators, once of which being the Maxima-expression-to-CLIM:EXPRESSION (so that I can insert maxima equations into the Lisp REPL), it decided to apply that translator when I clicked on the object.
15:04:41
loke
What if instead of specialising on T, I let com-copy-to-copy-to-clipboard specialise on some speaicl object, let's call it CLIPBOARD-OBJECT-WRAPPER or something like that. I can then have a single translator that translates any object T into a CLIPBOARD-OBJECT-WRAPPER byt simply instnatiating it like so: (make-instance clipboard-bject-wrapper :object OBJ)
15:06:17
beach
How will that solve the problem? It seems to me you still lose the presentation type. No?
15:06:55
loke
At least the unwanted call to the translator will be avoided. So that's one problem solved.
15:07:32
loke
But what if there is a way (by adding a feature, perhaps) to have the presentation-translator function know what the original presentation type was?
15:20:51
loke
The translator is called with the actual presentation object as one of its keyword arguments
15:24:36
loke
All I had to do was to add a second argument to the arglist in the translator named PRESENTATION
15:26:55
loke
Now that I know what to look for, it's actually documented in the entry for DEFINE-PRESENTATION-TRANSLATOR
15:27:09
loke
"arglist, tester-arglist, and doc-arglist are each an argument list that must "match" the following "canonical" argument list.
15:27:09
loke
In order to "match" the canonical argument list, there must be a single positional argument that corresponds to the presentation's object, and several named arguments that must match the canonical names above (using string-equal to do the comparison)."
16:00:01
Bike
sxhash has to work ont he level of EQUAL, but two distinct standard-objects are never equal, so
16:01:39
shrdlu68
I wish to sxhash the subsequence of a sequence without subseq'ing, any idea how I can do this?
16:02:30
pjb
shrdlu68: you can use just the two or three first elements, or the first the middle and the last one, etc.
16:04:23
Bike
you mean you want the hash code to be an array index? and you want two distinct EQUAL objects to have the same index
16:05:23
Bike
if you really want to avoid subseq, i suppose i'd just use my own hash function, and mix up the elmeents