orivej has quit [Ping timeout: 264 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
beneroth_ has joined #picolisp
beneroth has quit [Ping timeout: 258 seconds]
orivej has quit [Ping timeout: 264 seconds]
razzy has joined #picolisp
orivej has joined #picolisp
<
tankf33der>
morning
<
tankf33der>
i wanna test if all functions from glob.l have any usage in pil21-test codebase.
<
tankf33der>
i will find orphans.
<
Regenaxer>
I think some functions are difficult to test
<
Regenaxer>
good morning btw :)
<
tankf33der>
Regenaxer: which one ?
<
Regenaxer>
Everything with user interaction
<
Regenaxer>
E.g. the readline() behavior
<
Regenaxer>
or 'ctty'
<
Regenaxer>
Or breakpoints
<
tankf33der>
i am only about glob.l functions.
<
tankf33der>
seed, diff, rank and so on.
<
Regenaxer>
'ctty' and '!' are there
<
tankf33der>
its ok, will be false alarms.
<
Regenaxer>
ah, ok, these are possible
razzy has quit [Quit: Connection closed]
rob_w has joined #picolisp
orivej has quit [Ping timeout: 258 seconds]
<
Regenaxer>
Cheers aw-
<
aw->
is this acceptable to generate a "good" random string: (lowc (hex (rand (** 2 37) (** 2 38))))
<
aw->
after (seed (in '/dev/urandom ...
<
Regenaxer>
Looks good, depends what is needed
<
aw->
just to generate a random user id
<
aw->
it's not for passwords or anything "secure"
<
Regenaxer>
yes, hex digits
<
aw->
oh haha, password generator with complexity requirements
<
Regenaxer>
not needed here
<
aw->
yeah i like hex because there's no confusion between 1,l,I,0,O ..
<
Regenaxer>
each site has its own crazy requirements
<
aw->
depends on the font, some fonts really make it hard to tell them apart
<
Regenaxer>
and hex is simple to generate
<
aw->
anything new i should test in pil21?
<
Regenaxer>
(** 2 37) etc are constants, so you can use a read macro
<
Regenaxer>
I think nothing atm
<
Regenaxer>
Was busy with PilBox
<
aw->
oh yeah, i'm using constants, i just put (** 2 37) so it was clear
_what_ those constants are ;)
<
aw->
or, what those integers are
<
Regenaxer>
perfect
<
aw->
(lowc (hex (rand 137438953472 274877906944)))
<
aw->
i'm not sure how good is the distribution, all values start with 2 or 3 but it's quite random after that ;)
<
Regenaxer>
you could achieve more general first chars
<
Regenaxer>
(rand `(hex "1...") `(hex "F..."))
<
aw->
hmmm... oh yeah that's a good idea actually
<
aw->
ok i choose (hex "0fffffffff") to (hex "ffffffffff")
<
Regenaxer>
welcome
<
Regenaxer>
yeah, but overkill here perhaps ;)
Blukunfando has quit [Read error: Connection reset by peer]
_whitelogger has joined #picolisp
Blukunfando has joined #picolisp
mtsd has joined #picolisp
mtsd has quit [Quit: Leaving]
aw- has quit [Quit: Leaving.]
orivej has joined #picolisp
libertas_ is now known as libertas
<
Regenaxer>
ht:In and ht:Out done
rob_w has quit [Remote host closed the connection]
aw- has joined #picolisp
<
aw->
Regenaxer: ht:Read ?
<
tankf33der>
Regenaxer: passed and included to mainbase.
<
Regenaxer>
aw-, yes, and In, Out etc
<
Regenaxer>
tankf33der, thanks!
<
Regenaxer>
I made a short test for Out and In by writing to a file with pil64, then compared it with Out and checked with In
<
Regenaxer>
ok so far
<
Regenaxer>
But no hard core tests so far
<
Regenaxer>
Will finish src/db.l next
<
Regenaxer>
aw-, btw, what was it we discussed last time?
<
Regenaxer>
When writing ht, it occurred to me that it has exactly what you need
<
Regenaxer>
you did some rd
<
Regenaxer>
bytewise
<
Regenaxer>
then assembled a char
<
Regenaxer>
What exactly was intended?
beneroth_ has quit [Quit: Leaving]
beneroth has joined #picolisp
<
Regenaxer>
I think t was ht:Read, no?
<
beneroth>
I thought it was another decoding
<
aw->
hmmm no it wasn't ht:Read
<
aw->
custom decoding as beneroth said
<
beneroth>
same principle
<
aw->
it was mixed (rd) and ..
<
aw->
(char (char ...)
<
aw->
07:27 <aw-> (in Fd (make (link (char) (char) (char)) (rd 1) (link (char) (char) (char))))
<
aw->
Regenaxer: the goal was to read utf-8 characters
<
Regenaxer>
yes, and ht:Read does the same
<
Regenaxer>
for a given length
<
Regenaxer>
What is the difference?
<
aw->
i don't know.. i only use ht:Read with http.l
<
aw->
there's not much documentation on it
<
Regenaxer>
sadly yes
<
Regenaxer>
But I feel that ht:Read does exactly what you needed
<
Regenaxer>
read bytewise, returning chars
<
aw->
so it can parse (2 97 98 3 99 100 101) into "ab" "cde" ?
<
Regenaxer>
no, not from a list
<
Regenaxer>
from a stream
<
Regenaxer>
as you did with rd iirc
<
aw->
ok.. a stream of bytes?
<
aw->
how can i try it?
<
Regenaxer>
yes, stream is always bytes
<
Regenaxer>
(ht:Read Count)
<
aw->
(in (pipe (wr 97 98)) (ht:Read 2))
<
Regenaxer>
yes, always a list
<
aw->
(in (pipe (wr 99 100 26085)) (ht:Read 6))
<
aw->
doesnt work for multi-byte chars
<
Regenaxer>
it does
<
Regenaxer>
wr does not work this way
<
Regenaxer>
try a file
<
Regenaxer>
or use 'print' in the pipe
<
Regenaxer>
(prin "雅子")
<
aw->
ok that works but i don't understand why
<
aw->
why doesn't (wr) work?
<
Regenaxer>
it writes only
*bytes*
<
Regenaxer>
prin is the way
<
aw->
yes, i am reading bytes
<
Regenaxer>
26085 is not a byte :)
<
aw->
oh oops, sorry you're right
<
Regenaxer>
ht:Read checks the length
<
Regenaxer>
it got only 3
<
Regenaxer>
so NIL is returned
<
aw->
yes yes all my tests are using bytes, my mistake with 26085
<
Regenaxer>
So ht:Read is like 'line', but with a counw
<
Regenaxer>
returning chars in a list
<
Regenaxer>
Sorry, I did not think of ht:Read last time
<
Regenaxer>
ht:Fmt and ht:Pack do analog thins
<
Regenaxer>
handling utf8
<
Regenaxer>
just lik all i/o functions
<
Regenaxer>
except wr
<
aw->
(in (pipe (wr 99 100 230 151 165)) (ht:Read 5))
<
aw->
ok interesting.. maybe I can use ht:Read
<
Regenaxer>
It is also more efficient, reading the stream directly
<
aw->
how does ht:Pack work?
<
Regenaxer>
It takes a list and packs it
<
aw->
(ht:Pack Lst) ?
<
Regenaxer>
but takes care of some html tags
<
aw->
i was doing this: (pack (mapcar char (99 100 26085)))
<
Regenaxer>
< is packed as <
<
aw->
oh... yeah i can't accept that
<
aw->
i can't "modify" the incoming data in any way
<
Regenaxer>
yes, also fine, but ht:Pack is for html
<
Regenaxer>
yeah, ok
<
aw->
ok i'll see if I can use ht:Read instead
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
orivej has joined #picolisp
orivej_ has joined #picolisp
orivej has quit [Ping timeout: 265 seconds]
orivej_ has quit [Ping timeout: 264 seconds]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
<
tankf33der>
running latest pil21 under gc+
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
Blukunfando has quit [Remote host closed the connection]
Blukunfando has joined #picolisp
aw- has quit [Quit: Leaving.]
aw- has joined #picolisp