orivej has quit [Ping timeout: 246 seconds]
Blukunfando has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
_whitelogger has joined #picolisp
orivej has joined #picolisp
Blukunfando has quit [Ping timeout: 246 seconds]
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
mtsd has joined #picolisp
rob_w has joined #picolisp
<
tankf33der>
will try to compile and run tests under clang’s stack guard for pil21
<
tankf33der>
iirc was ok at spring
<
Regenaxer>
Hi tankf33der! What does stack guard do?
<
aw->
Regenaxer tankf33der hi
<
Regenaxer>
Hi aw-!
<
tankf33der>
adding stack canaries and check if somebody touch them
<
tankf33der>
they should be alive and untouched
<
Regenaxer>
good thing
<
Regenaxer>
Useful to detect buffer overflows
<
Regenaxer>
But buffer overflows are improbable in pil I think, as buffers are only used for file names and such
<
Regenaxer>
But I can never be sure of course
<
aw->
Regenaxer: how can i convert a UTF-8 character to a list of bytes? is there a function for that?
<
Regenaxer>
hmm, I think not directly
<
Regenaxer>
you could use 'adr' and struct
<
aw->
(char) works with single-byte, but not multi-byte
<
Regenaxer>
(char) is ok
<
Regenaxer>
(adr (char "名古屋"))
<
Regenaxer>
just (adr "名古屋")
<
Regenaxer>
(struct (adr "名古屋") '(B B B))
<
Regenaxer>
-> (104 32 171)
<
Regenaxer>
kind of ;)
<
aw->
interesting..
<
Regenaxer>
The symbol name has the bytes
<
Regenaxer>
"名古屋" is a symbol
<
Regenaxer>
'adr' gives a pointer to the symbol
<
Regenaxer>
This is pil21!
<
Regenaxer>
'adr' was a little different in pil64
<
Regenaxer>
not directly useful as a pointer iirc
<
tankf33der>
i will add this to tests
<
aw->
so i need to know the size in advance
<
aw->
how can i get that?
<
Regenaxer>
Then use 'byte' instead of 'struct'
<
Regenaxer>
until you get 0
<
Regenaxer>
(let P (adr ..) (until (=0 (byte P)) ... (inc 'P))) or so
<
Regenaxer>
or simply fetch 4 bytes with 'struct'
<
aw->
ok i think i will use a different technique, this is not pretty ;)
<
Regenaxer>
tankf33der, before you add test
<
Regenaxer>
we must be sure the above is correct
<
Regenaxer>
is (104 32 171) right for Nagoya?
<
aw->
i dont think so
<
aw->
that is 3 kanjis
<
aw->
each one is definitely not 1 byte
<
Regenaxer>
yeah, not correct
<
Regenaxer>
(out "a" (prin "名古屋")) (hd "a")
<
Regenaxer>
00000000 E5 90 8D E5 8F A4 E5 B1 8B
<
tankf33der>
# pil21 +
<
tankf33der>
: (struct (adr "名古屋") '(B B B))
<
tankf33der>
-> (184 220 68)
<
Regenaxer>
It is a bad example
<
Regenaxer>
3 chars
<
Regenaxer>
first, use only one
<
Regenaxer>
and then! it is encoded!
<
Regenaxer>
shifted by 4 and or'ed with 2
<
Regenaxer>
so not a good way!
<
Regenaxer>
see doc/structures
<
Regenaxer>
hmm, sorry
<
Regenaxer>
not so easy
<
Regenaxer>
A pipe would work, but is heavy
<
Regenaxer>
hmm, I think we had this discussion already?
<
aw->
right.. pipe to stdin and then read it
<
aw->
no i think we discussed the reverse.. convert bytes to utf-8 ;)
<
Regenaxer>
converting unicod to utf8 bytes?
<
Regenaxer>
and there was some trick
<
Regenaxer>
in ht:XXX ?
<
Regenaxer>
hmm, ok
<
Regenaxer>
Anyway, my above idea was bad
<
Regenaxer>
adr gives the pointer to the value
<
Regenaxer>
so 8 must be subtracted
<
Regenaxer>
but the name is encoded, shifted and or'ed
<
Regenaxer>
The interpreter does this all the time
<
Regenaxer>
You might call some internal function via 'native'
<
Regenaxer>
What will you do with the bytes?
<
Regenaxer>
Do you really need them as a list?
<
Regenaxer>
I suspect it is some I/O, so there might be a direct way
<
aw->
perhaps there is, but I don't want my code to rely on any I/O functions
<
Regenaxer>
yeah, ok
<
Regenaxer>
Buw why do you need a list of bytes?
<
Regenaxer>
instead of the unicode value?
<
aw->
so i can compare it, store it, transfer it, who knows
<
aw->
lots of reasons
<
Regenaxer>
All that you can do with the unicode
<
Regenaxer>
Whe utf8 bytes are just a serialization of the code
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
<
aw->
how do i get the unicode?
<
Regenaxer>
with (char)
<
Regenaxer>
(char "A") -> 66
<
aw->
oh right.. it gives a large integer
<
Regenaxer>
So not too large
<
aw->
ok so how can i convert that to a series of unsigned ints?
<
Regenaxer>
This is the shifting etc process
orivej has quit [Ping timeout: 265 seconds]
mtsd has quit [Quit: Leaving]
Blukunfando has joined #picolisp
<
aw->
can you explain the new (native) result specifications in doc/diff ?
<
aw->
i never remember what they are
<
Regenaxer>
W and P?
<
Regenaxer>
It is documented now
<
Regenaxer>
(doc 'native) in pil21
Blukunfando has quit [Ping timeout: 246 seconds]
Blukunfando has joined #picolisp
rob_w has quit [Quit: Leaving]
Blukunfando has quit [Read error: Connection reset by peer]
Blukunfando has joined #picolisp
orivej has joined #picolisp
<
tankf33der>
damn, shortest path search in unweighted graph.
<
tankf33der>
I remember nothing.
<
Regenaxer>
You mean Dijkstra's algorithm?
<
Regenaxer>
There was a rosetta task
orivej has quit [Ping timeout: 246 seconds]
jibanes has quit [Ping timeout: 265 seconds]
jibanes has joined #picolisp
Regenaxer has quit [*.net *.split]
DerGuteMoritz has quit [*.net *.split]
Regenaxer has joined #picolisp
DerGuteMoritz has joined #picolisp
casaca has quit [*.net *.split]
beneroth has quit [*.net *.split]
libertas has quit [*.net *.split]
casaca has joined #picolisp
beneroth has joined #picolisp
libertas has joined #picolisp
emacsomancer has quit [*.net *.split]
lodsw has quit [*.net *.split]
viaken has quit [*.net *.split]
jibanes has quit [*.net *.split]
jibanes has joined #picolisp
lodsw has joined #picolisp
viaken has joined #picolisp
emacsomancer has joined #picolisp
emacsomancer has quit [Max SendQ exceeded]
Blukunfando has quit [*.net *.split]
shoshin has quit [*.net *.split]
inara has quit [*.net *.split]
wineroots has quit [*.net *.split]
joebo has quit [*.net *.split]
inara has joined #picolisp
shoshin has joined #picolisp
emacsomancer has joined #picolisp
michelp has quit [*.net *.split]
tankf33der has quit [*.net *.split]
dTal has quit [*.net *.split]
michelp has joined #picolisp
dTal has joined #picolisp
tankf33der has joined #picolisp
joebo has joined #picolisp
wineroots has joined #picolisp
mario-goulart has quit [*.net *.split]
Nistur has quit [*.net *.split]
Guest84035 has quit [*.net *.split]
anddam has quit [*.net *.split]
Blukunfando has joined #picolisp
anddam has joined #picolisp
Guest84035 has joined #picolisp
mario-goulart has joined #picolisp
Nistur has joined #picolisp
orivej has joined #picolisp