Re: Bug in rand

2020-03-25 Thread Alexander Burger
Hi Alfonso, > I've noticed that the "rand" function doesn't work with negative arguments: > > Version 20.3.16 > > : (rand -10 10) > > -> 1152921504606846966 > > Version 19.12.28 > > : (rand -10 10) > > -> -5 > > I don't know in which exact version the bug appeared. Oops, thanks a lot! This is my

Re: Local install problem

2020-03-25 Thread Alexander Burger
Hi Wilhelm, > After downloading and building the 19.12 > tarball, I find that the pil script in > picoLisp/bin has /usr/bin/picolisp as the > shbang, so it wouldn't actually work as a > local installation. There is also a local 'pil' script, i.e. "picoLisp/pil". You can call it with an absolute

Re: Graph database

2020-03-13 Thread Alexander Burger
On Fri, Mar 13, 2020 at 10:22:12PM +0100, Alexander Burger wrote: > Perhaps this helps? https://software-lab.de/doc/tut.html#ext > > It is really very simple. Understanding PicoLisp symbols is perhaps the important point. https://software-lab.de/doc/ref.html#symbol The rest is ju

Re: Graph database

2020-03-13 Thread Alexander Burger
On Fri, Mar 13, 2020 at 04:02:44PM -0500, Lawrence Bottorff wrote: > Could you point me to a beginner's treatment of this topic, especially an > example of a graph database, and what exactly a picolisp pointer is? Perhaps this helps? https://software-lab.de/doc/tut.html#ext It is really very

Re: Graph database

2020-03-13 Thread Alexander Burger
Hi Lawrence, > I take it the picolisp graph database follows more the Neo4j property graph > idea than any RDF/OWL triples, correct? That seems obvious, but I thought > I'd check. I haven't dived in deep, buy you seem to use Lisp objects to > create a vertex. But then what are the edges? Again,

Re: List to Chunks of size N

2020-03-04 Thread Alexander Burger
Hi Kashyap, > I've written a function to break a list into chunks of size N - > > (de Chunks (Lst N) >(make > (while Lst > (link (head N Lst)) > (cut N 'Lst) ) ) ) This works, but 'head' and 'cut' both traverse the list, so the work is duplicated. Just 'cut'

Re: Assembler for RISC V

2020-02-19 Thread Alexander Burger
Hi Kashyap, > What would you recommend if I had to write an assembler for RISC V? Can I > look at llvm.l in pil21 or should I look at lib/asm.l in pil64? I would say that lib/asm.l is the way to go. It maps directly to a target assembly language (or C in case of 'emu'). llvm is a different,

Re: pil21 on macOS Catalina

2020-02-18 Thread Alexander Burger
On Tue, Feb 18, 2020 at 08:53:40PM +0900, Makoto Kimura wrote: > ... in the Apple world. Though I didn’t do much, I’ll just describe what I > did: Cool! Thanks a lot Mak! ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: pil21, some progress

2020-02-16 Thread Alexander Burger
Hi Jean-Christophe, > Are there relatively trivial tasks that low-skilled people can help with ? Not sure if trivial, but LLVM code can (and has to?) be optimized on several levels. I have not found the energy yet to research that in detail. The main and only reference I used for the

Re: pil21, some progress

2020-02-14 Thread Alexander Burger
Hi Kashyap, > Hey Alex, I did a quick comparison of a couple of .l files (gc.l and > flow.l) between pil21 and the current src64 files. I was expecting the > assembly files to not have much changes - I mean, in theory, only an > arch/llvm.l and perhaps minor tweaks in some more file should have

Re: pil21, some progress

2020-02-12 Thread Alexander Burger
Hi Kashyap, > "libffi-dev" instead of libffi since apt complained that it could not find > libffi. Good to know! > llvm-link: base.bc: error: Unknown attribute kind (60) (Producer: > 'LLVM9.0.1' Reader: 'LLVM 6.0.0') Oh! LLVM 6 is extremely old, isn't it? I have no idea how much LLVM changed

Re: pil21, some progress

2020-02-12 Thread Alexander Burger
Hi Jean-Christophe and Kashyap, > Quick related question - I can build pl21 using LLVM target on Linux right? > I am planning to give it a shot on docker this weekend. It should require just these steps: apt install make clang llvm libffi pkg-config tar xfz pil21.tgz cd pil21 (cd

Re: pil21, some progress

2020-02-12 Thread Alexander Burger
Hi Jon, > Great! Now it works. I just did a “(+ 2 3 4 5)” and got 14. ;-) Glad to hear that :) > What’s the most important things missing? Functions or stability? Stability is all right at the moment, though I did not do any significant testing. But concerning functionality, the largest part

Re: pil21, some progress

2020-02-12 Thread Alexander Burger
Hi Jon, > I have now made some progress in building pil21 on my Mac. Good! :) > lib.c:7:35: warning: format specifies type 'unsigned long' but the argument > has type 'int64_t' > (aka 'long long') [-Wformat] >fprintf(stderr, "%s %lX\n", s, n); I see, that's an easy one. Just a

Re: Time to say goodbye

2020-02-10 Thread Alexander Burger
Hi Jon, > Does it mean that the standard macOS “make” is too old? (It’s possible.) No idea. I think any make is OK, no special requirements. > Have you considered implementing PicoLisp in Zig? > https://ziglang.org Also no idea, never heard of. No, the point is that I

Re: Time to say goodbye

2020-02-10 Thread Alexander Burger
On Mon, Feb 10, 2020 at 08:52:45PM +0100, Alexander Burger wrote: > On Mon, Feb 10, 2020 at 08:41:20PM +0100, Alexander Burger wrote: > > To build it, you need a 64-bit hardware, and install the packages > > > >make clang llvm lldb pkg-config > > Oops, and of cour

Re: Time to say goodbye

2020-02-10 Thread Alexander Burger
On Mon, Feb 10, 2020 at 08:41:20PM +0100, Alexander Burger wrote: > To build it, you need a 64-bit hardware, and install the packages > >make clang llvm lldb pkg-config Oops, and of course libffi ;( ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: Time to say goodbye

2020-02-10 Thread Alexander Burger
On Mon, Feb 10, 2020 at 08:24:10PM +0100, Jon Kleiser wrote: > > Especially with Mac users in mind, I'm working on an LLVM version of > > PicoLisp > > (https://software-lab.de/pil21.tgz). You should be a little more patient ;) > > Now you got me curious! I had to try it right away; maybe a bit

Re: Examples of quote usage instead of lambda

2020-02-06 Thread Alexander Burger
On Thu, Feb 06, 2020 at 12:41:51PM -0500, John Duncan wrote: > Yeah, it's explained in the reference manual: > ... > In contrast to other Lisp implementations, the symbol LAMBDA itself does > not exist in PicoLisp but is implied from context. > ... > Hope this helps a bit. Alex would probably

Re: Examples of quote usage instead of lambda

2020-02-06 Thread Alexander Burger
Hi Lawrence, > I've been a passive observer for a while, but now I'm really trying to grok > picolisp. Welcome! :) > So let's start with the FAQ bit about *I cannot find the LAMBDA > keyword in PicoLisp. *The example is basically syntax sugar for > > ((quote (X Y) (+ X Y)) 3 4) > > but this

Re: Using mime for htm & txt file extensions

2020-01-29 Thread Alexander Burger
Hi SuperSaiyan, > This is the improvised code which solves both: > > $ pil @lib/http.l @lib/xhtml.l -'(and(mime "txt" "text/plain; > charset=utf-8")(mime "htm" "text/html; charset=utf-8"))' --server 9092 tst.l This is not correct. -'(and (mime ...))' results in ((and (...))) and will most

Re: Using mime for htm & txt file extensions

2020-01-29 Thread Alexander Burger
Hi SuperSaiyanBlue, > > (mime "htm" "text/html; charset=utf-8") > > I did try that but it did not work. The reason i asked :-) It must be passed to the main server process. I tried this: $ pil @lib/http.l @lib/xhtml.l -'mime "txt" "foo/bar; mumble"' --server 9091 tst.l and get $

Re: accessing list items and other structures

2020-01-28 Thread Alexander Burger
On Wed, Jan 29, 2020 at 01:47:12AM +0100, pd wrote: > Hello, > > I'd like to know if there's in picolisp the common lisp concept of places, Yes, it is called 'var' in the docs, and is either the VAL of a symbol or the CAR of a list cell. > I mean, is it possible to do this: > > (setq L (1 2

Re: Using mime for htm & txt file extensions

2020-01-28 Thread Alexander Burger
Hi SuperSaiyan, > I have some .htm and .txt files and wish to serve them via the picolisp > webserver. Unfortunately, the mime function doesn't work the way I want it > to work. > The files aren't getting sent as 'text/html' or 'text/plain' for htm and txt > respectively. > > Curl says the

Re: Unable to log into wiki

2020-01-08 Thread Alexander Burger
Hi Kashyap, > you please reset the password for me? Sure, I send you a new one by mail, and you can change it again. ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: Proposal: PilCon 2020

2020-01-08 Thread Alexander Burger
Hi all, On Tue, Jan 07, 2020 at 03:55:18PM +0100, Alexander Burger wrote: > I'm now in the process of collecting more information, and will prepare a wiki > page over the next days. We can then all together refine it to have a single > landing page with all relevant data. Done:

Re: Proposal: PilCon 2020

2020-01-07 Thread Alexander Burger
Thanks a lot to all who responded so far! I'm now in the process of collecting more information, and will prepare a wiki page over the next days. We can then all together refine it to have a single landing page with all relevant data. ☺/ A!ex -- UNSUBSCRIBE:

Re: Proposal: PilCon 2020

2019-12-28 Thread Alexander Burger
Hi Kevin, > Not to derail this thread too much, but a RISC-V port would be a more > forward-looking prospect. This is a known issue, and we discussed about it in IRC. Pil64 is unfortunately not portable to RISC-V. It depends deeply on CPU registers (zero, sign and carry), which do not exist in

Re: Proposal: PilCon 2020

2019-12-26 Thread Alexander Burger
Hi Alexander, > I would set the probability of my attending at 95%. OK, noted :) > BTW is Picolisp already ported to NetBSD/arm64? I'm not sure how the situation is on NetBSD, but it definitely runs fine on Arm64. It is my main use case (in Termux/Android and in PilBox), and I test it from

Re: Proposal: PilCon 2020

2019-12-25 Thread Alexander Burger
Hi Vid, > I have been awol for several years now I know, but I would love to come if > that is ok. Sure! :) ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Proposal: PilCon 2020

2019-12-25 Thread Alexander Burger
Hi all, a merry Christmas to everybody! o/ Since a few weeks we were discussing in the #picolisp IRC channel about holding a PicoLisp Conference in Langweid / Germany next year. It would be on July 27th (Mon), 28th (Tue), and - if necessary - 29th. I can get a room and equipment for about 30

Pretty printing (Was: Styling the rows of a +Chart based on the value)

2019-12-19 Thread Alexander Burger
Some time ago we talked in this thread about pretty printing. I think I should explain this a bit better. On Wed, Dec 18, 2019 at 12:50:55PM -0800, C K Kashyap wrote: > ( (alternating) > (gui 1 '(+InsRowButton)) > (if (let L (: chart 1 data) (and (car (nth L R))

Re: Styling the rows of a +Chart based on the value

2019-12-19 Thread Alexander Burger
On Wed, Dec 18, 2019 at 12:50:55PM -0800, C K Kashyap wrote: > (if *CfgNurNetto >(gui 7 '(+Upd +Chg +FixField) # B-Preis > '(let? Pos (curr) ... > > Looks like the (gui 7...) is either a FixField or a Checkbox depending on > *CfgNurNetto Correct. But

Re: Styling the rows of a +Chart based on the value

2019-12-18 Thread Alexander Burger
On Wed, Dec 18, 2019 at 09:48:16AM -0800, C K Kashyap wrote: > I get a "val> -- Bad message" when I try this - > > ( NIL NIL > '(NIL NIL NIL NIL) > (do 5 > ( (alternating) > (if (val> (: home ttl)) (gui 1 '(+TextField) 20 3) (gui 1 > '(+TextField) 150 3)) Ah,

Re: Styling the rows of a +Chart based on the value

2019-12-18 Thread Alexander Burger
On Wed, Dec 18, 2019 at 08:23:54AM -0800, C K Kashyap wrote: > Digging through the source of +DelRowButton I found (: chart 1 data) -> > this returns all the rows at once though. There are many possibilities, depending on what data you want. Best are the 'val>' methods of the charts and the

Re: Behavior of Delete confirmation

2019-12-18 Thread Alexander Burger
Hi Kashyap, > Is it intentional that the "Delete Row?" confirmation dialog is presented > only once on a page? After I click on "yes", the subsequent deletes do not > prompt a dialog. I am prompted again if I click away to another page and > come back. Yes, this is indeed the intended behavior.

Re: Auto scrolling to the end in +Chart

2019-12-17 Thread Alexander Burger
Hi Kashyap, > I think app/ord.l has a similar situation - I mean, if there are already > multiple pages of items, then one has to scroll to the end to add a new > item - is that not the case? No, you are right. You need to press the scroll button once to get to the end. In some applications I

Re: Auto scrolling to the end in +Chart

2019-12-17 Thread Alexander Burger
Hi Kashyap, > Is there a way to have the +Chart view to be auto scrolled to the end? I > display the list of updates in task.l > > - in order to add a new update, one would have to

Re: +E/R and +Set

2019-12-14 Thread Alexander Burger
On Sat, Dec 14, 2019 at 12:05:06PM -0800, C K Kashyap wrote: > About "restricted" - the observation is as follows - > - I hit localhost:3000 > - click on a tag - say "RED" > - edit it and change it's name to "RED1" and click done OK > - go to pil debug session and call (print-all) - I can see

Re: +E/R and +Set

2019-12-14 Thread Alexander Burger
On Sat, Dec 14, 2019 at 09:49:09AM -0800, C K Kashyap wrote: > Celebrated too soon! :) > (dm url> (Tab) > (and (list "task.l" '*ID This)) ) This is correct, though the 'and' has no function here. you could either do (dm url> (Tab) (list "task.l" '*ID This) ) so that 'url>' retuns

Re: Advice on learning picolisp and searching

2019-12-11 Thread Alexander Burger
Hi Priyadarshan, > Could you point to me how to search for these topics: > 1. Does PicoLisp have a "live image" one could connect to remotely? You mean a remote REPL that could be used for playing around? I'm not aware of one, it would also be quite a security hole. > 2. Is it possible to wrap

Re: +E/R and +Set

2019-12-08 Thread Alexander Burger
On Mon, Dec 09, 2019 at 06:53:29AM +0100, Alexander Burger wrote: > Yes. The standard way is to have one form, one search dialog, and one 'url>' > method per +Entity class, and handle +List's of other objects in a chart each. > > When that works, you can try to make cool ni

Re: +E/R and +Set

2019-12-08 Thread Alexander Burger
On Sun, Dec 08, 2019 at 06:56:13PM -0800, C K Kashyap wrote: > Thanks Alex...I am going to get the +Chart route working first. When I > referred the past notes I found that I've had +Char working in the past - > albeit with less indirection :) Yes. The standard way is to have one form, one search

Re: +E/R and +Set

2019-12-08 Thread Alexander Burger
On Sun, Dec 08, 2019 at 12:41:18PM -0800, C K Kashyap wrote: > Could the problem be the "List" relation between Task and Tag? I think in general this relation is fine. I would just not try to handle it in a single swoop, i.e. all in a +ListTextField > Also any suggestion about getting a "val>

Re: +E/R and +Set

2019-12-08 Thread Alexander Burger
On Sun, Dec 08, 2019 at 10:15:54AM -0800, C K Kashyap wrote: > The unwanted side effect though is that the number of tags keeps doubling. > Looks like the Val function is called both when the "edit" button is > clicked and when "done" button is pressed. While I expected it to be called > when the

Re: +E/R and +Set

2019-12-07 Thread Alexander Burger
On Sat, Dec 07, 2019 at 05:59:00PM -0800, C K Kashyap wrote: > And regarding the (+E/R +Fmt) route - this Set function works > '((This) (mapcar '((This) (: nm nm)) This)) Right, we need a list of strings for +ListTextField. 'This' indicates an object, so proper naming would better be '((L)

Re: +E/R and +Set

2019-12-07 Thread Alexander Burger
On Sat, Dec 07, 2019 at 07:57:53AM -0800, C K Kashyap wrote: > :[task.l:8] !? (mapcar 'val> (car G)) <--- line 8 is the action function in > task.l > > val> -- Bad message > I have an empty choTag function for now - I don't suppose that is involved > when I try to delete a tag. Right, this does

Re: +E/R and +Set

2019-12-07 Thread Alexander Burger
On Fri, Dec 06, 2019 at 11:55:14PM -0800, C K Kashyap wrote: > I see!!! ... Is +E/R restricted to making bi-directional connection with > the *ID only? In fact +E/R does not know about *ID. *ID is only a vehicle to pass the object to the page during GET (so just for a moment). After that it is

Re: +E/R and +Set

2019-12-06 Thread Alexander Burger
On Sat, Dec 07, 2019 at 08:10:56AM +0100, Alexander Burger wrote: > > "Title" (gui '(+E/R +TextField) '(ttl : home obj) 40) > > and > > "Title" (gui '(+Init +Set +TextField) (get *ID 'ttl) '((X) (put!> *ID 'ttl > > X)) 40) > > are equivalent in

Re: +E/R and +Set

2019-12-06 Thread Alexander Burger
Hi Kashyap, > Can you please confirm if > > "Title" (gui '(+E/R +TextField) '(ttl : home obj) 40) > and > "Title" (gui '(+Init +Set +TextField) (get *ID 'ttl) '((X) (put!> *ID 'ttl > X)) 40) > > are equivalent inside an idForm? No, +E/R, +Init and +Set are all different. +E/R is

Re: +QueryChart without pilog

2019-12-06 Thread Alexander Burger
On Fri, Dec 06, 2019 at 03:24:25PM +0100, Alexander Burger wrote: >(gui 'tags '(+Var +Val +ListTextField) > '*Tags > '((L) (extract '((X) (uppc (pack X))) L)) > '("," " ") > 20 ) Ah, and of course +ListTextField already returns a li

Re: +QueryChart without pilog

2019-12-06 Thread Alexander Burger
On Thu, Dec 05, 2019 at 07:11:43PM -0800, C K Kashyap wrote: > Okay, my choTask looks like this now - as you can see, I assigned a list > to @Names and then assigned the 'car' of the list to @Key. The way I > avoided repetition was by assigning to a global symbol '*Names' - is that > reasonable? >

Re: +QueryChart without pilog

2019-12-05 Thread Alexander Burger
On Thu, Dec 05, 2019 at 08:34:34AM -0800, C K Kashyap wrote: > About the "filtering with a no-op" - that was my way of getting rid of > NIL's in the list - what's the right way :) ? Ah, yes, sure! A valid solution! I just did not trigger on that pattern, because I use (filter prog Lst), or

Re: +QueryChart without pilog

2019-12-05 Thread Alexander Burger
Hi Kashyap, > The question I have now is about cases where we may need a couple of pilog > variables of the form - > @Names XXX > @Gen (mapcan '((Nm) (list 'nm '+TagNm Nm)) 'XXX) > > where XXX needs to be substituted with an expression - (filter

Re: +QueryChart without pilog

2019-12-04 Thread Alexander Burger
On Wed, Dec 04, 2019 at 02:32:57PM -0800, C K Kashyap wrote: > (patch choTask 'XXX '(filter '((X) X) (mapcar '((X) (uppc (pack X))) > *Tags))) > ... I do not understand your intention. I thougt you wanted an AND of all tags, so the @Gen generator was obsolete. My last proposal was: (de f

Re: +QueryChart without pilog

2019-12-04 Thread Alexander Burger
Hi Kashyap, > (de choTask (Dst) > >(diaform > > '(Dst) > > ( > > "--" > > "Name" > > (gui > > 'ttl > > '(+DbHint +Var +TextField) > > '(ttl +Task) Hmm, OK, perhaps not to *that* extreme. 'pretty' was not a

Re: +QueryChart without pilog

2019-12-04 Thread Alexander Burger
Hi Kashyap, On Tue, Dec 03, 2019 at 07:48:58PM -0800, C K Kashyap wrote: > I'll need a little bit more help with Pilog in QueryChart - In the code > below, Could you in the future provide code which is formatted in a more readable way? It is very hard to decipher. Better no spaces between lines,

Re: Calling 'native' with nested struct argument

2019-12-02 Thread Alexander Burger
Hi Nicola, > Why finding the solution to my own question > (use Con >(native "libxcb.so" "xcb_connect" 'N 'Con) >(native "libxcb.so" "xcb_connection_has_error" 'I Con) ) > doesn't make me feel less retarded? Oops, sorry! I wanted to answer yesterday, but did not have the time to dig into

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
On Thu, Nov 28, 2019 at 01:30:26PM +0100, Alexander Burger wrote: >(de f (Names) > (pilog > (quote > @Names Names > @Gen (mapcan '((Nm) (list 'nm '+TagVal Nm)) Names) > (select (@Item) >

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
On Thu, Nov 28, 2019 at 08:26:01AM -0800, C K Kashyap wrote: > I think having the filter in lisp still lets us take > advantage of +QueryChart's efficiency over large sets right? Yes, exactly. And it is faster than pure Pilog ;) ☺/ A!ex -- UNSUBSCRIBE:

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
On Thu, Nov 28, 2019 at 11:45:23AM +0100, Alexander Burger wrote: >(de f (Names) > (pilog > (quote > @Names Names > @Gen (mapcan '((C) (list 'nm '+TagVal C)) Names) > (select (@Item) >((@Gen (v +Tag) itm))

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
Oops, wait! On Thu, Nov 28, 2019 at 10:56:56AM +0100, Alexander Burger wrote: >(de f (Names) > (pilog > (quote > @Names Names > @Gen (mapcan '((C) (list 'nm '+TagVal C)) Colors) > (select (@Item) >

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
On Thu, Nov 28, 2019 at 10:44:15AM +0100, Alexander Burger wrote: > I would prepare the generator clauses as a Pilog variable, to build them at > runtime, and then use the member/2 predicate in the filter clause to check for > membership in the list of colors. Could not resist :) T

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
Hi Kashyap, > Hurray!!! :) > Just to confirm if I've understood correctly - this solution is similar > to (nm +CuSu @Sup (sup +Item) (itm +Pos) ord) from the sample app correct? > Instead of (nm +CuSu @Sup) we have (nm +TagVal @Col1 nm +TagVal) - right? Yes, similar. The +CuSu case does: 1.

Re: +QueryChart without pilog

2019-11-26 Thread Alexander Burger
On Tue, Nov 26, 2019 at 02:06:25PM -0800, C K Kashyap wrote: > It seems to work as expected using collects :) Here's the complete program > - it prints out ITEM1 and ITEM6 as expected. Ah, right, you select items, not tags, and items have a *list* of tags. OK. Then to get AND, you can instead of

Re: +QueryChart without pilog

2019-11-26 Thread Alexander Burger
On Tue, Nov 26, 2019 at 01:13:09PM -0800, C K Kashyap wrote: > Hey Alex, > What I need is an "and" - with collects, I do a (sect of L1 L2) ... I tried > a bunch but cant seem to get "and" working - > I need the items that are "RED" and "BLUE" :( Hmm, isn't that impossible? In your model, a tag

Re: File offset

2019-11-26 Thread Alexander Burger
On Tue, Nov 26, 2019 at 09:09:08AM -0800, C K Kashyap wrote: > Is there a way to get the file offset (which I can get using lseek)? I need Unfortunately, the PicoLisp I/O machinery does not handle file positions, and has no functions to get or set them. The database does it (the position of an

Re: +QueryChart without pilog

2019-11-25 Thread Alexander Burger
Hi Kashyap, > Here's a new problem - as per the previous conversation, it seems that I > could use "collect" to get the items that I am interested in. > > (let (RED (db 'nm '+TagVal "RED") > BLUE (db 'nm '+TagVal "BLUE")) > (setq L1 (collect 'v '+Tag RED RED 'itm)) > (setq L2

Re: Pilog query across multiple classes

2019-11-23 Thread Alexander Burger
On Sat, Nov 23, 2019 at 09:45:56AM -0800, C K Kashyap wrote: > Quick follow up - I altered the tags like this - > > (class +Item +Entity) > (rel ttl (+IdxFold +String)) > (rel tgs (+List +Joint) itm (+Tag)) > (rel sts (+IdxFold +String)) > > (class +Tag +Entity) > (rel itm (+Joint) tgs (+Item))

Re: Pilog query across multiple classes

2019-11-23 Thread Alexander Burger
On Sat, Nov 23, 2019 at 09:10:26AM -0800, C K Kashyap wrote: > Okay ... just to clarify. (collect 'nm '+Tag "BLUE" NIL T 'itm) is the > recommended way to get to all items for a given Tag. Well, yes, but this is the previous version which I wrote in a wrong way. To get all blue ones: (collect

Re: Pilog query across multiple classes

2019-11-23 Thread Alexander Burger
On Sat, Nov 23, 2019 at 05:11:15PM +0100, andr...@itship.ch wrote: > +Idx is for +String, actually a special variant of the general > non-unique index +Ref. Correct, makes sense only for strings, as it indexes substrings. > Now I'm currently unsure if +Ref and +Joint can be combined... might be

Re: Pilog query across multiple classes

2019-11-23 Thread Alexander Burger
On Sat, Nov 23, 2019 at 07:49:43AM -0800, C K Kashyap wrote: > How can I add +Idx to tgs? That should be possible right? No, it makes no sense to add an index to a +Joint. Because the object *is* already reachable via the joint's back link. What *does* make sense is (+Ref +Link), which is

Re: Pilog query across multiple classes

2019-11-22 Thread Alexander Burger
Hi Kashyap, > (collect 'tgs '+Item (db 'nm '+Tag "BLUE")) does not seem to work for me - Sorry, my fault! I did not test. > returns NIL. For that matter, even (collect 'tgs '+Item) returns NIL. I > wonder if its because 'tgs does not have +Idx in the relation > > (class +Item +Entity) > (rel

Re: Reactive programming

2019-11-22 Thread Alexander Burger
Hi Eric, > Is there any way to have a web app watch a > file and update itself (as well as what is > displayed by the browser) as soon as the file > is changed? Yes, I think the necessary ingredients are there. For example, I use inotifywait to watch database replication files (in the fifo/

Re: Pilog query across multiple classes

2019-11-21 Thread Alexander Burger
Hi Kashyap, sorry, I was busy! I did not find the time to install and deeply check all your code. > 1. Query all open items that have the given tag >> I think I have a workaround for my question 1 :) - if I use the status as >> an inline relation instead of a link that is. I think it makes no

Re: Trouble with file upload

2019-11-12 Thread Alexander Burger
On Tue, Nov 12, 2019 at 11:17:45AM -0800, C K Kashyap wrote: > Okay, I can see the file name when I print out (: drop) > > ! (: drop) > > -> "/root/.pil/tmp/310/Screen Shot 2019-10-17 at 10.00.18 AM.png" > > How can I get the content of the file? Is it (: home obj)? - that's NIL for > me. Hmm,

Re: Trouble with file upload

2019-11-12 Thread Alexander Burger
On Tue, Nov 12, 2019 at 10:11:02AM -0800, C K Kashyap wrote: > I am sure I am missing something trivial but the breakpoint does not get > hit when I select a file and click on install :( That's indeed strange! Does it work for you on your system with the same browser for the original "app" demo?

Re: Trouble with file upload

2019-11-12 Thread Alexander Burger
Hi Kashyap, > Removing the quote does get rid of the error message but I'm not sure > how to access the uploaded content though. I noticed that even app/item.l > has a quote before the cond expression. Ah, sorry! I misread your mail. I saw '(if ... '(cond So I thought '(if ...) is the

Re: Trouble with file upload

2019-11-12 Thread Alexander Burger
Hi Kashyap, > I think this should really be the last question in the application > development question series. No problem :) > The app should really just have upload button on the page > and when a midi file is uploaded, I do my thing and write out the SonicPi > code. > ... > (gui

Re: More application development questions

2019-11-10 Thread Alexander Burger
On Sun, Nov 10, 2019 at 08:23:07AM -0800, C K Kashyap wrote: > (html 0 Ttl "@lib.css" NIL > (action > (idForm "A" '(choTmp) 'nr '+Update T '(may Delete) '((: nr)) Can you try first to change the nesting: (action (html 0 "Some Title" "@lib.css" NIL (idForm ...

Re: More application development questions

2019-11-10 Thread Alexander Burger
Hi Kashyap, > After getting my todo app to work by editing the sample app I wanted to try > out a standalone version just to see if I understood all the moving parts. > I have two files > - > todo.l (the main file) and tsk.l

Re: Pilog query across multiple classes

2019-11-05 Thread Alexander Burger
Hi Kashyap, > My ER model looks like this - > (class +Task +Entity) > (rel ttl (+IdxFold +String)) > ... > (rel upds (+List +Joint) tsk (+Update)) > ... > (class +Update +Entity) > (rel tsk (+Joint) upds (+Task) ) > (rel dsc (+Sn +IdxFold +String)) > ... > How can I select all the Tasks that have

Re: Backing up the db

2019-11-04 Thread Alexander Burger
On Mon, Nov 04, 2019 at 06:37:09AM -0800, C K Kashyap wrote: > Found it :) > https://picolisp.com/wiki/?ssl Perfect! ☺ -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: Backing up the db

2019-11-04 Thread Alexander Burger
Hi Kashyap, > I've used a single file as the database as of now - (pool "tasks.db"). What > are my options for backing up the db file? Is it safe to copy the file > while the app is running (I plan to keep the app running). I would not simply copy the DB file(s) while updates might occur. A

Re: Controlling the column width QueryChart table

2019-11-02 Thread Alexander Burger
On Sat, Nov 02, 2019 at 09:34:08AM -0700, C K Kashyap wrote: > I have to admit that I have not read the code in detail but is there a > "logical circular reference" happening when app/gui.l refers to app/item.l > and then app/item.l refers to choItem which is app/gui.l? Couldn't all > "item"

Re: Unexpected "data not found" in my todo app

2019-10-30 Thread Alexander Burger
Hi Kashyap, > Okay ... I have it working now :) Although, I am not sure if I did the > right thing - I was able to access the Task using (: home obj) Great! :) > (gui '(+Button) "Update" > '(put!> (: home obj) 'upds >(cons > (new! '(+Update) > 'dsc (val>

Re: Unexpected "data not found" in my todo app

2019-10-29 Thread Alexander Burger
On Tue, Oct 29, 2019 at 10:06:53AM -0700, C K Kashyap wrote: > Wouldn't we need to link the update to the 'upds relation of Task? Perhaps. I provided just a general solution, not necessarily matching your data model, as I don't have it running here. > This does not quite work :( Not sure, it

Re: Unexpected "data not found" in my todo app

2019-10-29 Thread Alexander Burger
Hi Kashyap, > I added index to +Update and the UI started giving me a drop down with the > existing updates. That made me realize that what I really want is for the > updates to show up uneditable > ... >#(gui 1 '(+Obj +TextField) '(dsc +Update) 30) )) >(gui 1

Re: Unexpected "data not found" in my todo app

2019-10-29 Thread Alexander Burger
Hi Kashyap, > tsk.l is where I have a problem. Updating the existing updates works fine > but if I add a new update, I get "Data not found" as in the screenshot This "Data not found" message is from '+Obj'. > (gui 1 '(+Obj +TextField) '(dsc +Update) 30) An '+Obj' field holds an object,

Re: pilog question about combined indexes

2019-10-24 Thread Alexander Burger
On Thu, Oct 24, 2019 at 07:16:31AM -0700, C K Kashyap wrote: > If I understand correctly - the filter clause is redundant because it does > not subset the records generated by the generator? Yes. In this simple case, where we have only a single generator, this is correct. You don't need 'select'

Re: pilog question about combined indexes

2019-10-24 Thread Alexander Burger
Hi Kashyap, > : (? (select (@Tel) ( (mob +CuSu "37 176 86303") ) )) > @Tel={C1} > ... > : (? (select (@Tel) ( (mob +CuSu "37 176 86303" tel +CuSu "37 176 86303") ) > )) > -> NIL > > The first query returned as expected. The second one I believe means - look > for "37 176 86303" either in tel

Re: Request for app development feedback/help

2019-10-21 Thread Alexander Burger
On Mon, Oct 21, 2019 at 07:12:32AM -0700, C K Kashyap wrote: > Finally - its good to see the values :) ... I used (show @@). > I see, so @@ is just a "variable" introduced in the select function - i got > a little confused by (@@) - I thought it was a function call - but looks > like select takes

Re: Request for app development feedback/help

2019-10-21 Thread Alexander Burger
On Mon, Oct 21, 2019 at 06:16:41AM -0700, C K Kashyap wrote: > Thank you Alex, > I get the following when I run the (?) - for which I defined a function XX. Good. > I do see that I get back 1 record when *CuSuNm is "Oaks" and 3 records when > *CuSuNm is "". However, I don't see the actual values

Re: Request for app development feedback/help

2019-10-21 Thread Alexander Burger
Hi Kashyap, > While I see the big pieces based on the description given in doc/app.html, > I need some help understanding the Pilog queries. > > I think I can make progress if I could figure out how to run the pilog > queries in the sample app on the REPL. For example, how can I run the pilog >

Re: How I run small mailing lists

2019-10-13 Thread Alexander Burger
On Sun, Oct 13, 2019 at 01:27:22PM +, SuperSaiyanBlue wrote: > Done. Added a link to all posts tagged picolisp under documentation/Other > resources site section. > > https://adamo.wordpress.com/tag/picolisp/ Good place I think! ☺/ A!ex -- UNSUBSCRIBE:

Re: How I run small mailing lists

2019-10-10 Thread Alexander Burger
Hi Yiorgos, > Hello, I wrote a blog post where I describe how I use picolisp to run small > discussion lists: > > https://adamo.wordpress.com/2019/10/10/how-i-run-a-small-discussion-mailing-list/ That's nice indeed! Perhaps we should also place a link to the post in picolisp.com? ☺/ A!ex --

Re: Sort order not always kept when querying the database

2019-10-09 Thread Alexander Burger
Hi Eric, thanks for sharing your code! As far I could see on a first scan, it looks very good. > The result starts with "Wednesday" instead of > "Monday" as for the week 41 or other weeks! The values have no inherent ordering, as they all have the same key (the combination of year and day).

Re: How to query the database?

2019-10-03 Thread Alexander Burger
Hi Eric, > "(rel year (+Aux +Ref +Number) (week))" > makes a huge difference and works very well. > > as an example "(mapcar show (collect 'year '+Agenda (2019 32))" > > gives the whole week in a very very short query. Yes, and you can also query larger ranges, like (collect 'year '+Agenda

Re: How to query the database?

2019-10-01 Thread Alexander Burger
Hi Eric, > So far I've done the mods to the database rel you suggested and I have this > query: > (? (select (@A) ((year +Agenda 2019) (week +Agenda 32) (same 2019 @A year) > (same 32 @A week)) ) > which works and gives me results like these: > @A = {1643} > ... > @A = {1731} > > Now, is there

Re: How to query the database?

2019-10-01 Thread Alexander Burger
On Tue, Oct 01, 2019 at 09:24:33AM +0200, Alexander Burger wrote: > (rel year (+Ref +Number)) > ... > (rel week (+Ref +Number)) An useful optimization in this case would be using an '+Aux' index (rel year (+Aux +Ref +Number) (week)) ... (rel week (+Ref +Number)) In

<    2   3   4   5   6   7   8   9   10   11   >