<aw->
Regenaxer: in (finally exe . prg), when 'exe' is called, is it possible for the IPC pipe between parent/child is already removed? or is it removed *after* 'exe' runs?
razzy has quit [Quit: Connection closed]
<beneroth>
hi aw-
<beneroth>
which IPC pipe? finally has nothing to do with pipes. the answer to your question depends on what you do with pipes/IPC in the specific case
<beneroth>
if 'prg is removing/closing a pipe, then I would expect the pipe to be closed when the finally 'exe is running.
<beneroth>
unless of course the 'prg is aborted with an error, then finally evaluates 'exe anyway
<aw->
hmmm
<beneroth>
what is the context?
<aw->
i'll look in /proc/<pid>/ to check
<beneroth>
you could run (kids) in the exe
<beneroth>
(if it is the parent who is doing the finally)
<aw->
it's not
<aw->
anyways, i'll try some things and ask more specific question later or tomorrow
<aw->
thanks
beneroth_ has joined #picolisp
beneroth has quit [Ping timeout: 256 seconds]
Blukunfando has quit [Ping timeout: 256 seconds]
casaca has quit [Ping timeout: 256 seconds]
<Regenaxer>
Hi aw-, beneroth_! Sorry, was out
<Regenaxer>
Thanks beneroth_!
Blukunfando has joined #picolisp
Blukunfando has quit [Read error: Connection reset by peer]
beneroth_ has quit [Quit: Leaving]
beneroth has joined #picolisp
Blukunfando has joined #picolisp
<beneroth>
Regenaxer, better to use (str) or (format) to convert a string into a number?
<Regenaxer>
'format' is best
<Regenaxer>
the other conversions call it internally
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
<beneroth>
ok thanks
<beneroth>
Regenaxer, the reference for 'scl uses (str) in the examples
<Regenaxer>
yes, because *Scl is relevand during 'read', and 'str' reads from a string
<Regenaxer>
So 'str' is a lot of overhead
<Regenaxer>
parsing the string and then call 'format'
<Regenaxer>
The direct call is (format "123" *Scl)
<Regenaxer>
'str' is also very dangerous in some contexts
<Regenaxer>
as it is 'read' basically, it executes read macros. An absolute no-go in user interfaces etc
<Regenaxer>
: (str "ab `(msg 'OK) cd")
<Regenaxer>
OK
<Regenaxer>
-> (ab OK cd)
<beneroth>
Regenaxer, ok thanks
<beneroth>
yeah I'm using format now
<Regenaxer>
:)
<beneroth>
well did so before, but haven't worked so much with *Scl numbers as here
<beneroth>
I'm getting comfortable with FEXPR's and namespacing, very elegant combination when used carefully
<Regenaxer>
cool :)
<Regenaxer>
yeah, advances issues
<beneroth>
I'm shadowing (line) and (read) within a special parser fexpr context
<beneroth>
bind them to namespaced functions
<beneroth>
during (run)
<Regenaxer>
sounds good
<beneroth>
yeah will play around a bit more and test this concepts. when I have some time I will publish this code :-)
<beneroth>
Regenaxer, I would like to have a function to create a namespace, without switching to it ^^
<beneroth>
Currently I do:
<beneroth>
(let Pref (symbols 'lib: 'pico)
<beneroth>
(symbols Prev) )
<beneroth>
typo
<beneroth>
(let Prev (symbols 'lib: 'pico)
<beneroth>
(symbols Prev) )
<Regenaxer>
ok, I see
<beneroth>
but I ended up having no need for (export) and (private), so maybe don't listen to me xD
<Regenaxer>
in pil64 you could do (def 'lib: (cons))
<beneroth>
though I'm pretty sure I will settle on this current way now
<Regenaxer>
but in pil21
<beneroth>
ah right
<beneroth>
but?
<Regenaxer>
(def 'lib: (cons '~ NIL NIL)
<Regenaxer>
(I think ;)
<Regenaxer>
different internal format
<beneroth>
ok, then I better stay with my current symbols use, to be compatible to both
<Regenaxer>
hmm
<beneroth>
I intend to primarily stay on pil64 for the foreseeable future.. but when pil21 is released, I could use it for some Mac desktop apps
<Regenaxer>
I'm too lazy to backport this to pil64
<beneroth>
hehe
<beneroth>
don't ;-)
<Regenaxer>
ok :)
<Regenaxer>
never touch a running system ; en
<beneroth>
I can always write a syntax sugar this
<beneroth>
I guess there will be a way to differ between pil21 and pil64 within picolisp
<beneroth>
like (== 64 64)
<Regenaxer>
probably
<Regenaxer>
though not this one
<beneroth>
ofc
<Regenaxer>
Do you really need the 'let'?
<beneroth>
this one is separating pil32 from later editions :)
<Regenaxer>
(symbols (symbols 'lib: ... ?
<beneroth>
T
<beneroth>
nice one
<beneroth>
better!
<beneroth>
thanks
<Regenaxer>
btw, the above should be (list '\~ NIL)
<Regenaxer>
for pil21
<Regenaxer>
needs \ ;)
<beneroth>
I see
<Regenaxer>
~ is special
<Regenaxer>
meta char
<beneroth>
~ is ugly, you should have used | or so... :P
<beneroth>
but too late
<Regenaxer>
I think ~ is best
<Regenaxer>
less probable that this exists as data
<beneroth>
T
<Regenaxer>
It is not visible anyway
<beneroth>
well... welll ;-)
<beneroth>
hihi
<beneroth>
it's okay :-)
<Regenaxer>
and a list starting with '|' is often there
<Regenaxer>
'|' is a function
<beneroth>
T
<beneroth>
right
<beneroth>
I forgot about OR
* beneroth
is ashamed and goes into hiding
<Regenaxer>
haha :)
<Regenaxer>
The *best* value for such internal use is minus zero
<Regenaxer>
I use it for uninitialized stack values
<Regenaxer>
Cannot appear in normal data
<beneroth>
the next guy who claims picolisp has no standard lib has to recite all 500+ builtin functions
<Regenaxer>
but GG will not choke
<Regenaxer>
indeed
<beneroth>
and pil is strongly and static typed, technically
<Regenaxer>
Not sure if strong and static apply here
<Regenaxer>
Most think about variables when talking about typing
<beneroth>
T
<beneroth>
Wikipedia:
<beneroth>
"In the context of static (compile-time) type systems, type safety usually involves (among other things) a guarantee that the eventual value of any expression will be a legitimate member of that expression's static type."
<beneroth>
pil is on the maximum strength here, if we ignore all the duck typing on top of symbols and lists :P
<Regenaxer>
yeah, but it refers to compile-time types
<Regenaxer>
thus variables
<beneroth>
so read-time in lisp :P
<beneroth>
haha
<beneroth>
such a mess
<Regenaxer>
true
<Regenaxer>
As you said the other day, the type of a piece of data is immutable
<Regenaxer>
so kind of "strong"
<beneroth>
picolisp is very scientific: one has to push aside ones assumptions and look at the evident reality :P
orivej_ has joined #picolisp
<Regenaxer>
right
orivej has quit [Ping timeout: 265 seconds]
<beneroth>
hmm
<beneroth>
so all values in picolisp are const, in a way...
<beneroth>
not helpful this musing, but funny
<Regenaxer>
yep
<Regenaxer>
There is no "cast"
<Regenaxer>
change the type at runtime
<Regenaxer>
it needs a new data item
<Regenaxer>
sym <-> num
<beneroth>
yeah
<beneroth>
non-destructive on value level
<Regenaxer>
T
<Regenaxer>
But not to confuse with the value of a 'var'
<beneroth>
T
<beneroth>
the pointer :P
<Regenaxer>
yes
<beneroth>
I guess (format (1 4)) -> 14 is cheaper than (format '("1" "4")) yes ?
orivej_ has quit [Read error: Connection reset by peer]
orivej has joined #picolisp
<Regenaxer>
Almost the same, but '("1" "4") might be cheaper
<Regenaxer>
it uses 'pack'
<Regenaxer>
so the numbers are first converted to strings
<beneroth>
ah good to know
<beneroth>
I have a chopped string, and it should begin with a multi-digit number
<Regenaxer>
best is (format "12") of course
<Regenaxer>
ok, good
<beneroth>
so I do (format (make (find '((E) (when (format E) (link E))) String]