orivej has quit [Ping timeout: 256 seconds]
orivej_ has joined #picolisp
razzy has quit [Quit: Connection closed]
orivej_ has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
_whitelogger has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej_ has joined #picolisp
nicktick has joined #picolisp
orivej_ has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 272 seconds]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
beneroth has quit [Quit: Leaving]
beneroth has joined #picolisp
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
orivej_ has joined #picolisp
alexshendi has quit [Ping timeout: 272 seconds]
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
<
Nistur>
how's tricks?
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
<
DKordic>
Greetings everyone.
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej_ has joined #picolisp
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
nicktick has quit [Ping timeout: 272 seconds]
orivej has quit [Quit: No Ping reply in 180 seconds.]
_whitelogger has joined #picolisp
orivej has joined #picolisp
<
beneroth>
Regenaxer, might it be that (symbols) only works on top-level?
<
Regenaxer>
Which top level? REPL?
<
Regenaxer>
There is nothing special
<
Regenaxer>
'symbols' is a normal function ...
<
beneroth>
I did (ifn Foo (bar) (symbols '(dings pico)) (print bingo))
<
beneroth>
bingo being from 'dings
<
beneroth>
it was NIL
<
beneroth>
when I moved the call to symbols to the top level in the script, it workded
<
Regenaxer>
Remember that 'symbols' has influence on 'read' only
<
beneroth>
no idea what I did wrong
<
beneroth>
makes sense
<
beneroth>
of course
<
beneroth>
so yeah..so symbols only makes sense on top level ;-)
<
beneroth>
in a file
<
Regenaxer>
Not only
orivej has quit [Ping timeout: 240 seconds]
<
beneroth>
when reading too... or for reader macros
<
Regenaxer>
but things already read are not influenced
<
Regenaxer>
In pilbox I call it a lot in tasks etc
orivej has joined #picolisp
<
Regenaxer>
So whenever the next I/O should happen in that search order
orivej has quit [Ping timeout: 240 seconds]
_whitelogger has joined #picolisp
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 264 seconds]
nicktick has joined #picolisp
orivej has joined #picolisp
orivej_ has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej_ has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej_ has joined #picolisp
nicktick has quit [Remote host closed the connection]
orivej has joined #picolisp
orivej_ has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
xkapastel has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
<
tankf33der>
Regenaxer: i gonna prove time_t issue is pil21 issue.
<
Regenaxer>
It is a library issue
<
Regenaxer>
See the man page
<
Regenaxer>
Argument pointer is deprecated
<
tankf33der>
i saw sources. pil64 works.
<
Regenaxer>
I did a C test program
<
Regenaxer>
pil64 links another C library (?)
<
tankf33der>
pil64 works.
<
tankf33der>
nope :)
<
Regenaxer>
So why does it not work? Nothing special here
orivej has quit [Ping timeout: 240 seconds]
<
Regenaxer>
The part in 'native' in pil21 is trivial, and the same as in other cases where it works
orivej has joined #picolisp
<
Regenaxer>
time(2) man page: "The tloc argument is obsolescent and should always be NULL in new code. When tloc is NULL, the call cannot fail."
<
tankf33der>
i've emulate almost everything.
<
Regenaxer>
BTW, I don't understand why the test is (native "@" "time" NIL '(Tim (8 B . 8)))
<
Regenaxer>
The function's man page says:
<
Regenaxer>
time_t time(time_t *tloc);
<
Regenaxer>
and time_t is a number, right?
<
Regenaxer>
Not an 8-byte-buffer
<
Regenaxer>
Confused :)
<
tankf33der>
time_t is int64
<
tankf33der>
size(time_t) is 8 bytes
<
Regenaxer>
not a 8-byte buffer
<
Regenaxer>
it is seconds since epoch
<
tankf33der>
so in decoded to 8 items array
<
tankf33der>
so it decoded to 8 items array
<
Regenaxer>
hm, ok: struct tm *localtime(const time_t *timep);
<
Regenaxer>
So it works again
<
Regenaxer>
but no need to make a list of 8 numbers
<
tankf33der>
this one is works in pil21
orivej has quit [Quit: No Ping reply in 180 seconds.]
<
Regenaxer>
ok, localtime may work
<
Regenaxer>
The issue is that 'time' does
*not* set the pointed value
orivej has joined #picolisp
<
tankf33der>
it works if time set pointed value by return
<
tankf33der>
i already have test for returned value and gonna write test for set argument
<
Regenaxer>
"if time set pointed value by return"?
<
Regenaxer>
(native "@" "time" 'N 0)
<
tankf33der>
time function is very simple it set input argument and return value by the same number
<
Regenaxer>
also different in pil64 and pil21
<
Regenaxer>
seems it is a totally different function
<
tankf33der>
known. i will show code later
<
tankf33der>
i am on beach
<
tankf33der>
this one works
<
Regenaxer>
This does not help. It does not use time(2)
<
Regenaxer>
What do you mean?
<
tankf33der>
this code for time function from newlibc base
<
Regenaxer>
You said time() is not different?
orivej has quit [Ping timeout: 272 seconds]
orivej_ has joined #picolisp
<
Regenaxer>
Fact is that time() linked in pil21 does noy set the value pointed to by the argument
<
Regenaxer>
"if (t) *t = now.tv_sec;" this does not happen
<
Regenaxer>
Thats the problem
<
Regenaxer>
(or not, as this call is deprecated anyway)
<
tankf33der>
linked versions
<
Regenaxer>
So tell me
*what* is wrong?
<
Regenaxer>
time() is overshadowed by the linker?
<
Regenaxer>
It
*is* a different function with different behavior
<
tankf33der>
time(&time1);
<
tankf33der>
printf("%lu\n", time1);
<
tankf33der>
this c code works on my linux
<
Regenaxer>
time returns nonsense
<
Regenaxer>
also without the pointer
<
Regenaxer>
Try this on both:
<
Regenaxer>
(native "@" "localtime" '(I . 9) (list NIL (8) (cons (native "@" "time" 'N 0) 8)))
<
Regenaxer>
on pil64 -> (21 6 20 15 6 120 3 196 1)
<
Regenaxer>
on pil21 garbage
<
Regenaxer>
eg -> (2 0 1 1 0 70 4 0 0)
<
tankf33der>
time(&time1);
<
tankf33der>
printf("%lu, %lu\n", time1, t);
<
tankf33der>
t = time(0);
<
tankf33der>
equal output.
<
Regenaxer>
Irrelevant
<
Regenaxer>
you compiled C
<
Regenaxer>
The problem is
*what* does the pil21
*use* for time()
<
Regenaxer>
it is a different internal function
<
Regenaxer>
it is not 'native'
<
Regenaxer>
native works here
<
Regenaxer>
: (native "@" "time" 'N 0)
<
Regenaxer>
-> 369642266664
<
Regenaxer>
this is not correct
<
tankf33der>
because there is no time() function? :)
<
Regenaxer>
There is, otherwise 'native' would fail
<
tankf33der>
pil64 and pil21 calling different versions
<
Regenaxer>
yes, must be
<
Regenaxer>
pil64 is stripped :(
<
Regenaxer>
Too lazy to rebuild now ;)
<
Regenaxer>
Same I would say. arm64 vs x86-64
<
tankf33der>
maybe pil21 calling 32bit glibc version?
<
Regenaxer>
hmm, but on both arm and x86?
<
tankf33der>
i have installed both
<
Regenaxer>
not here on Termux I think
<
Regenaxer>
mysterious
<
Regenaxer>
Maybe other functions too?
<
tankf33der>
Regenaxer: try to ask in #glibc channel
<
Regenaxer>
yeah, but it is tough to explain the situation
<
Regenaxer>
It must be our Makefile, because plain C programs work, right?
<
Regenaxer>
So not just a glibc issue
<
tankf33der>
c plain works.
orivej_ has quit [Ping timeout: 264 seconds]
orivej has joined #picolisp
<
Regenaxer>
again, see the disas
<
Regenaxer>
it referst to $ExtCnt
<
Regenaxer>
which is a pil global!!
<
Regenaxer>
there is a clash in linkage
<
tankf33der>
unknown to me.
<
Regenaxer>
See line 12 in src/glob.l
<
Regenaxer>
(var $ExtCnt i64 1) # External symbol count
<
Regenaxer>
there is a 'time' function in src/main.l !!!
<
Regenaxer>
Issue solved
<
Regenaxer>
(de time ((i64 . H) (i64 . M) (i64 . S))
<
Regenaxer>
in line 562
<
Regenaxer>
In pil64 this is called 'tmTimeY_E', so no clash
<
Regenaxer>
Now it works! :)
<
Regenaxer>
: (native "@" "localtime" '(I . 9) (list NIL (8
<
Regenaxer>
) (cons (native "@" "time" 'N 0) 8)))
<
Regenaxer>
-> (22 54 20 15 6 120 3 196 1)
<
Regenaxer>
Released
<
Regenaxer>
Too bad that the linker does not give an error
xkapastel has quit [Quit: Connection closed for inactivity]
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
<
Regenaxer>
Thanks for investigating!
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
<
Regenaxer>
So I was right when I suspected "time() is overshadowed by the linker"
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
ym has quit [Ping timeout: 256 seconds]
Blukunfando has quit [Read error: Connection reset by peer]
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej_ has joined #picolisp
orivej has quit [Ping timeout: 265 seconds]
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
_whitelogger has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp