beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
seninha has joined #picolisp
stack1 has quit [Ping timeout: 258 seconds]
stack1 has joined #picolisp
seninha has quit [Quit: Leaving]
msavoritias has joined #picolisp
rob_w has joined #picolisp
chexum has quit [Remote host closed the connection]
chexum has joined #picolisp
seninha has joined #picolisp
seninha has quit [Remote host closed the connection]
seninha has joined #picolisp
seninha has quit [Quit: Leaving]
isaneran has joined #picolisp
seninha has joined #picolisp
seninha has quit [Remote host closed the connection]
seninha has joined #picolisp
isaneran has quit [Ping timeout: 272 seconds]
teddydd has quit [Ping timeout: 252 seconds]
teddydd has joined #picolisp
beneroth has quit [Read error: Connection reset by peer]
beneroth has joined #picolisp
isaneran has joined #picolisp
rob_w has quit [Remote host closed the connection]
msavoritias has quit [Remote host closed the connection]
isaneran has quit [Ping timeout: 260 seconds]
pablo_escoberg has joined #picolisp
seninha has quit [Ping timeout: 245 seconds]
<pablo_escoberg> hey abu[7].  I've started playing with the `search` function, and it's not doing what I expect.  So, going from `(collect 'nm '+Venue "ven1")` I thought the equivalent would be `(search (search "ven1" '((nm +Venue)))))` but the first yields a result, whereas the second one doesn't.  What did I get wrong here?  Also, BTW, I'd be happy to help
<pablo_escoberg> with the docs for `search` if needed (assuming, of course, I understand it first ;D).
pablo_escoberg has quit [Quit: Client closed]
<abu[7]> Yeah, it is involved. I did not write the HTML doc file yet
pablo_escoberg has joined #picolisp
<abu[7]> But I ported three public applications
<abu[7]> You can take a look and compare perhaps
<pablo_escoberg> OK, I'll look at the demo app more closely.  In which file is it used most?
<abu[7]> The demo app is changed: https://software-lab.de/demoApp.tgz
<pablo_escoberg> I know, I downloaded the new one, which is how I know about `search`
<abu[7]> the old version is still available at https://software-lab.de/demoApp.pilog.tgz
<abu[7]> Relevant is only app/gui.l
<pablo_escoberg> Ah, ok.  perfect.  I'll have a look there.
<abu[7]> Then I ported also the family demo in https://software-lab.de/tut.tgz
<abu[7]> And the OSM app (picolisp.com/osm)
<pablo_escoberg> great.  That should be enough to figure it out.
<abu[7]> yes, best look at the diffs of app/gui.l
<abu[7]> Basically, in 'search' you need only one step instead of four in select/3
<pablo_escoberg> looks like there are 2 steps: prepare the list, then execute.  Or am I completely misunderstanding?  Is the syntax above completely wrong?
<abu[7]> No, it is correct
<abu[7]> (search "ven1" '((nm +Venue)))))` is good
<abu[7]> I do usually
<abu[7]> (for (Q (search "ven1" '((nm +Venue))) (searq Q)) (do-something with @))
<abu[7]> So the "long" call builds a new query
<abu[7]> and each short (searq Q) returns one result
<abu[7]> With four stepsg in select I meant
<pablo_escoberg> aha!  That's the issue.  I hadn't seen `searq`
<pablo_escoberg> it's not in the docs yet.
<abu[7]> oops
<abu[7]> mistype
<abu[7]> (search Q)
<abu[7]> 1 get Lisp values to Pilog vars
<abu[7]> 2 Generator clauses (nm +Item)
<abu[7]> 3 Filter clauses (part ...
<abu[7]> 4 Get Pilog values back to Lisp
<abu[7]> With search there is only one: ((nm +Item))
<pablo_escoberg> right, but it's not giving me the results I expect.
<abu[7]> i.e. one per search criterion
<abu[7]> nm +Venue ?
<pablo_escoberg> `(search (search "ven1" '((nm +Venue)))))` should yield the same as `(collect 'nm '+Venue "ven1")` right?
<abu[7]> no
<abu[7]> this gives only one result
<pablo_escoberg> it gives none
<abu[7]> (search (search ...
<abu[7]> ok, but collect gives all
<pablo_escoberg> so collect gives me a single result, search gives me none.
<pablo_escoberg> I figured I had the syntax wrong, but apparently not?
<abu[7]> Except for the nesting, and one paren too much, it looks correct
<abu[7]> yes, syntax is perfect
<pablo_escoberg> hmnmmm....  any other explanation for the discrepancy?  Should I check my indexes or something?
<abu[7]> Does it open the tree if you (trace 'init)
<abu[7]> and get object if you (trace 'step) ?
<pablo_escoberg> entities: (trace 'init)
<pablo_escoberg> -> init
<pablo_escoberg> entities: (search (search "ven1" '((nm +Venue))))
<pablo_escoberg>  init : (nm . +Venue) "ven1" "ven1�"
<pablo_escoberg>  init = ((("ven1" . "ven1�")))
<pablo_escoberg> -> NIL
<abu[7]> the init call gets the right args
<abu[7]> but the tree seems empty
<pablo_escoberg> ok, so I'll look into my indexes
<pablo_escoberg> as long as I have the basic syntax right, I'll manage :).
<abu[7]> (show '+Venue 'nm)
<abu[7]> But as collect works, there must be data :)
<pablo_escoberg> OK, it's giving NIL.  It's an inherited relation.
<abu[7]> Ah, ok
<pablo_escoberg> So I need to figure out more about how the classes translate to trees, etc.
<abu[7]> So select/3 would also not work
<pablo_escoberg> but collect does.
<pablo_escoberg> very tempting to just use that, but I know I'll run into performance issues later.
<abu[7]> 'collect' is very heuristic
<abu[7]> 'search' needs either an index (as select), or a +Joint
<abu[7]> (+Joint is not supprted by select for a starting relation)
<pablo_escoberg> right, and I guess I need to declare those explicitly in each class; they are not inherited?
<abu[7]> Not declare them in the class, but pass the right one to 'search'
<abu[7]> It needs the index
<abu[7]> You get all objects from *that* index
<pablo_escoberg> Aha!  I got it.  works as expected now.
<abu[7]> I will check tomorrow to make 'search' more flexible
<pablo_escoberg> awesome!
<abu[7]> Indeed it seems I forgot this inheritance feature
<abu[7]> No problem
<abu[7]> I did not notice because all my test cases were indexes of the searched classes
<pablo_escoberg> makes sense.  but yes, that would be a great feature.  and in general, really glad I don't need to learn prolog :)
<abu[7]> :)
inara has quit [Quit: Leaving]
<beneroth> hey abu[7] and pablo_escoberg o/
<pablo_escoberg> hey beneroth
inara has joined #picolisp
seninha has joined #picolisp
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
seninha has quit [Ping timeout: 258 seconds]
pablo_escoberg has quit [Quit: Client closed]