freenode/#lisp - IRC Chatlog
Search
14:53:45
dlowe
one looks up the protocol and uses a network socket library (like usocket) to implement the protocl
15:55:08
jmercouris
can someone please remind me how to break from a loop and return the element that is true for some predicate?
15:57:40
Bike
and thereis apparently does return the element, so that works too, but it'll be the value returned by the predicate.
15:58:48
jmercouris
let us say this, how to go through values in hash table and check for predicate and return first value that matches
16:00:33
galdor
generally speaking, if you need to regularly find a specific value in a hash table, I'm not sure the hash table is not the right data structure
16:00:54
jmercouris
it is for a sanitation function that checks the state of the objects in the hash table
16:03:25
Bike
your implementation will go and put in a bunch of weird shit, but usually you can get it down to a simple form
16:05:18
Bike
though it might still be kind of weird in the end with hash tables, since with-hash-table-iterator is kind of weird.
17:00:39
sjl_
*every* object can trivially have an infinite number of types of the form `(or actual-type (member 1 2 3 ...))`
17:40:28
pjb
asdf_asdf_asdf: you are completely misled. Lisp types have nothing in common with C types. A lisp object can often be stored in several different C variables (or fields or parameters) of different C types. You cannot determine a C type from a lisp object. You can only know in advance what C type a given C variable (or field or parameter) has, and convert the lisp object into a C value of that C type.
17:40:49
pjb
minion: memo for asdf_asdf_asdf: you are completely misled. Lisp types have nothing in common with C types. A lisp object can often be stored in several different C variables (or fields or parameters) of different C types. You cannot determine a C type from a lisp object. You can only know in advance what C type a given C variable (or field or parameter) has, and convert the lisp object into a C value of that C type.
17:57:36
|Pirx|
i've installed it and get a root page, but easy-handler example from the docs gives 404
18:04:45
|Pirx|
warnings the require about system definitions files that should be under hunchentoot, but root page works anyway
18:09:40
|Pirx|
#P"C:/Users/lenovo/quicklisp/dists/quicklisp/software/hunchentoot-v1.2.38/" is what ql:where-is-system returns
18:10:10
Xach
ok, that's what I get too. and things work like the docs suggest. very weird! what lisp do you use? (it generally shouldn't matter, but maybe it does in this cae)
18:11:17
Xach
I know it's not super-helpful to say "works for me", but it does, as described in the docs, work for me.
18:12:34
|Pirx|
i suspect now something about the environment, maybe i have not included some package by default or something like that
18:16:01
Xach
|Pirx|: i started from a fresh session, used (ql:quickload "hunchentoot"), (hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 4242)), (hunchentoot:define-easy-handler (say-yo :uri "/yo") (name) (setf (hunchentoot:content-type*) "text/plain") (format nil "Hey~@[ ~A~]!" name)), and got the expected results. i didn't run anything else in the session.
18:23:02
|Pirx|
if i put a "yo" file in the directory it serves it, so the problem is that it's not binding the function to the acceptor
19:47:46
boeg
Can someone help be understand why `(some #'typep (list 1) (list 'number 'string 'number))` returns `T` but `(some #'typep (list 1) (list 'string 'number))` return `NIL` ? And is there a better approach when what I want is test of the type of an object is on a list of "allowed types"?
19:47:49
boeg
Can someone help be understand why `(some #'typep (list 1) (list 'number 'string 'number))` returns `T` but `(some #'typep (list 1) (list 'string 'number))` return `NIL` ? And is there a better approach when what I want is test of the type of an object is on a list of "allowed types"?
19:50:37
Bike
If the list is constant you can just do (typep 1 '(or number string)). Is that what you're doing?
20:00:08
splittist
Is there some MOPery that will allow my subclass to skip the super's :after method on INITIALZE-INSTANCE ?
20:02:00
phoe
the standard method combination states that all :AFTER methods are executed in order, no exceptions
20:02:35
phoe
so if you define your own one, then perhaps you might be able to play around with the method order in some way, including which methods actually are executed and which are skipped
20:03:40
splittist
yes. But I was hoping to plug into an existing protocol in existing project that almost, but not quite, allows enough specialisation. I guess I just fork/replicate and be done with it ): (and once I have it working, perhaps a PR)
20:06:42
Bike
:after methods are called most-specific-last, so the super's after method will be called before yours, so you can't exit early... and even if you could i'm not sure how that would be arranged.
20:11:52
splittist
yeah. I think it will be fewer lines to not inherit, and come at it from the protocol-end (i.e. specialise each of the protocol gfs). Thanks!
22:13:22
splittist
OK. After a few hours work I'm back where I started, with something that almost works, but now with a myriad layers of indirection. Time to declare victory and leave it for the evening. :P
22:18:23
splittist
the indirection/protocol thing actually works fine, now. It's just that I started the day with a slightly-broken thing and I'm ending it with exactly the same brokenness. But there is a slightly sleeker yak, so that's something.
22:26:14
splittist
It started yesterday as a bit of a distraction from something else docx-related. (Which itself is ...) Basically, it 's squirrels all the way down.
22:27:22
phoe
depends on your CPU architecture I guess, same question as "which direction does the stack grow"
23:12:36
no-defun-allowed
(defun lousy-or (value &rest values) (let ((next (apply #'lousy-or values))) (if (null value) next value))) ; but this has non-tail recursion and is slightly cursed
23:14:23
White_Flame
some of the cyc code very, very manually performs a non-shortcutting OR on 2 cleanup items for a "success" return, and I'm wondering if there's some little trick
23:15:45
Xach
White_Flame: so it evaluates everything (unlike OR) and still gives the semantics of only being true if something is true.
23:16:07
White_Flame
ah true, I didn't explore SOME because of that, although I know it's been used for such things
23:32:10
gabc
Is there any external requirement to use Qtools? Or this should be enough? (ql:quickload '(qtools qtcore qtgui))