<razzy>
hi, linux trouble: terminal refuses to close after Ctrl+d because command exited with 256 exit code. what it means?
<Regenaxer>
Hi razzy, the exit code depends on the program
<Regenaxer>
Not sure why the term does not close then
<razzy>
Regenaxer: ok i do more precise/changed statement. if I iterrupt program Ctrl+C in terminal emulator, then send Ctrl+d terminal emulator froze with "read only - command exited with code 256".
<Regenaxer>
What kind of terminal emulator is that?
<razzy>
weird mobile distro mobian and terminal is "King's Cross"
<Regenaxer>
I see, never heard of
<beneroth>
probably an issue of this specific terminal
<beneroth>
have you tried googling "King's Cross" and the error message?
<razzy>
i will change it, thx
<Regenaxer>
Looks like a command can set the termd read only just via exit code
<razzy>
beneroth: now i tried properly. nothing. i am propably only one using it :)
<beneroth>
hehe
peterhil has quit [Ping timeout: 258 seconds]
razzy has quit [Ping timeout: 245 seconds]
peterhil has joined #picolisp
razzy has joined #picolisp
<beneroth>
Regenaxer, available?
<Regenaxer>
yep
<beneroth>
question about pilog bool/3
<beneroth>
: (? @Hist NIL
<beneroth>
@Obj (new NIL NIL 'hist T)
<beneroth>
-> NIL
<beneroth>
@Hist=NIL @Obj=$177451144345174
<beneroth>
(bool @Hist @Obj hist) )
<beneroth>
Regenaxer, why is passing?
<beneroth>
reference description for bool/3 states "comparing truth value", the example is only abotu T
<beneroth>
can bool/3 be used with NIL value bound to first parameter?
<Regenaxer>
bool/3 follows the same rule as all e/r predicates: If no search value is given or if the value matches
<beneroth>
(tested/used in pil64, but I guess there is no difference to pil21)
<beneroth>
ok
<Regenaxer>
In Prolog in general ther is no NIL value
<beneroth>
I see
<Regenaxer>
So bool/3 finds all with T *if* asked
<Regenaxer>
Here @Hist is the search criterium
<beneroth>
T
<Regenaxer>
it is NIL, thus bool/3 succeeds
<beneroth>
so to explicitly check for NIL, this would be the way?
<beneroth>
: (? @Hist NIL
<beneroth>
@Obj (new NIL NIL 'hist T)
<beneroth>
-> NIL
<beneroth>
(bool @Hist @Obj hist) )
<beneroth>
@Hist=NIL @Obj=$177451144345174
<Regenaxer>
(I andmit a weird logic, but useful in DB queries)
<beneroth>
copy paste mistake
<beneroth>
I meant
<beneroth>
(? @T T
<beneroth>
(not (bool @T @Obj hist)) )
<beneroth>
@Obj (new NIL NIL 'hist T)
<Regenaxer>
yes, (not (bool
<Regenaxer>
but then as it is Lisp it can be directly
<Regenaxer>
oops
<beneroth>
can be directly how?
<Regenaxer>
sorry, mistake, it is not Lisq
<beneroth>
hehe
<Regenaxer>
I meant (^ @ (not (val ...
<Regenaxer>
(^ @ (not (get ... I mean
<beneroth>
maybe cheaper than using not predicate?
<Regenaxer>
Not sure. I would take what looks more elegant
razzy has quit [Ping timeout: 245 seconds]
razzy has joined #picolisp
aw- has quit [Quit: Leaving.]
<Regenaxer>
A related issue is that boolean attributes can be searched via index only if T
peterhil has quit [Ping timeout: 258 seconds]
<beneroth>
and the only reason why its bool/3 and not t/2 (without search value) is to get the "if no search value is given"-functionality?
<Regenaxer>
yes, this is essential
<beneroth>
Regenaxer, T. though in some cases (especially if it is already a filtered index list) a (not (member)) might be cheaper than loading properties
<Regenaxer>
We can search only for those with T
<Regenaxer>
(not (member ... of what?
<beneroth>
index (result of collect)
<Regenaxer>
It depends
<beneroth>
granted, this is then working with set operations (like SQL) and not stepping (like pilog)
<beneroth>
T
<beneroth>
it depends
<Regenaxer>
as always, using collect or not
<Regenaxer>
depends on the expected result size
<beneroth>
exactly
<beneroth>
NIL in picolisp is same as false. but maybe NIL in pilDB should be viewed like NULL in SQL, where it means "unknown/undefined" (which results in tree-value-logic)
<Regenaxer>
Just as a filter, not following the criterion rule, just use (not (val @Obj hist))
<Regenaxer>
hmm
<Regenaxer>
not val
<Regenaxer>
(not (val T @Obj hist)) ?
peterhil has joined #picolisp
<beneroth>
T
<beneroth>
or no
<beneroth>
same
<beneroth>
ah
<beneroth>
no
<beneroth>
wait
<Regenaxer>
:)
<beneroth>
(val T ...) is valid?
<Regenaxer>
Why not?
<Regenaxer>
(val 7 @Obj nr)
<beneroth>
yeah makes sense
<beneroth>
though the description of val is wrong
<beneroth>
"Pilog predicate that returns the value of an object's attribute. "
<beneroth>
returns a value? :P
<Regenaxer>
yes, but return is always matching in Prolog
<beneroth>
yep, so its not the value
<beneroth>
the value is bound, not returned
<Regenaxer>
variables are bound
<Regenaxer>
and everything is matched
<Regenaxer>
even non-bound variables are matched
<Regenaxer>
may be bound later
<Regenaxer>
This is the difference to Lisp
<beneroth>
T
<beneroth>
I'd say the statement "returning a value" is always wrong in context of pilog/prolog
<beneroth>
word nitpick
<Regenaxer>
you are right
<beneroth>
many thanks for the review of how to use bool/3!
<beneroth>
good reminder with the (not (val T ...)) :)
<Regenaxer>
Welcome! :)
<Regenaxer>
yeah, seems the best
<Regenaxer>
hmm, not sure, Would this also work? (val NIL @Obj hist)
<Regenaxer>
cause these DB predicates are basically Lisp calls