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
wineroots has quit [Remote host closed the connection]
clacke has quit [Remote host closed the connection]
razzy has quit [Ping timeout: 264 seconds]
razzy has joined #picolisp
razzy has quit [Quit: leaving]
rob_w has joined #picolisp
mmvmm has joined #picolisp
<mmvmm> Hello there. When I am using ";" for getting name property of my object my paredit-mode any my emacs are going creazy. Is there something else which I can use instead ";" for the same purpose?
<mmvmm> Oh damn. I've checked this. ";" is breaking Paredit for Picolisp :(
<Regenaxer> oh :)
<Regenaxer> I recommend Viz
<Regenaxer> vip
<Regenaxer> Anyway, ';' is a non-evaluating version of 'get', so you can (; Sym a b c) -> (get Sym 'a 'b 'c)
mmvmm has quit [Ping timeout: 256 seconds]
mmvmm has joined #picolisp
<beneroth> mmvmm, it's because ";" is comment character in common lisp and emacslisp, afaik
<beneroth> mmvmm, you could fix paredit... or just type a closing parens again, then the inner symbols. works for me. a bit annoying but just habit.
rob_w has quit [Remote host closed the connection]
<mmvmm> Regenaxer Do you know how I can easily restert PL server from the repl layer?:)  I don't want to restart the whole repl each time when I am changing my server routes.
<Regenaxer> Usually it is best to do ^D and ^C, and repeat the shell command
<Regenaxer> Depends on the reason for the restart
<Regenaxer> Usually just reload changed files
<Regenaxer> The server runs in the parent process, so ther is no other way than killing and restarting it
<Regenaxer> the repl is just a child
<Regenaxer> But you can tell the parent to reload a file too
<Regenaxer> : (boss 'load "path/file.l")
aw- has quit [Ping timeout: 264 seconds]
mmvmm has quit [Quit: Client closed]
mmvmm has joined #picolisp
<mmvmm> How I can get query params in PL ?
<Regenaxer> A Pilog query?
<Regenaxer> 'solve' or 'pilog' call?
<mmvmm> Guys, I am doing something wrong here (https://pastebin.com/ZC5iJ2Un). I am putting record into database by !test.json api call. Then I am trying to get that record using !rule.json api call. But (db 'name '+RuleType This) is not working. Record is inside the database. What is wrong ?
<Regenaxer> (db 'name '+RuleType ...) cannot find anything because (rel name (+String)) has no index
<mmvmm> Ok, I've added +Idx into this column and still nothing.
<Regenaxer> Do the data look good? (collect 'id '+RuleType) or (collect 'name '+RuleType) ?
<mmvmm> Hmm NIL. But (show *DB) is showing a log of items
<Regenaxer> How about (show *DB '+RuleType)
<Regenaxer> should show the counts and tree roots
<mmvmm> NIL NIL :/
<Regenaxer> uh :)
<mmvmm> (show *DB) is returning  "+RuleType" {46}
<Regenaxer> e.g. in the demo app
<Regenaxer> ap: (show *DB '+Item)
<Regenaxer> {40} 6
<Regenaxer> pr (6 . {H3})
<Regenaxer> sup (6 . {H2})
<Regenaxer> nm (67 . {I3})
<Regenaxer> nr (6 . {H1})
<Regenaxer> -> {40}
<Regenaxer> nr (6 is 6 tree entries
<Regenaxer> *DB should be like:
<Regenaxer> ap: (show *DB)
<Regenaxer> {1} NIL
<Regenaxer> +Pos {42}
<Regenaxer> +Item {40}
<Regenaxer> +Ord {41}
<Regenaxer> +CuSu {37}
<Regenaxer> +Sal {24}
<Regenaxer> +User {7}
<Regenaxer> +Role {3}
<Regenaxer> -> {1}
<mmvmm> How it is possible that I can see it with (show *DB) but not with (show *DB '+RuleType) ?
<Regenaxer> Where in your code are the data inserted into the DB?
<Regenaxer> This looks good (request '(+RuleType) 'name "Test")
<mmvmm> I've took it from docu :(
<Regenaxer> But it needs a (commit) somewhere
<Regenaxer> Hmm, I see no place where data are created except this 'test' function
<Regenaxer> and it does no (commit), so the data are lost
<Regenaxer> Try request! instead of request
<Regenaxer> it does an implicit commit
<mmvmm> Still nothing :/
<mmvmm> https://pastebin.com/4HS5nAgf this is the version with index and commit
<Regenaxer> I think you better erase the DB once
<Regenaxer> then (request! '(+RuleType) 'name "Test")
<Regenaxer> and (collect 'name '+RuleType)
<mmvmm> still NIL :/
<Regenaxer> are you in the right namespace in the repl?
<Regenaxer> rule
<Regenaxer> hmm, yes, from main
<Regenaxer> ok, I try your code
<mmvmm> Namespace is fine. I am trying to solve it for over 1,5 hours and nothing :/
<Regenaxer> oh :)
<Regenaxer> you said "I've added Idx"
<Regenaxer> +Idx is a prefix class
<Regenaxer> ok
<Regenaxer> ~/tmp ../pil21/pil plisp.l -rule~main +
<Regenaxer> # test redefined
<Regenaxer> rule: (request! '(+RuleType) 'name "Test")
<Regenaxer> -> {A1}
<Regenaxer> -> ({A1})
<Regenaxer> rule: (collect 'name '+RuleType)
<Regenaxer> I changed to (rel name (+IdxFold +String))
<mmvmm> why +IdxFold?
<Regenaxer> It is useful for searching strings and substrings
<Regenaxer> also for non-exact searches
<Regenaxer> Just +Idx would also be fine
<Regenaxer> Is it that you forgot the '+'
<Regenaxer> k
<Regenaxer> ?
<mmvmm> YEs :)
<mmvmm> Thank you:D
<Regenaxer> :)
<Regenaxer> I use +Idx usually with (+Sn +Idx +String), for person names
<Regenaxer> for items etc. I use (+IdxFold +String)
mmvmm has quit [Quit: Ping timeout (120 seconds)]
mmvmm has joined #picolisp
<mmvmm> Is there anything else which I can use which is working like a ";" ?
<mmvmm> Paredit is killing me with ";"
<Regenaxer> I wrote above. 'get'
<mmvmm> Oh, I didnt saw it:)  Thx
<Regenaxer> np :)
mmvmm has quit [Quit: Client closed]
mmvmm has joined #picolisp
mmvmm has quit [Quit: Client closed]
v_m_v has joined #picolisp
mmvmm has joined #picolisp
<v_m_v> Hello, how I can send and process POST body in PicoLisp. I can not find any examples with that.
<Regenaxer> Hi v_m_v! There is a 'client' function in @lib/http.l which can do that
<v_m_v> Thank you! I am going to check that :)
<Regenaxer> For more general cases I recommend (call "curl" "-F" ...) or so
<v_m_v> I mean, I would like to send POST to PicoLisp from different programming language. Inside that POST there will be body with json.
<Regenaxer> Ah, so you start a pil server
Guest82 has joined #picolisp
<Regenaxer> It accepts any multipart/form-data
<Regenaxer> also all handled in @lib/http.l
<v_m_v> ok :) Thx
<Regenaxer> :)
Guest82 has quit [Quit: Ping timeout (120 seconds)]
aw- has joined #picolisp