ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
ubLIX has joined #picolisp
NB0X-Matt-CA has joined #picolisp
orivej has joined #picolisp
_whitelogger has joined #picolisp
jibanes has quit [Ping timeout: 245 seconds]
jibanes has joined #picolisp
ubLIX has quit [Quit: ubLIX]
xkapastel has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #picolisp
_whitelogger has joined #picolisp
rob_w has joined #picolisp
<razzy> good morning
<Regenaxer> Hi razzy
xkapastel has joined #picolisp
<Nistur> o7
razzy has quit [Ping timeout: 244 seconds]
rob_w has quit [Quit: Leaving]
xkapastel has quit [Quit: Connection closed for inactivity]
ubLIX has joined #picolisp
zadock has joined #picolisp
zadock has quit [Remote host closed the connection]
rob_w has joined #picolisp
Dragon-Warrior has joined #picolisp
Dragon-Warrior has quit [Read error: Connection reset by peer]
Dragon-Warrior has joined #picolisp
Dragon-Warrior has quit [Read error: Connection reset by peer]
Dragon-Warrior has joined #picolisp
Dragon-Warrior has quit [Remote host closed the connection]
Dragon-Warrior has joined #picolisp
Dragon-Warrior has quit [Quit: ERC (IRC client for Emacs 26.1)]
alexshendi has joined #picolisp
ubLIX has quit [Quit: ubLIX]
rob_w has quit [Quit: Leaving]
razzy has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
xkapastel has joined #picolisp
razzy has quit [Ping timeout: 240 seconds]
alexshendi has joined #picolisp
grp has joined #picolisp
<grp> Regenaxer: is there any global variable that tells if code is currently being read from stdin (eg: running a script with #!/usr/bin/picolisp) or loaded?
<Regenaxer> Hi grp! You could do (=0 (fd)) perhaps
<grp> nope
<grp> same fd for every case
<grp> (fd 3)
<Regenaxer> What cases do you have?
<Regenaxer> then it is not stdin
<Regenaxer> : (in "lib.l" (fd))
<Regenaxer> -> 3
<grp> file with: #!/usr/bin/pil (prinl (fd)) (bye) 1. ./file.l 2. pil file.l 3. pil then (load "file.l")
<grp> all those case return
<grp> 3
<Regenaxer> : (in NIL (fd))
<Regenaxer> -> 0
<grp> I want to know if the current code is being run as a script or (load)ed
<Regenaxer> ok, yes, Unix opens the file and passes it to the executable
<Regenaxer> not stdin then
<Regenaxer> There is no difference I think
<Regenaxer> same as pil file.l
<grp> when you do pil file.l you are internally calling doLoad, so maybe it could turn on a variable
alexshendi has quit [Read error: Connection reset by peer]
<Regenaxer> Where do you need that?
<grp> that way, code can behave differently if it's being run or loaded
<grp> for example
<Regenaxer> you can pass info in the hashbang line if needed
<grp> I want my script to (finally (bye) ...), but would like to avoid running such expression if it's being loaded (as in a library or debug session)
<grp> problem is hashbang is limited to one argument iirc
<grp> (after the interpreter path)
<Regenaxer> yes, so do #!/usr/bin/pil -on *InScript
<Regenaxer> you can pass any stuff in the hashbang line
<Regenaxer> found out only recently :)
<grp> yeah... can prog the rest if needed
<Regenaxer> #!/usr/bin/pil -load "@lib/http.l" "@lib/xhtml.l"
<Regenaxer> Unix passes *everything* after the space as a single argument
<Regenaxer> very useful!
<Regenaxer> If 'load'ed, the first line is a comment and not executed
<Regenaxer> Perfect :)
<grp> indeed
<grp> that's what I wanted
alexshendi has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
razzy has joined #picolisp
orivej_ has joined #picolisp
orivej has quit [Ping timeout: 268 seconds]
rob_w has joined #picolisp
grp has quit [Ping timeout: 252 seconds]
xkapastel has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
grp has joined #picolisp
rob_w has quit [Quit: Leaving]
grp has quit [Quit: box shutting down...]