Re: PilCon tomorrow (Anatomy of Vip)

2021-04-13 Thread polifemo
was the meeting recorded? where can I watch it? Vip is something I've wanted to hack for quite some time, but got really confused each time I tried to read it XD On Fri, Apr 9, 2021, 11:14 Cesar Rabak wrote: > Good for me too. > > Thanks for all the replies so far! > > l look forward to the nex

What is the structure of a namespace

2021-04-16 Thread polifemo
I've realized that the 'pico namespace is a tree, but I can't figure out which kind of tree. It does not seem fit with a binary tree structure. So, what's the structure of namespaces, and what's the algorithm for organizing the symbols inside a namespace list?

Re: What is the structure of a namespace

2021-04-16 Thread polifemo
'simul namespace the same as creating the 'pico namespace? And how is the namespace of a loaded file created? On Fri, Apr 16, 2021 at 2:01 PM Alexander Burger wrote: > Hi polifemo, > > > I've realized that the 'pico namespace is a tree, but I can't figure

Re: What is the structure of a namespace

2021-04-16 Thread polifemo
OH! I think I'm getting it! for example, 'simul is '(\~ ("permute" ("shuffle" ("flood" ("G" NIL "gen" ("DX" NIL "DY" ("FX") "FY" NIL "Col") "game" ("grid" ("Grid")) "west" ("east" ("East" ("disp")) "West")) "south" ("north" NIL "South") "border")) "subsets" ("samples"))) Something that confused me

Re: What is the structure of a namespace

2021-04-17 Thread polifemo
s for answering my questions! Having such clear an practically immediate feedback makes it a joy to learn. I really am grateful. On Sat, Apr 17, 2021 at 1:00 AM Alexander Burger wrote: > On Fri, Apr 16, 2021 at 03:13:10PM -0500, polifemo wrote: > > OH! I think I'm getting it! > &g

^X does not exit a breakpoint in pil21

2021-04-19 Thread polifemo
it seems that ^X does not exit a breaking point to the main picolisp process anymore. When I break a process with ^C, for example `(loop (println "hello world") (wait 1000))`, I enter a breakpoint, but I can't return to toplevel with ^X as I used to. was this functionality disabled? for now, I c

Is there a mechanism to save the last defined function?

2021-04-19 Thread polifemo
Inspired by the way methods are defined, by just defining them and looking which class a method belongs to by looking into the global variable *Class, I'd like to have a similar mechanism for creating docstrings. My idea is something like this: ``` (de f (A) A) (mkdocstr "A test function that retu

why does *Dbg appear to prevent loading of @lib/vip.l in vip?

2021-05-13 Thread polifemo
reading the file that calls vip, the first line is: (unless *Dbg (load "@lib/vip.l") ) why does it seem that, when in debug mode, the vip library is prevented from loading? its especially confusing since it seems to do nothing, as running `vip +` runs vip normally.

Re: why does *Dbg appear to prevent loading of @lib/vip.l in vip?

2021-05-13 Thread polifemo
ok! thank you! :D On Thu, May 13, 2021 at 12:05 PM Alexander Burger wrote: > On Thu, May 13, 2021 at 11:40:50AM -0500, polifemo wrote: > > reading the file that calls vip, the first line is: > > > > (unless *Dbg > >(load "@lib/vip.l") ) > > > &g

what does prepending a "+" to an argument to vip do?

2021-05-13 Thread polifemo
reading through the file @bin/vip, I found this line: ((pre? "+" S) inside this function (bye (if (vip~vi (make (while (opt) (let S @ (cond ->> ((pre? "+" S) (link (

Re: what does prepending a "+" to an argument to vip do?

2021-05-13 Thread polifemo
whoa! that's ingenious! Thank you for the quick response On Thu, May 13, 2021 at 1:41 PM Alexander Burger wrote: > On Thu, May 13, 2021 at 01:15:54PM -0500, polifemo wrote: > > (cond > > ->> ((pre? "+"

load script to vip with `vip -@ext.l hello`

2021-05-13 Thread polifemo
I'm having trouble loading the library picohome/ext.l with the minus notation of vip. I could not find an example in the wiki's documentation, could someone be kind enough to explain how to use it?

Re: load script to vip with `vip -@ext.l hello`

2021-05-13 Thread polifemo
I'm using picolisp version 21.4.10 On Thu, May 13, 2021 at 4:59 PM polifemo wrote: > I'm having trouble loading the library picohome/ext.l with the minus > notation of vip. > > I could not find an example in the wiki's documentation, could someone be > kind enough to explain how to use it? >

bug report for @bin/vip

2021-05-13 Thread polifemo
I realized the source of my previous loading problem: (bye (if (vip~vi (make (while (opt) (let S @ (cond ((pre? "+" S) (link (cons (c

Re: bug report for @bin/vip

2021-05-13 Thread polifemo
(T (link S)) ) ) ) ) ) 0 1 ) ) On Thu, May 13, 2021 at 5:39 PM polifemo wrote: > I realized the source of my previous loading problem: > > (bye >(if > (vip~vi > (make > (while (opt) >(let S @

Re: bug report for @bin/vip

2021-05-13 Thread polifemo
oh! I get it! thanks for clearing that up. On Fri, May 14, 2021, 00:40 Alexander Burger wrote: > On Fri, May 14, 2021 at 07:16:27AM +0200, Alexander Burger wrote: > > In Vip, this is useful for example to set the correct namespace: > > > >$ vip --symbols llvm src/main.l + > > > > (note the d

in eval, how does the 'num argument work?

2021-05-15 Thread polifemo
the doc of 'eval says this: (eval 'any ['cnt]) -> any Evaluates any. Note that because of the standard argument evaluation, any is actually evaluated twice. If an offset cnt is given, the value of @ in the cnt'th call environment is used during the second evaluation. cnt should be greater than ze

Re: in eval, how does the 'num argument work?

2021-05-15 Thread polifemo
On Sat, May 15, 2021 at 10:19 PM polifemo wrote: > the doc of 'eval says this: > > (eval 'any ['cnt]) -> any > Evaluates any. Note that because of the standard argument evaluation, any > is actually evaluated twice. > > If an offset cnt is given, t

the purpose of (eval (++ Prg) 1) in the 'task function

2021-05-16 Thread polifemo
I'm studying 'trace in @lib.l, and I've run into a question. I don't understand why must 'eval be called on the second number on the case that the first number is negative. I'm especially confused by giving 1 as an argument to 'eval. That's supposed to give you the context from which to extract the

Re: the purpose of (eval (++ Prg) 1) in the 'task function

2021-05-16 Thread polifemo
ok, I've found a way to pass an expression to eval: (task -5000 (* 10 100) N 0 (tty (println (inc 'N the next step is to figure a way to use @ inside that expression On Sun, May 16, 2021 at 7:14 PM polifemo wrote: > I'm studying 'trace in @lib.l, and I've ru

Re: the purpose of (eval (++ Prg) 1) in the 'task function

2021-05-16 Thread polifemo
7;when, which is the enclosing caller of the (eval (++ Prg) 1) expression. On Sun, May 16, 2021 at 7:19 PM polifemo wrote: > ok, I've found a way to pass an expression to eval: > (task -5000 (* 10 100) N 0 (tty (println (inc 'N > > the next step is to figure a way to us

tentative bug report for 'task

2021-05-17 Thread polifemo
I'm not sure if this is really a bug, since the behaviour I expected only runs in a version of 'task I'm refactoring right now. But I'll try anyways. So, running: (task -5000 (/ @ 5) (tty (println 'a))) does not save in *Run my expected: (-5000 -1000 (tty (println 'a))) but instead it saves this

Re: tentative bug report for 'task

2021-05-18 Thread polifemo
I see, I had misunderstood the @'s meaning there. Thanks for the clarification! On Tue, May 18, 2021 at 12:03 AM Alexander Burger wrote: > On Mon, May 17, 2021 at 04:53:50PM -0500, polifemo wrote: > > So, running: > > (task -5000 (/ @ 5) (tty (println 'a))) > &g

get the 'up value of a variable across a lambda

2021-05-23 Thread polifemo
while `(let @ 1 (let @ 10 (let @ 20 (up 2 @` returns 1, as I expected, if I enclose the 'up expression inside a function like `(de f (N) (up N @))` then no value of N will yield the value of @ in an environment higher than the innermost let: ` : (let @ 1 (let @ 10 (let @ 20 (f 3))) -> 20 ` how

Re: get the 'up value of a variable across a lambda

2021-05-24 Thread polifemo
at 12:55 AM Alexander Burger wrote: > On Sun, May 23, 2021 at 08:44:32PM -0500, polifemo wrote: > > `(let @ 1 (let @ 10 (let @ 20 (up 2 @` > > This are two misunderstandings in this example: > > 1. It has not a good idea to bind '@' in a 'let' expre

use of (+ N) in 'task and 'timeout

2021-05-24 Thread polifemo
As I refactor pil21 for my amusement, I've found the function '+ being used on single numbers. What is this for? As far as I could think, it might have to do something with formatting... but I really can't think of anything. here are two examples, in related operations: (de timeout (N) (if2 N

Re: use of (+ N) in 'task and 'timeout

2021-05-25 Thread polifemo
thanks for the explanation! I'm glad I was able to help a little : ) On Tue, May 25, 2021, 00:35 Alexander Burger wrote: > On Mon, May 24, 2021 at 08:03:35PM -0500, polifemo wrote: > > As I refactor pil21 for my amusement, I've found the function '+ being > used >

why is (prog . '((+ 1 2 3) (+ 4 5 6))) not equivalent to (apply 'prog '((+ 1 2 3) (+ 4 5 6)))

2021-05-26 Thread polifemo
(prog . '((+ 1 2 3) (+ 4 5 6))) returns the expected value, 15, while (apply 'prog '((+ 1 2 3) (+ 4 5 6))) fails with "Address boundary error". Why is this so? I would have expected both to behave the same, and they do if I use a more benign function like '+ (+ . (1 2 3)) -> 6 (apply '+ (1 2 3))

Re: why is (prog . '((+ 1 2 3) (+ 4 5 6))) not equivalent to (apply 'prog '((+ 1 2 3) (+ 4 5 6)))

2021-05-27 Thread polifemo
I see! thanks! On Thu, May 27, 2021 at 12:39 AM Alexander Burger wrote: > On Wed, May 26, 2021 at 11:49:57PM -0500, polifemo wrote: > > (prog . '((+ 1 2 3) (+ 4 5 6))) returns the expected value, 15, while > > (apply 'prog '((+ 1 2 3) (+ 4 5 6))) fails with "

in the function 'later, why is the pipe run inside a 'task?

2021-06-05 Thread polifemo
Studying the implementation of 'later, I'm curious as to why the pipe is run inside a 'task. I've tested it and it works just fine without the task. My guess is that it allows for parallel processes. Programs inside *Run are run independently of the sequence of the main program. If it was run with

penti chorded keyboard not working with termux v.117

2021-09-17 Thread polifemo
termux in the app store is not being updated anymore, and the team recommended I move to the F-droid version of the app, since they are not gonna update to the google app store anymore. I followed the termux updating instructions, but after the update penti stopped working with termux. If I try to

Re: penti keyboard not working with termux 0.117

2021-09-17 Thread polifemo
> termux in the app store is not being updated anymore, and the team > recommended I move to the F-droid version of the app, since they are not > gonna update to the google app store anymore. > > I followed the termux updating instructions, but after the update penti > stopped working with termux.

Re: penti chorded keyboard not working with termux v.117

2021-09-17 Thread polifemo
this worked perfectly, thank you so much! On Fri, Sep 17, 2021, 13:53 Alexander Burger wrote: > Hi polifemo, > > > I followed the termux updating instructions, but after the update penti > > stopped working with termux. If I try to open penti it glitches and stops > > wo

the purpose of *KeyMap in vip

2022-12-19 Thread polifemo
I'm slowly studying the @lib/vip.l source, and I've run into a global variable that appears to not be documented. What's the use of *KeyMap ? I guess it's something to do with custom keyboard remappings? Thanks for your time.

methods receive more arguments than defined?

2022-12-21 Thread polifemo
Still reading the vip source, and I've noticed that, often, a method call will have more arguments than defined in the method definition. Like: (dm dirty> (Win) (<> (: undo) (: dirt)) ) .. (if (dirty> (: buffer) This) " * " " ") .. (dirty> (: buffer) This) and (dm load> (Win) .. (load> (:

Re: methods receive more arguments than defined?

2022-12-21 Thread polifemo
the rest of the code, but “This” is not an > > argument, but a global variable managed by the system to have the > current object > > as a value: > > Right. > > > > > On 21. Dec 2022, at 16:51, polifemo > wrote: > > > > What does this mean? Why is T

abort in less than a second

2023-04-23 Thread polifemo
I have a loop that executes a prg and then waits for the user to input something. If the user does not input anything within the timeout, the waiting is aborted and the loop restarts. The problem is that, I want the timeout to be much faster, but 'abort only works in seconds. Is there a way to abor

Re: abort in less than a second

2023-04-24 Thread polifemo
Thank you so much! I used poll to check for anything to read from stdin and it worked flawlessly. Here's the code. It does not have any context, but it is an example of how to use poll: '(loop (eval (loadRepeat)) (wait 100) (T (and (poll 0) (= "53" (line T))) (set

pil21 installation fail

2023-11-11 Thread polifemo
I just downloaded the latest pil21.tgz (2023-11-11) in my linux box. The installation fails immediately with: ``` clang-16: error: unable to make temporary file: No such file or directory make: *** [Makefile:32: ../lib/sysdefs] Error 1 ``` I think it's trying to search for the sysdefs.c file in p

Re: pil21 installation fail

2023-11-15 Thread polifemo
file: No such file or directory" error. Thanks Abu for the clue ;) On Sun, Nov 12, 2023 at 1:46 AM Alexander Burger wrote: > On Sat, Nov 11, 2023 at 04:14:02PM -0500, polifemo wrote: > > clang-16: error: unable to make temporary file: No such file or directory > > make: