ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Picolisp latest found at http://www.software-lab.de/down.html | check also http://www.picolisp.com for more information
libertas has quit [Ping timeout: 260 seconds]
libertas has joined #picolisp
<Regenaxer> From the curses man page: The integer variables LINES and COLS are defined in <curses.h> and will be filled in by initscr with the size of the screen
<beneroth> ah, alright. I suspected this. Thanks Regenaxer !
<beneroth> so the native call is: get me a pointer to this globale :)
<Regenaxer> yes
<Regenaxer> There are two reasons:
<Regenaxer> 1. preload the library and pointer into memory for faster later access
<Regenaxer> 2. it can't be called because it is not a function
<Regenaxer> brb
<Regenaxer> LINES and COLS are also a bit confusing because there are the env variables LINES and COLUMNS. They are a different thing and cannot be used in Vip because they don't update when the terminal is resized
<beneroth> yeah I figured so
<beneroth> gotta go. have a nice day :)
<Regenaxer> cu :)
<yunfan> so i remember someone ask if there're library for oauth support, how's finally answer?
<tankf33der> yunfan: it was aw
<tankf33der> ive post several links
<yunfan> and the final result is?
<Regenaxer> yunfan, you could scan https://irclog.whitequark.org/picolisp
<yunfan> i just need a recommandation or a simply no :D
orivej has joined #picolisp
styx has joined #picolisp
styx has quit [Quit: styx]
orivej has quit [Ping timeout: 256 seconds]
<tankf33der> how to solve this task? any hints?
<tankf33der> chop-reverse-match?
<Regenaxer> I think 'stem' is for that
<Regenaxer> : (stem (chop "foo.l") ".")
<Regenaxer> -> ("l")
<Regenaxer> : (stem (chop ".abc") ".")
<Regenaxer> -> ("a" "b" "c")
<tankf33der> ok
<tankf33der> i will do it
<Regenaxer> And then a few further check
<Regenaxer> Thanks!
<tankf33der> what checks?
<Regenaxer> for non-alpha chars?
<tankf33der> no
<tankf33der> task already contains extension 3ds
<Regenaxer> It says "document.txt_backup empty string, because _ is not a letter or number"
<Regenaxer> Strange rule, isn't it? ;)
<Regenaxer> Why only letters and numbers?
<tankf33der> i think ext is any after last dot
<tankf33der> assume file names in task is valid
<Regenaxer> Yes, but the task demands explicitly "letters or digits (A-Z, a-z, 0-9)"
<tankf33der> aaa, i see
<Regenaxer> What is the shortest check for such a rule?
<Regenaxer> Perhaps this: (find '>= '("Z" "z" "9") (circ C) '("A" "a" "0")))
<Regenaxer> no quote needed: (find >= '("Z" "z" "9") (circ C) '("A" "a" "0")))
reed has joined #picolisp
<reed> Hi All. I was on here yesterday and I asked about the following code in "vip.l": (native "@" "LINES" T). I have been lookin through the documentation on the native call quite a bit, but I still don't understand what is happening here. What C library is the function "LINES" in?
<Regenaxer> Yes
<Regenaxer> See the chat log, I gave answers this morning
<reed> Will do
<Regenaxer> So the issue is here special, as "LINES" is not a callable function
<reed> so is the a general pattern to access global C variables?
<Regenaxer> The typical way is with 'struct' as in Vip I would say
<Regenaxer> "LINES" contains the pointer after the above native call
<Regenaxer> It just does not call this location as a C function, this would crash
<reed> So in the line (setq *Lines (car (struct "LINES" '(I)))) they are taking the value that "LINES" points to
<Regenaxer> yes, resulting in the number of lines
<Regenaxer> in the ncurses lib
<reed> Thanks, that makes sense
<Regenaxer> I used (sys "LINES") first
<Regenaxer> but this does not change if the terminal is resized
<reed> I see. I was having a hard time understanding all the ncurses variable definitions because they use a bunch of macros defined in a different file. Thank you!
<Regenaxer> Curses is a horror indeed, a true mess
<reed> Just to make sure I understand: If I wanted to get the pointer to 'stdscr', I would call (curses "stdscr" T) then something like (setq *StdScr (car (struct "stdscr" '(N))))?
<Regenaxer> Yes, should work
<Regenaxer> Though stdscr is also returned by initscr iirc
<Regenaxer> Would be a good test
<reed> Just tested it out. Both point to the same place. Thanks!
<Regenaxer> Cool!
reed has quit [Ping timeout: 260 seconds]
reed has joined #picolisp
alexshendi has joined #picolisp
grp has joined #picolisp
<beneroth> so reed got his answers, nice :)
styx has joined #picolisp
alexshendi has quit [Ping timeout: 260 seconds]
grp has quit [Quit: box shutting down...]
reed has quit [Ping timeout: 260 seconds]