freenode/#lisp - IRC Chatlog
Search
2:13:01
pjb
(defparameter *deutsch-woerter* (make-dictionary)) (dictionary-add-word *deutsch-woerter* (make-word "arbeit")) (dictionary-add-word *deutsch-woerter* (make-word "haus")) ; etc.
2:15:09
pjb
Your dictionary can also have some smarts, (dictionary-find-word *deutsch-woerter* "Häuser") -> #<word "Haus" :plural :nominative>
2:16:49
pjb
DICTIONARY-FIND-WORD could be a high level linguistic operator. (word-case (make-word "Häuser")) -> :nominative can be a high level linguistic operation.
2:18:21
ThomasLewis[m]
I would use a word class and a dictionary class with a hash table keyed to the word with the values being instances of word.
2:18:48
pjb
for example. It doesn't matter what you use. What matters is what abstraction you're designing and using.
2:18:56
ThomasLewis[m]
You could even make the slots containing the hash tables indexed by letter, type, or whatever.
2:19:15
pjb
Once you've defined an abstraction, you can change its implementation at will, therefore it doesn't matter if you use a a-list, a hash-table or noodles.
3:09:36
no-defun-allowed
member for lists, find for sequences, position for sequences if you want the index
3:15:14
didi
I don't know I'm disappointed by TYPECASE macroexpasion. I guess I was expecting something more obscure than a COND with a bunch of (typep ...) clauses.
3:18:09
didi
pillton: I don't think so. I strictly used type so I could use some kind of compiler magic or whatever. Oh well.
3:19:58
pillton
I'm sure the applications of typep will get transformed in to that during compilation.
3:20:10
pjb
(search (list "Mapple") (list "Apple" "Mapple" "Zappel") :test (function equal)) #| --> 1 |#
3:20:50
pjb
(search (list "Mapple" "Zappy") (list "Apple" "Mapple" "Zappel") :test (function equal)) #| --> nil |#
3:28:31
gendl
If you make the browser window very long, you get a horizontal scrollbar, and I can't see why (but that's really more of a web dev question not a lisp question.. just putting it out here in case the spirit moves anyone to look at it.)
4:10:10
specbot
The Sequences Dictionary: http://www.lispworks.com/reference/HyperSpec/Body/c_sequen.htm
5:43:48
no-defun-allowed
I have a type, (deftype foo:true () '(eql t)), but I cannot get DEFMETHOD to dispatch on it, and SBCL gives me a warning `Cannot find type for specializer FOO:TRUE when executing SB-PCL:SPECIALIZER-TYPE-SPECIFIER for a STANDARD-METHOD of a STANDARD-GENERIC-FUNCTION.`
5:45:49
no-defun-allowed
That's a shame. I will have to add a rewriting term to my program then when it generates a DEFMETHOD.
5:46:09
beach
paule32: Also, please use #clschool. Your questions are still at a very basic level after many years. And there is no reason to believe that they will improve.
6:38:30
pillton
no-defun-allowed: You can dispatch on types in https://github.com/markcox80/specialization-store. There are a few caveats though.
6:41:44
fiddlerwoaroof
Lispworks will signal a condition like "Error: The type specifier (FUNCTION (STRING) BOOLEAN) cannot be used for discrimination." when using a function type as a slot type
6:44:34
fiddlerwoaroof
I think this maybe be fixed in more recent versions (I put in a support request and got a patch) but the Support person mentioned that the standard says that the slot type should be checked, which is impossible for function types
6:45:23
fiddlerwoaroof
Although, I guess at high safety levels, you could transparently wrap the SETFed function with a function that checks the arg types and the return type
6:47:20
fiddlerwoaroof
I was just trying to install something from QL and got an error, that I solved by removing the slot type definition
6:48:15
fiddlerwoaroof
Then, when I put in a ticket with Lispworks, the sales rep mentioned that the standard for defstruct seems to imply that type is checked... which he claimed to be impossibe
6:49:38
pillton
They are only useful for compiler declarations. You cannot use them to test if a closure accepts arguments according to a given function type.
6:50:17
pillton
I think Bike has looked in to using them for discrimination. I think he concluded that function types are a lost cause.
6:51:15
fiddlerwoaroof
Couldn't you dynamically replace a lambda with a lambda that does something like (check-type (old-lambda (check-type arg1 type1)) 'return-type), though?
6:52:08
fiddlerwoaroof
i.e. treat the type as a contract to be enforced at run time, rather than as a static type declaration
7:05:38
fiddlerwoaroof
Sure, but that's why you make it conditional on the safety and/or speed declarations
7:09:14
ggole
The performance hit can be pretty savage in bad cases, I think the racket people were talking about a few orders of magnitude.
7:23:42
fiddlerwoaroof
the racket contract system is pretty sophisticated too: they have things like Higher-order contracts and stuff
7:32:46
fiddlerwoaroof
But if you want something in the same spirit, there's https://github.com/shinmera/lass
7:34:25
fiddlerwoaroof
Shinmera used to be around here more often and I think that's how I found out about this
7:34:50
fiddlerwoaroof
Generally, Shinmera's libraries work well and have nice APIs and documentation
7:35:55
fiddlerwoaroof
most recently, I've pubilshed data-lens to quicklisp, which is a badly named collection of utilities for building functions up from simpler functions
7:39:48
fiddlerwoaroof
I intend to eventually add features for doing matching reads and "updates" to data structures in a functional styles, so it will actually be somewhat like its name
7:42:20
phoe
fe[nl]ix: lemme make a more descriptive ping: is my current version of split-sequence better for reviewing?
8:05:50
fiddlerwoaroof
rutils, which gets frequently pulled in as a dependency declares a macro on :+ :- :/ and :* to do in-place math
8:06:39
fiddlerwoaroof
Error: Defining macro :FOOBAR visible from package KEYWORD { *handle-warn-on-redefinition* is :ERROR }
8:33:16
dim
the main problem I have with pgloader/SBCL is “Heap exhausted during garbage collection”, where can I read about how to handle “consing” in CL and limit it drastically?
8:46:41
dim
last time I tried to profile pgloader the profiler worked but didn't get useful information, because in a typical small-data run we start a lot of short-lived threads
12:48:55
Ukari
https://plaster.tymoon.eu/view/1178, is it impossible to export function printop in eval-when block in this situation?