libera/#commonlisp - IRC Chatlog
Search
22:58:06
Bike
an implementation accepting a function would be nonconforming, and i don't think any of them do
22:58:47
phoe
since type specifiers can already be unreadable, adding a function object in there won't break anything
23:00:46
_death
so the thing is, types are not first class objects.. you can only refer to them via type specifiers
23:00:58
Bike
more seriously i think any HFT of types would warrant some thought about what types are actually for. i thought about it once and came up with four uses pulling them in different directions, though i don't remember the fourth now
23:19:26
Bike
types are a predication DSL, used to describe constraints to the compiler for optimization, and used to describe storage classes for arrays and structures and stuff.
0:41:01
Guest82
ok, thanks... I'm trying now. I hope I will learn lisp but also be successful making an app haha
1:41:00
pjb
phoe: note that deftype is like defmacro. If you allow closures in satisfies, each time the type is expanded you get a different closure!
1:41:32
pjb
phoe: AFAICS, this is the reason why we're restricted to functions (that have to be defined in the compilation environment too, most of the time, so eval-when).
1:44:13
pjb
phoe: but granted, it makes it very difficult to define list-of (deftype list-of (element-type) `(satisfies ,(once-or-twice (eval `(defun ,(gensym) (object) (is-proper-list-of ,',element-type object)))))) etc…
1:44:39
pjb
in the current spec, you need to define a toplevel function for each type of list-of lists.
1:46:40
pjb
phoe: perhaps like this: (deftype list-of (element-type) (let ((predicate (lambda (object) (typep object element-type)))) `(satisfies ,(compile (gensym) predicate))))
1:47:00
pjb
I mean: (deftype list-of (element-type) (let ((predicate (lambda (object) (is-proper-list-of object element-type)))) `(satisfies ,(compile (gensym) predicate))))
1:48:22
pjb
Yes, that works, with eg. (defun is-proper-list-of (object element-type) (and (proper-list-p object) (every (lambda (element) (typep element element-type)) object)))
1:50:57
pjb
But as I said, this generates a new closure and a new toplevel function for each occurences of (list-of foo) (list-of foo) (list-of foo) -> 3 equal closures, 3 toplevel functions. So you want to manage a cache, which has the misfortune of having to live across the compilation-environment and the runtime environment. ie. you need to rebuild the cache at load-time or execute…
1:51:55
pjb
satisfies would have to do the same without necessarily knowing what keys to use for the cache, if it had to deal with closures itself. at least, when the user does it, he knows what he's doing…
5:34:27
hayley
I can't think of one, but nginx has worked fine for me. Is there anything specific you need from it?
9:45:04
lisp123_
flip214: then that would be the answer to the earlier query on how to reverse proxy in CL
9:45:50
flip214
unless there is some specific rewriting to do, I'd go for a standard product, though (nginx, apache, haproxy, etc.). even casual text changes (via regexes) can be done in apache, for example.
9:46:19
lisp123_
yeah nginx is a very easy to use reverse proxy imo (well since I know how to use it, hence its easy to use :D)
9:51:05
flip214
lisp123_: depending on the answer time of the http services "behind" the proxy you might have quite a lot of simultaneous active http connections.
9:51:43
flip214
HT by default creates threads; quux-ht uses a thread pool; perhaps you should take a look at tpd2 or so, to have a bounded number of threads for an (more or less) unbounded number of connections.
9:52:59
lisp123_
flip214: Good to know :) I was just answering the earlier question on the chat, I've personally moved away from web dev for the foreseeable future
9:53:16
lisp123_
perhaps I will come back in the future, after all everything commercial is a SaaS these days