abel-norm has quit [Remote host closed the connection]
<beneroth>
interesting issue, mickiebyrd and Regenaxer :)
<Regenaxer>
yeah
<Regenaxer>
'chop' returns a list unmodified, and 'flip' is destructive
<Regenaxer>
'dirname' assumes to get a symbolic argument, not a list
<beneroth>
well instead of (chop F) one could do (if (lst? F) (copy F) (chop F))
<beneroth>
but it is a unlikely usage I'd say, so maybe don't add the overhead to the general case for this.
<Regenaxer>
No, just 'reverse' instead of 'flip'
<beneroth>
it makes sense in stream parsing maybe
<beneroth>
hm, T
<beneroth>
right, less cells.
<Regenaxer>
But I don't want to create garbage
<Regenaxer>
So the current implementation is best I think
<beneroth>
only first flip would be needed to change to reverse.
<Regenaxer>
yes
<Regenaxer>
but still garbage
<Regenaxer>
Files are always assumed to be symbols
<beneroth>
T
<Regenaxer>
eg. for 'in' and 'out'
<Regenaxer>
So your proposal would be (if (lst? F) (flip (chop F)) (reverse F))
<Regenaxer>
But I think still not necessary
<beneroth>
T
<beneroth>
Regenaxer, is there a string equivalent for ht:Prin ?
<beneroth>
to do html escaping
<Regenaxer>
Not exactly
<Regenaxer>
ht:Pack is similar I think
<beneroth>
it does the reverse
<Regenaxer>
hmm
<beneroth>
(pipe
<beneroth>
(till T) )
<beneroth>
(ht:Prin Str)
<Regenaxer>
yeah, but ugly
<beneroth>
yeah. good enough but not nice. overhead.
<Regenaxer>
(till NIL T)
<Regenaxer>
right
alexshendi has quit [Ping timeout: 248 seconds]
abel-normand has quit [Remote host closed the connection]
abel-normand has joined #picolisp
rob_w has quit [Read error: Connection reset by peer]
Regenaxer has left #picolisp [#picolisp]
Regenaxer has joined #picolisp
<beneroth>
Regenaxer, best way to make a list out of a cons pair and vic versa?
<Regenaxer>
hmm, a list *is* a cons pair (?)
<beneroth>
(cons 1 2) -> (1 . 2)
<beneroth>
(list 1 2) -> (1 2) = (1 2 . NIL)
<Regenaxer>
The first two elements?
<beneroth>
like better version of (setq Pair (cons 1 2)) (make (link (car Pair)) (link (cdr Pair)))
<beneroth>
like appending a NIL cell
<Regenaxer>
hmm, I don't understand the problem. Just (list (car Pair) (cdr Pair)) ?
<beneroth>
yes. no better way than this, e.g. a destructive way?
<Regenaxer>
btw, 'link' accepts multiple args
<Regenaxer>
yes
<beneroth>
ok
<beneroth>
thx
<Regenaxer>
(con List (cadr List))
<beneroth>
ah right, thanks for the hint about link
<Regenaxer>
(con Pair (list (cdr Pair)))
<Regenaxer>
destructive
<beneroth>
ah, thx!
<Regenaxer>
:)
abel-normand has quit [Ping timeout: 255 seconds]
<beneroth>
Regenaxer, a question about (iter). "If flg is non-NIL, partial keys are skipped." - what is a "partial key" in pil DB ? a key with a Hook ?
<Regenaxer>
yes and no
<beneroth>
what is a "partial key" ?
<Regenaxer>
partial keys are from subclasses of +Idx
<Regenaxer>
they generate one full key, and e.g. substrings
<beneroth>
subkeys of +Idx or +Ref ?
<Regenaxer>
So with non-NIL, you get exactly one hit per object
<Regenaxer>
not +Ref
<Regenaxer>
+Ref is also 1:1
<beneroth>
ah right
<Regenaxer>
but +Idx or +IdxFold
<beneroth>
though +Idx is not subclassed. but prefixed with other classes.
<beneroth>
as far as I can see
<Regenaxer>
eg 'collect' uses this
<Regenaxer>
correct
<beneroth>
ok, so no relevance for +Aux
<Regenaxer>
+Idx is not subclassed
<Regenaxer>
right, no relevance for +Aux
<beneroth>
thx
<Regenaxer>
I think +Sn too
<Regenaxer>
hmm, no
<Regenaxer>
but it generates one additional entry
<beneroth>
+Sn and +Idx are usually combined as far as I grok it
<Regenaxer>
yes
<Regenaxer>
makes most sense
<Regenaxer>
and only for person names
<beneroth>
will come back about +Idx, still have to fully dive into +Idx and +IdxFold and +Sn
<beneroth>
thx :)
<Regenaxer>
ok
<Regenaxer>
Recently I mostly use +IdxFold for non-person indexes
<beneroth>
for fulltext search?
<Regenaxer>
and +Fold +Ref for telephone, e-mail etc
<Regenaxer>
yes
<beneroth>
I see
<Regenaxer>
I made a cheat-sheet
<beneroth>
oh, could you make an txt / html or PDF out of it? :D
<Regenaxer>
the right-most column shows the predicate for select queries
<Regenaxer>
head, fold etc
<beneroth>
ah nice
<beneroth>
wonderful
<beneroth>
good documentation of they key structure
<Regenaxer>
yeah
<Regenaxer>
These are the combinations I actually use
<beneroth>
I can see that
<Regenaxer>
It shows how they generate more or fewer entries per object
<beneroth>
thank you, this will be a big help. good guideline
<Regenaxer>
:)
<Regenaxer>
Should better be in the Wiki or so
<beneroth>
domo
<beneroth>
(or so)
<Regenaxer>
correct
<beneroth>
aye. for the moment I put it in my notices.
<Regenaxer>
domo arigato
<Regenaxer>
ok
<Regenaxer>
I'm too lazy atm ;)
<beneroth>
arigatou gozaimasu
<beneroth>
np
<Regenaxer>
yes, even better
<Regenaxer>
more polite
<beneroth>
me to / to busy with other things. if it doesn't end up in wiki until day X, I will write the article
<Regenaxer>
cool :)
<Regenaxer>
no hurry
<Regenaxer>
Simple idea: I put it also into the release TGZ
<beneroth>
T
<beneroth>
doc64
<beneroth>
or doc, if the key structure is the same in pilDB 32, I think it is...
<Regenaxer>
Does it not apply to pil32?
<Regenaxer>
yes, it should be the same
<Regenaxer>
I have it here as doc/search
<Regenaxer>
(was not clear from the pastebin of course)
<beneroth>
ok
<beneroth>
yep that isn't/wasn't in distro
<Regenaxer>
T
abel-normand has joined #picolisp
u0_a615 has joined #picolisp
u0_a615 has left #picolisp ["WeeChat 1.9.1"]
alexshendi has joined #picolisp
<mickiebyrd>
Howdy
<mickiebyrd>
Regenaxer: when using httpGate, only GET and POST methods get forwarded to the app
<Regenaxer>
correct
<mickiebyrd>
httpGate.c line 409-419
<mickiebyrd>
why not allow any method?
<mickiebyrd>
something like:
<mickiebyrd>
if (!(p = strpbrk(buf, " "))) return 1;
<mickiebyrd>
if (*++p == '/') ++p;
<Regenaxer>
It is not needed for picolisp applications, and would just be a security hole
<mickiebyrd>
Ah ok.
<Regenaxer>
It is rather specialized ;)
<Regenaxer>
Which other method would you think of?
<Regenaxer>
DEL?
<mickiebyrd>
I am actually using DELETE and allowing PUT
<Regenaxer>
In any case, @lib/http.l also understands only these two methods
<Regenaxer>
ok
<Regenaxer>
It is not a file server
<Regenaxer>
so neither DELETE nor PUT make sense
<mickiebyrd>
Was wondering why the app broke when using httpGate.
<Regenaxer>
The GUI is based on GET and POST
<Regenaxer>
Some port problem?
<Regenaxer>
It allocates ephemeral ports
<Regenaxer>
on localhost
<mickiebyrd>
Oh, I am using a custom HTTP server with gate as the frontend to manage ssl.
<Regenaxer>
I see
<Regenaxer>
The port forwarding of httpGate works only with the 'http' function I think
<Regenaxer>
it even uses a custom header field "x-pil:"
<mickiebyrd>
httpGate actually works great so far. I just had to modify it to allow additional HTTP methods and added an additional header "X-Pil: *Name={np-key}"
<Regenaxer>
and the baseHRef handling
<Regenaxer>
Perhaps is the socat tool better as ssl frontend?