subscribe

2015-11-24 Thread pd
-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


Re: Why won't the LED flash?

2015-12-20 Thread pd
sorry if you already said this but what platform are you using? also a
schematic of your circuit would be interesting even being so simple

On Sun, Dec 20, 2015 at 3:18 AM, Josh  wrote:

> Thought it might be a firmware problem or something, so I just re-flashed
> the firmware but it's still happening, just eliminating possibilities. Also
> the second of my last emails was the correct one, I canceled the previous
> but it sent anyways. Thanks.
>
>
> On 19/12/15 12:50, Josh wrote:
>
> I have put the main code onto the sd card and I use the shell to call the
> function prog-loop. The light just stays on. I've had this problem before
> with the example blink program, if I change any of it to make it shorter by
> using shorter function names like (de low () (pio-pin-setlow 'PB_29)) it
> doesn't work, but it does when it's just (pio-pijn-setlow 'PB_29). I don't
> really know what's going on, but it's starting to get irritating.
> On 19/12/15 03:45, Raman Gopalan wrote:
>
>
> Dear Josh, greetings!
>
> Firstly, great to know you're playing with your board! Perfect!
>
> > Why does this small amount of code not make the onboard LED flash?
>
> I think you're not providing enough delay for you to see the off state
> of the LED. Why don't you try this? I've just inserted an additional
> delay.
>
> (pio-pin-setdir *pio-output* 'PB_29)
> (pio-pin-sethigh 'PB_29)
>
> (loop
>(pio-pin-setlow 'PB_29)
>(tmr-delay 0 10)
>(pio-pin-sethigh 'PB_29)
>(tmr-delay 0 10) )
>
> > Any ideas? Also this example on the hempl wiki book:
>
> This example doesn't blink the on-board LED. It just reads the status
> of an input pin (SW-1 I think; the one near the voltage regulator) and
> turns the blue LED on when this input switch is pressed.
>
> > # And now, the main loop
> > (de prog-loop ()
> >(init-pins)
> >(loop
> >   (if (= 0 (pio-pin-getval button))
> >  (pio-pin-setlow led)
> >  (delay 10)
> >  (pio-pin-sethigh led)
> >  (delay 10) ) ) )
>
> Please copy the example on your micro-SD card and point picolisp in
> the direction of this file. If this doesn't happen, something strange
> is happening. We can then debug. But I'm almost certain it'll work :)
>
> Hempl# picolisp /mmc/user-button.l
>
> R
>
> P.S. You may also use the internal transient symbol `*tmr-sys-timer*'
> in the function tmr-delay. I think it uses a hardware PWM channel to
> generate the time (can't remember which; I'll have to see the sources
> again). That makes the timing accurate.
>
>
> On 18 December 2015 at 22:08, Josh  > wrote:
>
>> Why does this small amount of code not make the onboard LED flash?
>> (pio-pin-setdir *pio-output* 'PB_29)
>> (pio-pin-sethigh 'PB_29)
>> (loop (pio-pin-setlow 'PB_29)
>>  (tmr-delay 0 10)
>>  (pio-pin-sethigh 'PB_29))
>> All that happens in the blue LED turns on and stays on, even though the
>> code clearly says for it to go from high to low repeatedly. Any ideas? Also
>> this example on the hempl wiki book:
>>
>> # A simple program which demonstrates
>> # the usage of user-buttons.
>>  # declare pins
>> (setq led 'PB_29 button 'PX_16)
>>
>> # a simple delay function
>> (de delay (t)
>>(tmr-delay 0 t) )
>>
>> # make sure the LED starts in
>> # the "off" position and enable
>> # input/output pins
>> (de init-pins ()
>>(pio-pin-sethigh led)
>>(pio-pin-setdir *pio-output* led)
>>(pio-pin-setdir *pio-input* button) )
>>
>> # And now, the main loop
>> (de prog-loop ()
>>(init-pins)
>>(loop
>>   (if (= 0 (pio-pin-getval button))
>>  (pio-pin-setlow led)
>>  (delay 10)
>>  (pio-pin-sethigh led)
>>  (delay 10) ) ) )
>>
>> (prog-loop)
>>
>> Doesn't make the LED flash it just stays on.
>>
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>
>
>
>


-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


Re: Extending the wiki markup syntax

2016-03-11 Thread pd
On Thu, Mar 10, 2016 at 4:41 PM, Alexander Burger 
wrote:

> Hi Erik,
>
> > be the right choice there. For the others, couldn't it expand into a
> > 'class=' or 'id=' within the tag? So,
> >
> >x{myStyle
> >   /{This is the text}
> >}
> >
> > would expand to,
> >
> >This is the text
> >
> >
> > and
> >
> >x{myStyle
> >   1{This is the header}
> >}
> >
> > would become,
> >
> >This is the header
> >
> >
> > Maybe this makes it more makes it more complicated than it needs to
>
> This looks like a very good idea! Perhaps it is not complicated at all,
> if we utilize the '*Style' mechanism from @lib/xthml.l, which propagates
> down through the tag functions via 'dfltCss'.
>
> It is worth to be investigated more deeply!
>
>
>
I also think it¡s a great idea that worths to be investigated but maybe one
char only is a limitation because of being too ofuscated, for example the 1
in:

x{myStyle
   1{This is the header}
}

may seem too obvious it refers to title 1 or heading 1 but the reality is
it is more a magic number rather a meaningful one. It would be better using


x{myStyle
   h1{This is the header}
}

There're a lot of html tags and increasing so this could be a real problem.
In that sense I find more interesting, flexible and informative the use of
functions like in:

(h1 (class "myStyle") "this is the header")


a bunch of questions about syntax

2017-01-26 Thread pd
I was reading the picolip documents ref, tutorial and function reference
and I'm afraid I misunderstand some concepts, so I'm asking a bunch of
questions in the hope you can help to achieve a better picolisp
understanding

1- In the ref document it's said talking about types in picolisp:

   - three base data types: Numbers, Symbols and Cons Pairs (Lists),
   - the three scope variations of symbols: Internal, Transient and
   External, and
   - the special symbol NIL.

suggesting dotted pairs are the same as lists, both are
indistinguishable so it should be possible to write any list as a dotted
pair, i. e. (1 2) = (1 . (2 . NIL)) but what is the list for (1 . 2) dotted
pair?


2- In the same doc talking about function arguments you can read "A lambda
expression always has a list of executable expressions as its CDR. The CAR,
however, must be a either a list of symbols, or a single symbol, and it
controls the evaluation of the arguments to the executable function
according to the following rules:
When the CAR is a list of symbols For each of these symbols an argument is
evaluated, then the symbols are bound simultaneously to the results. The
body of the lambda expression is executed, then the VAL's of the symbols
are restored to their original values. This is the most common case, a
fixed number of arguments is passed to the function. Otherwise, when the
CAR is the symbol @ All arguments are evaluated and the results kept
internally in a list. The body of the lambda expression is executed, and
the evaluated arguments can be accessed sequentially with the args
, next
, arg
 and rest
 functions. This allows to
define functions with a variable number of evaluated arguments. Otherwise,
when the CAR is a single symbol The symbol is bound to the whole
unevaluated argument list. The body of the lambda expression is executed,
then the symbol is restored to its original value. This allows to define
functions with unevaluated arguments. Any kind of interpretation and
evaluation of the argument list can be done inside the expression body."Also
the doc said the rules for parameters may be combined and show several
examples:


a)   : (de foo (X Y . Z) # CAR is a list with a dotted-pair
tail
According with the parameters rules the first is supposed to bind X to the
first evaluated parameter, Y to the second and Z to the rest of parameters
but here the rule to apply is the first one, car is a list of symbols (X, Y
and Z the last two in the dotted pair Y.Z) so every symbol must be binded
to evaluated parameters, thus a funcion call like:

(foo (1 2 3 4))

should bind 1 to X, 2 to Y and 3 to Z discarding 4 but the examples says it
really binds 1 to X, 2 to Y and (3 4) to Z thus effectively merging first
and third rule, the question is why? since the CAR is not a single symbol
but a list and also the dotted-pair tail (Y.Z) is not a single symbol but a
dotted pair

b)  : (de foo (X . @)   # CAR is a dotted-pair with '@'

This case is similar to the previous but merging first and second rules but
in this case first rule doesn't apply because as comment remarks CAR is a
dotted pair not a list


3-  In the function reference I see several times functions described with
dots in parameter lists, I think it's related to question 2 and it is just
using the merging-rules parameters but what's the difference between these
two notations:

  -  (dbs+ 'num . lst)

  -  (delete 'any 'lst) -> lst

and what means the following notation?

  -  (dbs . lst)

4- Usually in classical lisp syntax you must use dot surrounded by spaces
to indicate a dotted pair, I supposed this will be the same in picolisp
because of fixed point numbers notation so you always shoud use (sym . sym)
to write a dotted paid in particular with transient symbols ("hello" .
"world") but I saw in this lists messages seeming to use the notation
("hello"."world") to write a dotted pair, is it allowed? or maybe is
another kind of data type?



thanks for your replies


Re: a bunch of questions about syntax

2017-01-26 Thread pd
Alex, thanks a lot for your very clarifier reply (specially the procedural
way of thinking which makes a lot of sense to me), I'm still confusing in a
couple of things...


I've read in docs that the ' prefix in a name of formal parameter when
describing a funcion indicates it's a evaluated parameter  (even when the
opposite is clearer to me , using ' to indicate a non-evaluated parameter
following the quote notation you use when want to preserve something from
evaluation) but when describing functions ' is a notation mark with a
semantic, what is the semantic of dot notation mark when used in formal
parameters in function description?

I mean, you have these two notations for functions:

  -  (dbs+ 'num . lst)

  -  (delete 'any 'lst) -> lst

are they applied the same? with the same kind of parameters?

I mean, if I describe the function F as being:

  -  (F 'num lst) -> num

am I saying the same as if I describe it this way?:

  -  (F 'num . lst) -> num


if not, what is the difference?


> and what means the following notation?
> >
> >   -  (dbs . lst)
>
> This notation is meant to represent a function like
>
>(de dbs Lst ..)
>
> so that a call
>
>(dbs a b c d)
>
> binds (a b c d) to 'Lst'.
>
>(dbs a b c d) = (dbs . (a b c d))
>
>

So I suppose the notation (dbs+ 'num . lst) refers to a function defined as
(de dbs+ X . Z ...) and thus first parameter is binded to X and also must
evaluate to a number and rest of parameters will be bound to Z, so you call
this function like (dbs+ 4 a b c) ,  what notation will you use to express
you have to pass a list as parameter to a function?  maybe (dbs+ 'lst) ? I
mean a notation to express you *must* call a function using a list like (f
(a b c)) and not (f a b c)


Also taking about dot, as you said you have to use delimiters to separate
symbols and thus you must surround dot with spaces (or any other delimiter
I suppose, probably you can write the weird sentence (a,.,b) as an
alternative to (a . b) dotted pair), so I suppose dot is kind of operator
(maybe a read macro as ' ?) anyway I think it would be interesting if dot
could act as an operator being associative to the right, so you can write:

( a . b . c . d . NIL)

to be equal to

(a . (b . (c . (d . NIL

and also equal to  (a b c d)

does it have any sense?


Re: a bunch of questions about syntax

2017-01-27 Thread pd
Thanks again for your explanations Alex, still some comments...

On Fri, Jan 27, 2017 at 8:16 AM, Alexander Burger 
wrote:

>
>
> BTW, I thought again about the terminology of "list" versus "cons pairs"
> and
> plain "cells". "list" is a rather unprecise term, I feel it is not limited
> to "a
> chain of cells with NIL at the end". I use "list" for any sequence of
> cells (as
> opposed to other structures like "tree", "graph" or "set"). These include
> also
> e.g. "circular lists" like (1 2 3 .), which have no NIL at the end (in
> fact, no
> end at all).
>

Ok, so from this point of view every cons pair is a list even those with a
dotted pair in the tail

But I think it's interesting to distinguish between two different kind of
lists, those having a NIL symbol in last cell CDR (let's say ending in NIL
symbol) and with a non NIL in las cell CDR (those ending in a symbol not
NIL) just because of almost every function dealing with lists assume they
belong to NIL-ending kind.

I mean, with a NIL ending list you have an empty list condition (NIL) but
how do you know a non-NIL ending list is empty? and since most functions
dealing with lists have a recursive pattern looking for an empty list
condition to finish processing the list I think it would be interesting to
discriminate between those two kinds of lists.

For example, let's define f as:

(de f (L) (print (car L)) (if (<> NIL (cdr L)) (f (cdr L

then f is well defined for NIL ending lists but fails with non-NIL ending
lists




> > but when describing functions ' is a notation mark with a
> > semantic, what is the semantic of dot notation mark when used in formal
> > parameters in function description?
> >
> > I mean, you have these two notations for functions:
> >
> >   -  (dbs+ 'num . lst)
> >
> >   -  (delete 'any 'lst) -> lst
> >
> > are they applied the same? with the same kind of parameters?
>
> The functions behave differently. (dbs+ 'num . lst) means that the the
> function
> takes an unlimited number of arguments, where only the first one is
> evaluated,
> while (delete 'any 'lst) takes two evaluated arguments.


what about these two? are they equivalent?

(f  num   lst) -> num
(g num . lst) -> num


>
> > evaluate to a number and rest of parameters will be bound to Z, so you
> call
> > this function like (dbs+ 4 a b c) ,  what notation will you use to
> express
> > you have to pass a list as parameter to a function?  maybe (dbs+ 'lst) ?
> I
>
> These function definitions say nothing about the types of the arguments
> like
> number, list etc. This is determined by the behavior of the function's
> body.
>
>
of course it's the function body which determines the "type" of parameters,
if the body applies a parameter to a function expecting a number, that
parameter's type must be a number and not a symbol or list or the function
call in the body will fail, but you use a notation for describing functions
just to help users know what kind of parameter you must provide, that's the
reason to use that list of meaningful words, type is not enforced (not
possible) but suggested to user using the function, right?

so a function described as(f  'num 'num)   informs that function f
expects two parameters being numbers and since parameters are evaluated
it's the value what is expected to be numers, so you can call f as (f 1 2)
or (f a b) or even (f (x y z) 3) provided that values of symbols a and b
are numbers and the result of x function call (x y z) returns a number but
sure you cannot call f as (f (1 2)) or (f 'x 4)

>From this point of view my question is about the difference of using or not
using dot when describing a function, for example, take the if description:

(if 'any1 any2 . prg) -> any

Would the description below describe the same function?

(if 'any1 any2 prg) -> any

Even more, having into account notation used for describing functions I
know:

any - Anything: Any data type
prg - Prog-Body: A list of executable expressions (run)

so from description of function "if" which is "Conditional execution: If
the condition any1 evaluates to non-NIL, any2 is evaluated and returned.
Otherwise, prg is executed and the result returned." I undestand the "then"
clause is any2 which gets evaluated when evaluated any1 is T and also it
could be any type of value while prg is the "else" clause being evaluated
only if evaluation of any1 returns NIL and also it is a list of executable
expressions, from this I understand the following is a list of valid and
invalid if function calls:

(if T 3 (print "no")) # valid
(if (< 2 2) 'x (print "yeah"))# valid
(if T 3 4)# invalid because
4 is a number not a prg (a list)
(if NIL (print "then") (print "else") (print "finally"))  # a doubt here,
I think it's invalid because two executable expressions are two lists not
one prg (one list of executable expressions)



prg - Prog-Body: A list of executable expressio

Re: a bunch of questions about syntax

2017-01-27 Thread pd
sorry, I accidentally sent an incomplete message, here's the complete one

On Sat, Jan 28, 2017 at 1:51 AM, pd  wrote:

> Thanks again for your explanations Alex, still some comments...
>
> On Fri, Jan 27, 2017 at 8:16 AM, Alexander Burger 
> wrote:
>
>>
>>
>> BTW, I thought again about the terminology of "list" versus "cons pairs"
>> and
>> plain "cells". "list" is a rather unprecise term, I feel it is not
>> limited to "a
>> chain of cells with NIL at the end". I use "list" for any sequence of
>> cells (as
>> opposed to other structures like "tree", "graph" or "set"). These include
>> also
>> e.g. "circular lists" like (1 2 3 .), which have no NIL at the end (in
>> fact, no
>> end at all).
>>
>
> Ok, so from this point of view every cons pair is a list even those with a
> dotted pair in the tail
>
> But I think it's interesting to distinguish between two different kind of
> lists, those having a NIL symbol in last cell CDR (let's say ending in NIL
> symbol) and with a non NIL in las cell CDR (those ending in a symbol not
> NIL) just because of almost every function dealing with lists assume they
> belong to NIL-ending kind.
>
> I mean, with a NIL ending list you have an empty list condition (NIL) but
> how do you know a non-NIL ending list is empty? and since most functions
> dealing with lists have a recursive pattern looking for an empty list
> condition to finish processing the list I think it would be interesting to
> discriminate between those two kinds of lists.
>
> For example, let's define f as:
>
> (de f (L) (print (car L)) (if (<> NIL (cdr L)) (f (cdr L
>
> then f is well defined for NIL ending lists but fails with non-NIL ending
> lists
>
>
>
>
>> > but when describing functions ' is a notation mark with a
>> > semantic, what is the semantic of dot notation mark when used in formal
>> > parameters in function description?
>> >
>> > I mean, you have these two notations for functions:
>> >
>> >   -  (dbs+ 'num . lst)
>> >
>> >   -  (delete 'any 'lst) -> lst
>> >
>> > are they applied the same? with the same kind of parameters?
>>
>> The functions behave differently. (dbs+ 'num . lst) means that the the
>> function
>> takes an unlimited number of arguments, where only the first one is
>> evaluated,
>> while (delete 'any 'lst) takes two evaluated arguments.
>
>
> what about these two? are they equivalent?
>
> (f  num   lst) -> num
> (g num . lst) -> num
>
>
>>
>> > evaluate to a number and rest of parameters will be bound to Z, so you
>> call
>> > this function like (dbs+ 4 a b c) ,  what notation will you use to
>> express
>> > you have to pass a list as parameter to a function?  maybe (dbs+ 'lst)
>> ? I
>>
>> These function definitions say nothing about the types of the arguments
>> like
>> number, list etc. This is determined by the behavior of the function's
>> body.
>>
>>
> of course it's the function body which determines the "type" of
> parameters, if the body applies a parameter to a function expecting a
> number, that parameter's type must be a number and not a symbol or list or
> the function call in the body will fail, but you use a notation for
> describing functions just to help users know what kind of parameter you
> must provide, that's the reason to use that list of meaningful words, type
> is not enforced (not possible) but suggested to user using the function,
> right?
>
> so a function described as(f  'num 'num)   informs that function f
> expects two parameters being numbers and since parameters are evaluated
> it's the value what is expected to be numers, so you can call f as (f 1 2)
> or (f a b) or even (f (x y z) 3) provided that values of symbols a and b
> are numbers and the result of x function call (x y z) returns a number but
> sure you cannot call f as (f (1 2)) or (f 'x 4)
>
> From this point of view my question is about the difference of using or
> not using dot when describing a function, for example, take the if
> description:
>
> (if 'any1 any2 . prg) -> any
>
> Would the description below describe the same function?
>
> (if 'any1 any2 prg) -> any
>
> Even more, having into account notation used for describing functions I
> know:
>
> any - Anything: Any data type
> prg 

Re: a bunch of questions about syntax

2017-01-28 Thread pd
Thank you Alex for your patience, I see I have a severe confussion about
how picolisp manages lists

let's start by the begining... as far as I know   (f a b 4)  is just a list
equivalent to (f . (a . (b . (4 . NIL  and the fact being also a
function call to function f applying parameters a b 4 is just a matter of
"convention", simply when picolisp evals a list with a first item not being
a number it supposes it's a function call and tries to evaluate first item
(it doesn't matter if first item is a symbol or another list, it gets
evaluated) which is supposed to be evaluated to a function value

With this point of view I understand what you mean when saying  (f 1 a b c)
is just the same as (f 1 . (a b c)) and thus you can view a, b, c as a list
so you can describe this funcion as (f num . 'lst), ok, but also I think
you could describe the function f also as (f . 'lst) . The only difference
is that using the latter you are only interested in remark you pass to f a
sequence of symbols (which form a list) while using the former description
you are interested in remark the first symbol in the sequence is supposed
to be a number and also it is not evaluated.

But if you describe a function like (g num 'lst) is a quite different thing
because you are expecting two arguments the first one being a number and
the second being a list (of unlimited number of items), really all
functions described have an unlimited number of arguments but function g
packs all arguments but the first in a list.

I think I get the point, but what confuses me is when you say

On Sat, Jan 28, 2017 at 8:31 AM, Alexander Burger 
wrote:

> > From this point of view my question is about the difference of using or
> > > not using dot when describing a function, for example, take the if
> > > description:
> > >
> > > (if 'any1 any2 . prg) -> any
> > >
> > > Would the description below describe the same function?
> > >
> > > (if 'any1 any2 prg) -> any
>
> A typical call of 'if' could be
>
>(if (testSomething) (doSomething1) (doSomething2) (doSomething3))
>
> where
>
>any1 is the result of evaluating (testSomething)
>any2 is (doSomething1)
>prg is ((doSomething2) (doSomething3))
>
> Perhaps it helps understanding if we remember that
>
>(if (testSomething) (doSomething1) (doSomething2) (doSomething3))
>
> is the same as
>
>(if (testSomething) (doSomething1) . ((doSomething2) (doSomething3)))
>
>
> If 'if' were specified as in the second case (if 'any1 any2 prg), then we
> would
> need to call it as
>
>(if (testSomething) (doSomething1) ((doSomething2) (doSomething3)))
>
> to match the spec (if 'any1 any2 prg) and get the same bindings.
>
>
but this also means the only way to indicate several executable expressions
in the "then-clause" is to surround them between parens, i.e.  (if (= 2 2)
((print "equal") (print "2")) (print "not equal") (print "not 2"))   I
appreciate here an absence of symmetry, you must pack all exe expressions
in a list for "then-clause" but you can't do it for "else-clause"  [in fact
I think it will fail if you do that in a "then-clause" like (if T 1 ((print
"ups") (print "error"))) ]

why not to define and describe function if in a symmetrical way as   (if
'any prg1 prg2)  even when not obeying parens economy?   (sure there is a
good reason to do it that way simply I'm not able to see)

this way you always write prgs inside a list whatever being in then-clause
or an else-clause   i.e.  (if (> a b) ((print "a greater")) ((print "b
greater or equal")))


>
> > > (if T 3 4)   #
> invalid because 4 is a number not a prg (a list)
>
> Yes, but the prg is (4), not 4.
>

I guess you say that because using the "stack" simil you used in previous
email, when you pop first item it remais (T 3 4) when you pop again it
remains (3 4) and with next pop which remains is (4)

I think my confusion is due to the lack of one more pop to get 4 rather
than (4) , if the answer is "because prg indicates its a list, if you want
to indicate a number you should use num instead" then my confusion is like
this:

- two functions f described this way:

   (f num . lst)
   (f num1 num2)

then the list (f 1 2) is a valid call for both functions, the first f will
bind first parameter to numer 1 and second parameter to list (2) (all
remaining parameters as a list) while the second f will bind 1 to num1 and
2 to num2 (descarding empty list NIL). My confusion here is picolisp must
do two pops to bind parameters for a first f function call but three pops
to bind parameters for a second f function call. How discriminate picolisp
between each cases? I suppose the answer is function definition:

first f defined as (de f (X . Rest) (...) )
second f defined as (de f (X Y) (...) )

is it ok?


thanks a lot and forgive my insistence ;-)


Re: a bunch of questions about syntax

2017-02-01 Thread pd
thanks for your answers, Alex

On Sun, Jan 29, 2017 at 9:48 AM, Alexander Burger 
wrote:

>
> > >(if (testSomething) (doSomething1) (doSomething2) (doSomething3))
> > ...
> > but this also means the only way to indicate several executable
> expressions
> > in the "then-clause" is to surround them between parens, i.e.  (if (= 2
> 2)
> > ((print "equal") (print "2")) (print "not equal") (print "not 2"))   I
>
> No. This gives a crash (try it, and think about why ;).
>


I tried and it crashes with a segmentation fault, I was thinking about what
could be the reason and my guess is it is related with 'eval' function. I
think when the body of "if" function tries to eval the any2 expression it
fails with sementation fault if it is a list of lists, that is, the first
item of any2 expression is a list:

(eval 1)  -> 1
(eval (1)) -> (1)
(eval ((1)))  segmentation fault

My guess is eval tries to evaluate its parameter, thus when being a number
it evaluates to itself and an atom evaluates to its value:

(setq A 1)
(eval A) -> 1
(eval B) --- B is not defined

But when the parameter to evaluate is a list, eval tries to evaluate the
list which means to apply the function call represented by the list, with
special case of lists of numbers

(de f (X) (+ X 1))
(eval (f 1)) -> 2   # eval tries to evaluate the list viewed as a function
call so it applies function f to parameter 2 and gets the returned value as
the result of eval
(eval (1 2)) -> (1 2)  # the same as above but exploiting the special
treatment picolisp give to list of numbers in order to avoid quoting it

The problem appears when you pass eval a list of lists (or a list with a
first item which is also a list), in this case eval tries to evaluate but
doen't know how to eval a item list, it could be a function call because it
is not an atom. Using the analogy of stack when eval gets a simple list it
pops the first item which being an atom means it must be a function name so
two possible cases it's a defined function or it is not defined, if it is
defined but it's not a function but it also fails with segmentation fault
because you cannot apply an atom if it's not a function (and evaluating a
list means it must be a function call  --or a list of numbers--)

(de f (X) (* X X))
(setq A 1)
(eval (f 2)) -> 4
(eval (A 2)) --- segmentation fault
(eval f)  --- X undefined
(eval 'f)  -> ((X) (* X X))
(eval (f)) -> NIL # strangely in this case it doesn't say X undefined but
returns NIL

The problem seems to be only when eval expects an atom to be a function or
an undefined symbol and what it gets is an defined atom which is not a
function symbol:

(eval B) -> NIL
(eval (B)) --- B undefined
(eval (B 1)) --- B undefined
(eval ((B))) --- B undefined
(eval ((B 1))) --- B undefined
(setq B 2)
(eval B) -> 2
(eval (B)) --- segmentation fault
(eval (B 1)) --- segmentation fault
(eval ((B))) --- segmentation fault
(eval ((B 1))) --- segmentation fault

Also eval evaluates recursively the list passed as arguments

(de g (X) (+ X 1))
(de f (X) 'g)
(eval ((f 99) 2 )) -> 3

So my conclusion is eval always expect a list to be a valid function call
(or a list of numbers) and if it is not then fails with segmentation
fault.  And the reason for "if" to fail in a similar way is it tries to
eval the "then-clause" (any2)

If so what I don't understand is why to cause a segmentation fault, I think
it could easily avoid if eval phase in REPL simply detect a first item in a
list being a defined atom but not a function and throw an error (in a
similar way of "not defined" errors in previous examples) or even even
evaluating the atom to its value when it detects it is not a function (even
being the first item in a list).

What I mean is maybe a desiderable behaviour of eval would be:

(setq A 1)
(de f (N) (+ N 1))
(eval A) -> 1
(eval (f 1)) -> 2
(eval (A 2)) --- A is not a function  # case 1, eval knows it is not a
function
(eval (A 2)) -> 1   # case 2, even when it seems a function call since A is
not a function but a defined symbol resolve to its value
(eval ((A))) -> 1  # case 2, but could also be implemented as case 1 too

Is it my reasoning right?  or maybe I'm saying a nonsense?

Anyway I see the segmentation fault messages includes some numbers, are
they anyhow setted by picolisp or are they totally system dependent?

[1]863 segmentation fault  ./pil +
 ^ ^^^
 |__| this numbers


regards


Re: (NIL) vs Nothing

2017-02-02 Thread pd
I think this is not the use you intent

In *my* opinion:

On Thu, Feb 2, 2017 at 3:44 PM, dean  wrote:

>
>(setq Ln_no 0)
>(in Epic_txt_fl_pth
>   (until (eof)
>  (setq Ln_no (inc 'Ln_no) )
>

this is redudant since you're simply incrementing the value of a global
symbol, simply write:   (inc 'Ln_no)


>  (prog
> ​
>

As a general not too exact rule setq creates global value while let creates
a local value

More exactly setq (and set) binds a symbol to a value in the "global
context" while let binds a symbol to a value only inside the let expression


Re: (NIL) vs Nothing

2017-02-03 Thread pd
The reason for this difference is let behaviour:  let binds a symbol to a
value *inside* let expression but first saves values of binding symbols and
once evaluated the expression it restores previous symbols values saved.

So, when you wrap a expression in a let binding you are protecting the
symbols values for further modification, each internal wrapping with let
gives you a layer of protection.

In first version you protect the expression in a let wrapping, the
expression (the let body) may change symbols in any way because after being
evaluated (let's say when exiting let function) the symbol value of symbols
bound by let will be restored to previus value. But *inside* the clause
changes happen!

: (let X 0# let binds symbol X to 0 *inside* let
expression (the following line)
(for Y 3 (inc 'X) (prinl X))  # in this let expression every change to
symbol X takes effect, in particular incrementing it
  )   # after execution of let expression
binding symbols are restored to saved value (in this case without more
information it shoud be NIL)

But in second version you add an extra protection layer to the expression
by wrapping it in a let binding, as always expressions may change symbols
inside let expression but now they are protected by a internal let layer
which "hides changing effects"

: (let X 0  # let binds symbol X to 0 *inside* let expression
(the following lines)
   (for Y 3
  (let X (inc 'X)   # but now you have an extra let protecction layer
which binds X thus protecting it for changes made in inner let expression
by saving current X value (0)
(prinl X)   # this is inner let expression, prints the value of
inner X binding (which is always 1 because is always incrementing 0 by 1 as
we will see)
  ) # at this point let restores value of symbol X to
previous value , which is 0 as set by outer let binding
   )# so each step of for loop symbol X has value 0
(because is setted by outer let and restored by inner let) and thus get
incremeted to 1
  )

So as you can see let is used to isolate actions without affecting current
symbol values, you can think of it as "hiding actions"  You can think about
it in terms of lambda applications which may be easier to understand (if
you're interested let me know ;-)

As picolisp seem not to have a let* like in classical lisp I assume let
bindings are done in parallel as traditionally let behaves in classical
lisp, sure Alex can state it clearly


On Thu, Feb 2, 2017 at 7:20 PM, dean  wrote:

> Just to illustrate what I meant...
> : (let X 0
>(for Y 3
>   (let X (inc 'X) (prinl X
> 1
> 1
> 1
> -> 1
>
> On 2 February 2017 at 18:16, dean  wrote:
>
>> Thank you very much for the adviceI've just used that and it's worked
>> a treat
>>
>> : (let X 0
>>   (for Y 3
>>  (inc 'X) (prinl X)))
>> 1
>> 2
>> 3
>> -> 3
>>
>

-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


binding free symbols in a lambda definition

2017-02-07 Thread pd
Hello,

I wonder if there is any way to bind a free symbol in a lambda in order to
pass the lambda to a defined function (for example)

What I want to do is something like this:

(de myf (f l) (f l))

(let l 99 (myf '((x) (+ (car x) l)) (1 2)))

I want it to return 100 but it fails with an error (1 2) number expected

this is because free symbol l in lambda ((x) (+ (car x) l)) is not bind by
let as pretended because of quoting of lambda

In other words, I think the problem is quoting avoids let binding as in:

(setq f (let n 10 '((x) (+ x n -> ((x) (+ x n))

but I want it to return -> ((x) (+ x 10))

or using the typicall example:

(de adder (n) '((x) (+ x n)))  ->  ((n) '((x) (+ x n)))

so (adder 1) should return ((x) (+ x 1)) but it returns ((x) (+ x n))

Is there any way to manage this?  Something similar to "expand" in newlisp
will do the job:

newlisp:
   (define (badadder n) (lambda (x) (+ x n)))
   (badadder 3) -> (lambda (x) (+ x n))
   (define (adder n) (expand (lambda (x) (+ x n)) 'n))
   (adder 3) -> (lambda (x) (+ x 3))

The fist example in newlisp will be:

(define (myf f l) (f l))

(let ((l 99)) (myf (lambda (x) (+ (first x) l)) '(1 2)))

which fails for same reason picolisp fails but in newlisp the solution is:

(define (myf f l) (f l))

(let ((l 99)) (myf (expand (lambda (x) (+ (first x) l)) 'l) '(1 2)))  -> 100


thanks


Re: binding free symbols in a lambda definition

2017-02-08 Thread pd
On Wed, Feb 8, 2017 at 7:15 AM, Lindsay John Lawrence <
lawrence.lindsayj...@gmail.com> wrote:

> 'fill' (http://software-lab.de/doc/refF.html#fill) does the job in some
> cases as well and is a bit easier to read...
>
> : (de adder (N) (let @X N (fill '((x) (+ x @X)
> -> adder
>
>
this is a solution very similar to newlisp style, and probably  fill  is
the most similar function to newlisp's  expand (and curry being the second
most similar ;)

But I feel more comfortable with the other you provided

: (de adder (N) (list '(x) (list '+ 'x (eval 'N

because I feel more in control of generated lambda

thanks!


Re: binding free symbols in a lambda definition

2017-02-08 Thread pd
On Wed, Feb 8, 2017 at 5:37 AM, Erik Gustafson 
wrote:

> I think 'curry' is what you're looking for. Your 'adder' example could be
> written as:
>
>: (de adder (@N) (curry (@N) (X) (+ X @N)))
>-> adder
>: (adder 3)
>-> ((X) (+ X 3))
>: (doc 'curry)  # for more info  :)
>
> Hope that helps,
> Erik
>
>
this does the job and is exactly what I was looking for  (together with the
fill solution pointed afterwards)  but I feel uncomfortable with the use of
curry here due to my functional programming background...

*I feel* curry to be a unfortunate name for that function because I expect
curry to be a function that once applied to another function with n
parameters it returns a chain of applying functions with exactly one
argument, that is having:

: (de sum (x y) (+ x y))

I expect a function named curry to behave this way:

(curry 'sum) -> ((x) '((y) (+ x y)))# it is really pseudocode not
actually picolisp code since returning a lambda quoted this way won't do
the job

or in classical lisp notation:

(curry 'sum) -> (lambda (x) (lambda (y) (+ x y)))

in a way you now can apply the curryfied sum partially:   ((curry 'sum) 2)
-> ((y) (+ 2 y))  or  totally:  ((curry 'sum) 3 4) -> 7

But picolisp curry function doesn't do that, it simply returns a lambda
with 1 parameter having the other one properly substituted with its value
thus making impossible to partially apply the returned function

Is there anyway in picolisp to reproduce the functional curry behaviour?
that's a sequence of lambdas allowing partial application


Re: binding free symbols in a lambda definition

2017-02-08 Thread pd
Hi Alex

> The key there is the back-quote (`) before the L to force evaluation
> > See the doc section on 'Read-Macros'
> > http://software-lab.de/doc/ref.html#macro-io
>
> Exactly. So the whole 'let' expression is read, *then* evaluated. 'L' is
> what it
> was globally at the time this expression was read, usually NIL.
>
>
If I understand correctly what you said the reason for  (let K 3 '(print
`K)) returning (print NIL)  rather than (print 3)  [being K not previously
defined]  is that the sequence of steps is:

1- read the whole let expression , here (let K 3 '(print `K))
2- evaluate the whole let expression resulting in  (let K 3 '(print NIL))
since the evaluation of K returns NIL in this context because K is not
defined
3- evaluate the "let prog" in the context stated by let bindings, thus
evaluates '(print NIL) in a context where K is bound to 3, but obviously K
is not used in the "let prog"

is it that way?

if so, would be hard to make the jump over step 2? that is making the quote
protecting the whole expression and evaluating the read-macro ` only in
step 3 when the expression is evaluated under symbol bindings stablished by
let?maybe I'm saying nosense, sorry in advance! ;-)


Re: binding free symbols in a lambda definition

2017-02-08 Thread pd
Thanks for your replies, I think your "subst" is exactly the same to
newlisp "expand"

But picolisp curry function doesn't do that, it simply returns a lambda
> with 1 parameter having the other one properly substituted with its value
> thus making impossible to partially apply the returned function
>
>
> I still think 'curry' is what you want.
>
>
> As far as partial application, wasn't 'adder' an example of that?
>
>: (adder 3)
>-> ((X) (+ X 3))  # partial application
>: ((adder 3) 7)   # used as function call
>-> 10
>
>
yes, adder is an example of partial & total application but now we're
talking about the result of using curry (here the adder function) which
allows partial application.

But when talking about the curry function itself the problem is the domain
of function, in classical curry the domain are functions of n arguments
(usually n>1) and the image are also functions with exactly 1 argument.

Picolisp curry function does not follow the pattern, its domain is
completely different and also its image. In other words, you call classical
curry passing it a function argument but you call picolisp curry passing it
several arguments to replace certain symbols inside expressions. It's a
different kind of animal ;-)

So you cannot apply picolisp curry to any general function, as you do in
classical curry, you must create a picolisp curry call ad hoc to get a
expected function returned

With a classical curry function you can use (call 'f) to get a curryfied
version of function f which takes only one argument and returns a function
who takes only one argument and returns a function who... (supposing f has
n arguments you have n levels on "indirection"), with picolisp curry you
cannot call it like (call 'f) being f a general function (defined with de)

The classical curry in picolisp is what Alex has defined a few emails
before ;-)



> I'm not sure that a structure such as
>
>((X) '((Y) (+ X Y)))
>
> would be very useful in PL, though it could certainly be built with our
> friends 'fill' or 'macro'. But I'm also not sure I understood your question
> entirely.
>
> What that helpful at all?
>
>
>
Absolutely unuseful in picolisp, what I tried to express is the concept of
functions returning functions characteristic of curryfied functions in
picolisp syntax.

The reason for this expression being completely useless in picolisp *I
think* is the use of quote as an alias for lambda thus in practise
protecting them from evaluation and binding





-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


Re: binding free symbols in a lambda definition

2017-02-08 Thread pd
Hi Alex

> The classical curry in picolisp is what Alex has defined a few emails
> > before ;-)
>
> I never saw a use for the classical curry, so I (ab)used this catchy name
> :)
>
> Can you give an example where it is useful in PicoLisp?
>

I'm a newbie to picolisp I don't know enough picolisp to state what is
useful or not.

But curryfied functions are very useful in a lot of situations like
processing lists like mapping (mapcar),  folding...
They are also very useful in function composition which in turn is useful
again in list mapping and so on and also to define functions easier and
clearly
And also thery are useful in defining functons in terms of another
functions in a clear, comprehensive and sucint way.

Considering curry defined as Alex's ClassiCurry in terms of picolisp (let's
call it curri here)

  (de curri (Fun)
  (let Par (list (caar Fun))
 (list Par
(cons 'curry Par (cdar Fun) (cdr Fun)) ) ) )

For example, consider a function like this:

(de task (Action A B) (Action A B))

and you provide a bunch of functions as interface to the previous one:

(de plus (A B) (task + A B))
(de minus (A B) (task - A B))
(de power (A B) (task ** A B))
..

with curry (really here curri) you can better define the interface
functions as:

(setq plus ((curri task) +))
(setq minus ((curri task) -))
(setq power ((curri task) **))
..

this way is shorter, clearer and less error-prone and easy to mantain
because if signature of function task changes the interface functions are
not affected at all (provided the first arg continues to be the action)

Also curry functions and partial application are useful to process elements
of a list with functions with many arguments, like

(mapcar ((curri **) 2)  (2 3 4))# equivalent to (mapcar
'((X) (** 2 X)) (2 3 4))

(setq lstLen ((curri mapcar) length))   # equivalent to (de lstLen
(lst) (mapcar length lst))
(lstLen '((1) (2 3 4) (2 3)))
(((curri mapcar) length) '((1) (2 3 4) (2 3)))  # equivalent to (mapcar
'((L) (length L)) '((1) (2 3 4) (2 3)))


>
> > >((X) '((Y) (+ X Y)))
> > ...
> > The reason for this expression being completely useless in picolisp *I
> > think* is the use of quote as an alias for lambda thus in practise
> > protecting them from evaluation and binding
>
> This is not the reason. Quote and lambda are abselutely equivalent here.
>
> You could do
>
>(setq lambda quote)
>
> and then
>
>   ((X) (lambda (Y) (+ X Y)))
>
>
I know that, but I pretend to mean another thing, sadly without clarity


and have the same result, i.e. a function returning ((Y) (+ X Y)), which is
> a
> correct, legal PicoLisp function accepting an single parameter Y and
> returning a
> sum. The quote (or lambda) is gone immediately when returning this
> function.
>
> It may seem useless to you because PicoLisp uses dynamic binding (X is
> evaluated
> when this function *runs*), but you expected static binding (X is bound to
> the
> value from the environment when this function is *built*).
>
> The latter is done in the 'classiCurry' example in my last mail using the
> PioLisp 'curry'.
>

yes, I have to study your classiCurry function to clearly understand how it
works and yes maybe I'm a bit confused about dynamic binding usefulness due
to my static binding background

But let me try to better explain myself...

Writing this code:

(let N 4 (print N))

binds symbol N to value 4 inside print expression and so it prints 4, this
is what we expect of let binding behaviour

same for this code:

(let N 4 (+ 1 N))

we expect to return 5

In a coherent way we expect this code:

(let N 4 ((X) (+ X N)))  # erroneus code, I know it!

to return a function which adds 4 to its parameter   (and it would do it if
it doesn't throw a X undefined error)

But here the problem is we cannot write an anonymous function (a lambda)
this way, we *must* quote it:

(let N 4 '((X) (+ X N)))

but now the quoting has the effect of not evaluating the lambda and thus
preserving it from let symbol binding, this is an undesiderable effect in
my opinion

So how to avoid this undesiderable side effect?  well, first, we have to
kow why it happens, i.e why we must quote the lambda? the answer to protect
it from calling

Calling is what happen to a function when its evaluated, so when let
expression is evaluated, eval see its a function and calls it but it finds
it needs one argument and there's none
so fails with X undefined error, the solution to avoid calling the function
is just avoid evaluating the function and thus the need of quotation with
the bad side effect we've just seen

So what to do? (from here I'm just reasoning loud) well, the key is to
separate function evaluation from function calling, what if there would be
a mark for type function?
in a way the steps in let expression evaluation were similar to this:

1- read the whole let expression
2- read-macros get executed inmmediately (really I think this is part of
step 1)
3- perform the bindings in "let

Re: binding free symbols in a lambda definition

2017-02-09 Thread pd
Sorry for the large email and even while pretending to be a clarifying text
it is not :(

Also don't want to give an image of pretending to arrange picolisp's flaw
design, it is absolutely not, not only I don't have the needed
understanding of picolisp nor the knowledge to do so but I consider
picolisp a pretty good design with very smart decisions. What I trying to
do is speaking out loud spreading out my thoughts to see if my
understanding is right and also to see if my ideas may be useful somehow or
must be considered as nonsenses

On Thu, Feb 9, 2017 at 2:17 AM, pd  wrote:

>
>
> But let me try to better explain myself...
>
>


Re: box? on address

2017-02-09 Thread pd
On Thu, Feb 9, 2017 at 6:13 PM, Christopher Howard  wrote:

> Hi, I was just trying to understand...
>
> : (box? (box (4 5 6)))
> -> $384375304
> : (box? $384375304)
> -> NIL
> : (car $384375304)
> -> 4
>
> Shouldn't (box? $384375304) be non-NIL?
>

As Danilo said box? evaluates its arguments and that's the reason to return
NIL because a list is not an anonymous symbol

The same happens with the call to car, car evaluates its arguments so you
get the car of the list

To allow box? to deal with anonymous symbol you must quote it

If you type the $-number representing the anonymous symbol in the pil
prompt you see its value, in your case:

: $384375304
-> (4 5 6)

The result of evaluating the anonymous symbols and that explains the
behaviour of your calls to both box? and car,

: (car $384375304)# = (car (4 5 6))
-> 4

but what if you call car with real anonymous symbol (quoting it to prevent
evaluation)?

: (car '$384375304)
-> (4 5 6)

why? my guess is anonymous symbols store its value in the car of its cell


Re: box? on address

2017-02-10 Thread pd
Hi Danilo


Isn't [doc 'car] clear enough?
>

clear as an unmuddied lake ;-)   doc should be read because reading it
makes guessing innecesary ;-)


>
> Please take a quick look at [path "@doc64/structures"] and
> source code of `car' and `val'.
>
> I am not sure what will happen if GC bit is 1.
>

I'll do, very interesting documentet!


Re: conc: unexpected results

2017-02-10 Thread pd
On Fri, Feb 10, 2017 at 6:47 AM, Lindsay John Lawrence <
lawrence.lindsayj...@gmail.com> wrote:

>
> Apologies for bothering everyone with this. It took some research (there
> is surprising little discussion of the function online or even in most
> books), but I at least understand how it works now.
>

It would be great if you explain how it works, at least for me since I
cannot understand why 2. returns NIL rather than (A)


Re: Future of PicoLisp?

2017-02-23 Thread pd
On Fri, Feb 24, 2017 at 1:14 AM, Erik Gustafson 
wrote:

>
>
> 'Learn PicoLisp the Hard Way'
>
> What do you think?
>

I think it's a terrific idea and I'm volunteer to work on it



>
>
> Let's build picolisp.com from scratch. Still in written in PicoLisp, duh!
> Make it a simple, beautiful, modern, responsive home page. And only a home
> page. Something like what I had in mind here, but better:
>
> https://github.com/erdg/picolisp-website
>
> (that is sooo late 2015, lol)
>
> So a simple landing page that introduces the language and loudly points to
> our new book, 'Learn PicoLisp the Hard Way'. Then we transition the
> documentation to GitHub and Stack Overflow, so the whole internet can be
> impressed by how active our community is.
>
> And let's make sure said landing page is served over HTTPS. It's 2017.
>
>
I also think it's a great idea since I think picolisp has a strong strength
in web developing but just because it's 2017 I feel the effort must be put
in integrating picolisp with web (W3C) technologies (css, html 5, xml,
websockets...) and also javascript (json, frameworks, ...)

So what if building picolisp.com from sacratch with presentation done by
CSS javascript framework like jquery and/or bootstrap and content made
compatible with html5 using websockets and json to make an api rest
available for example to communicate with picolisp repl ?

It would be great also to deploy the web in apache or nginx (even lighttpd
or cherokee) to documentate how to integrate picolisp in a corporative
environmet. It would be useful too to use also picolisp as webserver
(httpgate) and show how to scale it up.

I'm volunteer to this too ;-)

-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


Re: PilMCU status

2017-04-18 Thread pd
On Tue, Apr 18, 2017 at 12:03 PM, Joh-Tob Schäg  wrote:

> If you are still searching an FPGA board you might want to get in contact
> with j-core.org
> They build an open source processor and are developing an RasPi form
> factor compatible FPGA board.
>
>
you may be also interested in icezum alhambra a lattice iCE40HX1K-TQ144

based development board with open source toolchain

https://github.com/bqlabs/icezum

-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


building picolisp in mobaxterm (cygwin)

2017-06-13 Thread pd
Hi,

I've tried to build picolisp in mobaxterm (a terminal program including
cygwin preinstalled) but I have a bunch of errors about foking and dll's
loading in different memory address

 ➤ make
  0 [main] make 14124 child_info_fork::abort:
C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
Loaded to different address: parent(0x6C) != child(0xDC)
make: Makefile:38: fork: Resource temporarily unavailable
  0 [main] make 852 child_info_fork::abort:
C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
Loaded to different address: parent(0x6C) != child(0xE4)
make: Makefile:58: fork: Resource temporarily unavailable
  0 [main] make 8692 child_info_fork::abort:
C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
Loaded to different address: parent(0x6C) != child(0x70)
make: Makefile:67: fork: Resource temporarily unavailable
  0 [main] make 11008 child_info_fork::abort:
C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
Loaded to different address: parent(0x6C) != child(0xE6)
make: Makefile:76: fork: Resource temporarily unavailable
  0 [main] make 5924 child_info_fork::abort:
C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
Loaded to different address: parent(0x6C) != child(0xE4)
make: Makefile:94: fork: Resource temporarily unavailable
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer
-fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
-Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -D_FILE_OFFSET_BITS=64
-D_OS='"Windows_NT"' subr.c
  0 [main] make 14792 child_info_fork::abort:
C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
Loaded to different address: parent(0x6C) != child(0xE4)
make: fork: Resource temporarily unavailable


anyone have tried to build with mobaxterm or cygwin and had similar
problems?

regards

-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


Re: building picolisp in mobaxterm (cygwin)

2017-06-13 Thread pd
PERSIS~1\slash\bin\cyggmp-10.dll:
Loaded to different address: parent(0xE3) != child(0x6C)
make: Makefile:128: fork: Resource temporarily unavailable
cc -o sysdefs -D_FILE_OFFSET_BITS=64 sysdefs.c
  0 [main] make 7520 child_info_fork::abort:
C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
Loaded to different address: parent(0xE3) != child(0xE5)
make: fork: Resource temporarily unavailable


On Tue, Jun 13, 2017 at 9:49 PM, Joe Bogner  wrote:

> Hi pd, yes, this is a common issue with cygwin and fork.
>
> Are you on a 64-bit bit PC? If so, I have an experimental version of
> PicoLisp on 64-bit that might be useful - https://github.com/joebo/
> picoLisp-win-x86-64
>
> I can elaborate if so
>
> On Tue, Jun 13, 2017 at 3:22 PM, pd  wrote:
>
>> Hi,
>>
>> I've tried to build picolisp in mobaxterm (a terminal program including
>> cygwin preinstalled) but I have a bunch of errors about foking and dll's
>> loading in different memory address
>>
>>  ➤ make
>>   0 [main] make 14124 child_info_fork::abort:
>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
>> Loaded to different address: parent(0x6C) != child(0xDC)
>> make: Makefile:38: fork: Resource temporarily unavailable
>>   0 [main] make 852 child_info_fork::abort:
>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
>> Loaded to different address: parent(0x6C) != child(0xE4)
>> make: Makefile:58: fork: Resource temporarily unavailable
>>   0 [main] make 8692 child_info_fork::abort:
>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
>> Loaded to different address: parent(0x6C) != child(0x70)
>> make: Makefile:67: fork: Resource temporarily unavailable
>>   0 [main] make 11008 child_info_fork::abort:
>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
>> Loaded to different address: parent(0x6C) != child(0xE6)
>> make: Makefile:76: fork: Resource temporarily unavailable
>>   0 [main] make 5924 child_info_fork::abort:
>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
>> Loaded to different address: parent(0x6C) != child(0xE4)
>> make: Makefile:94: fork: Resource temporarily unavailable
>> gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer
>> -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
>> -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -D_FILE_OFFSET_BITS=64
>> -D_OS='"Windows_NT"' subr.c
>>   0 [main] make 14792 child_info_fork::abort:
>> C:\Users\jose\DOWNLO~1\jose\PROGRA~2\MOBAXT~1\PERSIS~1\slash\bin\cyggmp-10.dll:
>> Loaded to different address: parent(0x6C) != child(0xE4)
>> make: fork: Resource temporarily unavailable
>>
>>
>> anyone have tried to build with mobaxterm or cygwin and had similar
>> problems?
>>
>> regards
>>
>> --
>> Andrés
>>
>> *~ La mejor manera de librarse de la tentación es caer en ella**. ~
>> Oscar Wilde* ~
>>
>
>


-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


Re: Announce: PilBox - Building Android Apps in PicoLisp

2017-09-20 Thread pd
should be possible to interface with native android code?  I suppose it
would be similar to interface with java in common picolisp. The goal would
be to have native app rather than web apps inside an html content

On Wed, Sep 20, 2017 at 10:22 AM, O.Hamann  wrote:

> Hello,
>
> short update:
>
> on dtek50/Android 6.01 Pilbox works as expected, I think (though I did not
> go through all demo buttons).
>
> Don't know, why this did not work yesterday, possibly a system update was
> interfering while trying Pilbox. I did not change anything, just after
> restart of the mobile, the Pilbox worked as expected.
>
> On sm-t719/android 7.0 I see no chance to share (german ui: 'senden') the
> zip file to Pilbox because Pilbox is not listed in the 'shares' (german ui:
> 'Freigabe') dialog box, as other Apps like Termux, TotalCommander and
> others do.
>
> Hopefully other users may report successfull runs of Pilbox on Android7.
>
> Or is it possible, that the Android way of handling files differs from
> former releases to version 7 ?
>
> By the way, nice hint of Pilbox when running on SM-T705/Android 5.0.2 :-)
> (which is armv7, while armv8 is required by the App)
>
>
> Back to the working Pilbox App:
>
> it is - like always when dealing with picolisp -  again amazing how to
> build functional screens with such few lines of code, as shown in the .l
> files of demo.zip.
>
> Thank you again, Alex, for continously bringing picolisp into new areas of
> use.
>
>
> Greetings, Olaf
>
>
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>



-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


Re: Announce: PilBox - Building Android Apps in PicoLisp

2017-09-22 Thread pd
I've created a github repository in https://github.com/pepdiz/pilbox  and I
can keep it synchronized to PilBox.tgz versions if you want

regards

On Thu, Sep 21, 2017 at 1:02 PM, Alexander Burger 
wrote:

> On Thu, Sep 21, 2017 at 12:43:02PM +0200, Richard Z wrote:
> > assuming it is OpenSource, how about submitting to f-droid.org?
>
> This would be a good thing. F-Droid requires a git repo, perhaps of our
> maintainers likes to take care of it? It would follow the same principles
> as we
> have with the PicoLisp releases, i.e. importing the rolling release from
> https://software-lab.de/PilBox.tgz
>
> ♪♫ Alex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>



-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


Re: Announce: PilBox - Building Android Apps in PicoLisp

2017-09-22 Thread pd
Yes, I'll try and will post here my experience in order to help with any
trouble.

I saw a message from you talking about not including arm binaries but in
last tgz I got there's a binary include, should I remove it?

On Sat, Sep 23, 2017 at 8:32 AM, Alexander Burger 
wrote:

> On Sat, Sep 23, 2017 at 08:06:44AM +0200, pd wrote:
> > I've created a github repository in https://github.com/pepdiz/pilbox
> and I
> > can keep it synchronized to PilBox.tgz versions if you want
>
> Yes, that would be nice!
>
> The next task would be to publish it ad F-Droid. I haven't studied the
> requirements in detail. Not sure what is needed. Would you try that too?
>
> ♪♫ Alex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>



-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


Re: Why does the below code return NIL instead of 2nd & 1st list element?

2018-01-14 Thread pd
El 14/01/2018 03:30, "PositronPro" 
escribió:
>
>
> Hi, all
>
> I want the below code to return
> 2nd & 1st list element from the argument provided to the describe-path
function but it returns NIL in their place.

Do you want your function to return just 2nd & 1st of the parameter list
(maybe as a list) or the full text list with 3nd & 1st elements of passed
list inserted in between the text?

> (de describe-path (Path)
> '(1st text `(cadr Path) 2nd text `(car Path) 3rd text.) )

Up to my understanding your function defined that way should return a
literal list because you're quoting,  it returns:

(1st text `(cadr Path) 2nd text `(car Path) 3rd text.)

Whatever being the argument you pass

> #run the function
> (describe-path '(first second third))
> -> 1st text NIL 2nd text NIL 3rd text
> #output has NIL?

I don't know why it returns such a NIL value  it should return always the
same and so does common lisp

(describe-path '(first second third))
-> (1st text `(cadr Path) 2nd text `(car Path) 3rd text.)
(describe-path 'D)
-> (1st text `(cadr Path) 2nd text `(car Path) 3rd text.)

maybe picolisp has a kind of ` reader macro that expands when reading text
and thus evaluates `(cadr Path) in an environment where parameter Path is
not yet defined and thus yields to nil

Sure Alex can explain in order we all learn a bit more ;)

>
> But below code works fine
> (setq newList '(1st 2nd 3rd))
> '(some text `(car newList) more text `(cadr newList) end text)
> -> some text 1st more text 2nd end text
Again this not work that way in common lisp so I pretty sure in picolisp `
is a reader macro who expands while reading and evaluates the expression.
That's the reason for this to work in REPL where newList is defined when
calling ` macro but not inside a function where the parameter is not
defining at the time of ` macro expansion

>
> The describe-path function is a rough translation of the code below
>
> (defun describe-path (path) `(there is a ,(second path) going ,(first
path) from here -))

This function has nothing in common with previous one.

In your previous function you returned a quoted (') list so everything
within is unevaluated

But this function returns a quasiquoted (`) list which is a completely
different thing, it returns a quoting list (thus unevaluated) BUT
evaluating expressions preceding by ,

So this second function evaluates the call to functions second and first
yielding the desired result

So if you want to achieve the behavior of last function you should define
it that way:

(de describe-path (Path)
`(1st text ,(cadr Path) 2nd text ,(car Path) 3rd text.) )

>
> Some help will be appreciated.
> Thanks in advance.


Re: Why does the below code return NIL instead of 2nd & 1st list element?

2018-01-14 Thread pd
El 14/01/2018 09:53, "pd"  escribió:
>
> So if you want to achieve the behavior of last function you should define
it that way:
>
> (de describe-path (Path)
> `(1st text ,(cadr Path) 2nd text ,(car Path) 3rd text.) )
>

The problem with this definition is that, if ` macro works as I suppose, it
won't work because ` macro expansion happens at 'function definition time'
when Path argument has no value rather than at 'function calling time' when
parameter Path will have a value (hopefully)

The solution is a work around:

(de describe-path (Path)
  (list '1st 'text (car Path) '2nd 'text (cadr Path) '3rd 'text.) )


Re: Why does the below code return NIL instead of 2nd & 1st list element?

2018-01-14 Thread pd
El 14/01/2018 10:02, "Alexander Burger"  escribió:
>
> Then the equivalent of a backquote in other Lisp is 'fill':
>
> (de describe-path (Path)
>(fill
>   '(1st text ^(list (cadr Path)) 2nd text ^(list (car Path)) 3rd
text.) ) )
>

If fill and ^ are the equivalent of backquote and , in other lisp, why is
necessary the call to list inside? Why not:

(de describe-path (Path)
   (fill
  '(1st text ^(cadr Path) 2nd text ^(car Path) 3rd text.) ) )

> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Unsubscribe

2018-04-26 Thread pd
if the problem is you cannot run picolisp in linux maybe you can try flinux
(https://github.com/wishstudio/flinux), whith it you can run linux software
without recompiling or porting to linux.

if that doesn't work you can still recompile picolisp using mingw or cygwin

On Thu, Apr 26, 2018 at 5:50 PM, Arie van Wingerden 
wrote:

> Hi all,
>
> After dabbling in PicoLisp in Windows I decided that it was a bit too much
> of a hassle (because of Windows).
> Switching to Linux is currently not an option for me.
>
> PicoLisp itself is a very good, non bloated language with fenomenal
> potential!
>
> I really hope there will be binary native Windows builds for Windows
> available, to ease usage for a wider community.
>
> Sometimes I dream of a few people working together on a fresh language
> with all those features really cross platform (so, also Android / IOS
> Chrome book), including DB and GUI. I am thinking of:
> - Arthur Whitney, the creator of the Q language and KDB+ from KX Systems
> - Nenad Rakocevic of the Red language (together with Carl Sassenrath,
> creator of Rebol)
> - Alexander Burger, creator of Picolisp
> But I guess that would be a dream only ...
>
> Keep up the (very) good work Alex!
>
> Bye,
>Arie
>


Re: GitHub sold out to Microsoft

2018-06-05 Thread pd
Best alternative probably is gitlab which is free and git based

Anyway there's no reason to change right now because github already was
non-free and closed so there's nothing new with MS, just a closed company
swapping. If github was good before it could be good now. Just sit down to
see what MS is planning

El Mar 05/06/2018, 8:45, Nehal  escribió:

> Dear PicoLisp programmers,
>
> Just see attached news of GitHub been sold out to Microsoft. Being former
> FSF licensing intern I strongly believe we now need to look forward to
> another free code hosting platform in order to keep our projects,
> especially PicoLisp source files free and open Source in its true spirit
> and not be under umbrella of proprietary firms that are not true to spirit
> of FOSS.
>
> There is an urgent need to ponder on this and take a strong decision to
> move stuff from GitHub altogether. Mercurial (
> https://en.m.wikipedia.org/wiki/Mercurial), GNU Savannah (
> https://en.m.wikipedia.org/wiki/GNU_Savannah) may be other alternatives!
>
> Regards,
> Nehal
>
> सा विद्या या विमुक्तये
>


Re: GitHub sold out to Microsoft

2018-06-05 Thread pd
you can install gitlab in your own cloud ;-)

On Tue, Jun 5, 2018 at 10:03 AM, Alexander Sharihin 
wrote:

> Hello!
>
> GitLab works on Microsoft's Azure Cloud.
>
> As I know picolisp developed without using github nor gitlab.
>
> If you care about freedom use only self-hosted solutions(I'm using just a
> ssh-server and user named git with simple diy repo creating tool).
>
> 2018-06-05 9:52 GMT+03:00 pd :
>
>> Best alternative probably is gitlab which is free and git based
>>
>> Anyway there's no reason to change right now because github already was
>> non-free and closed so there's nothing new with MS, just a closed company
>> swapping. If github was good before it could be good now Just sit down to
>> see what MS is planning
>>
>> El Mar 05/06/2018, 8:45, Nehal  escribió:
>>
>>> Dear PicoLisp programmers,
>>>
>>> Just see attached news of GitHub been sold out to Microsoft. Being
>>> former FSF licensing intern I strongly believe we now need to look forward
>>> to another free code hosting platform in order to keep our projects,
>>> especially PicoLisp source files free and open Source in its true spirit
>>> and not be under umbrella of proprietary firms that are not true to spirit
>>> of FOSS.
>>>
>>> There is an urgent need to ponder on this and take a strong decision to
>>> move stuff from GitHub altogether. Mercurial (
>>> https://en.m.wikipedia.org/wiki/Mercurial), GNU Savannah (
>>> https://en.m.wikipedia.org/wiki/GNU_Savannah) may be other
>>> alternatives!
>>>
>>> Regards,
>>> Nehal
>>>
>>> सा विद्या या विमुक्तये
>>>
>>
>


Re: GitHub sold out to Microsoft

2018-06-06 Thread pd
the problem with self hosting is rising costs and risk, you assume the
maintenance of the whole system and the cost of keeping it alive while a
platform perform those tasks for you so IMHO is better to go for a FS
platform and company if that is important too

A platform with a big infrastructure will always be better for users than a
shelf hosting in a personal machine

Anyway my initial point is Github always was a closed company, so if that
was not a problem in the past it should not be now under MS umbrella, we're
standing at the same place


On Wed, Jun 6, 2018 at 8:25 AM, Alexander Williams 
wrote:

> I agree with Alexander Sharihin. The only/best option is self-hosted.
> "Other platforms" is just moving "the problem" from X to Y.
>
> I've also got a custom diy repo cloning tool, which generates a nice
> HTML page. It didn't take long to write (in PicoLisp, of course), so
> perhaps it's a good way for others to exercise their pil-coding-muscles ;)
>
>
> AW
>
> On 06/05/2018 08:03 AM, Alexander Sharihin wrote:
> > Hello!
> >
> > GitLab works on Microsoft's Azure Cloud.
> >
> > As I know picolisp developed without using github nor gitlab.
> >
> > If you care about freedom use only self-hosted solutions(I'm using just a
> > ssh-server and user named git with simple diy repo creating tool).
> >
> > 2018-06-05 9:52 GMT+03:00 pd :
> >
> >> Best alternative probably is gitlab which is free and git based
> >>
> >> Anyway there's no reason to change right now because github already was
> >> non-free and closed so there's nothing new with MS, just a closed
> company
> >> swapping. If github was good before it could be good now Just sit down
> to
> >> see what MS is planning
> >>
> >> El Mar 05/06/2018, 8:45, Nehal  escribió:
> >>
> >>> Dear PicoLisp programmers,
> >>>
> >>> Just see attached news of GitHub been sold out to Microsoft. Being
> former
> >>> FSF licensing intern I strongly believe we now need to look forward to
> >>> another free code hosting platform in order to keep our projects,
> >>> especially PicoLisp source files free and open Source in its true
> spirit
> >>> and not be under umbrella of proprietary firms that are not true to
> spirit
> >>> of FOSS.
> >>>
> >>> There is an urgent need to ponder on this and take a strong decision to
> >>> move stuff from GitHub altogether. Mercurial (
> https://en.m.wikipedia.org/
> >>> wiki/Mercurial), GNU Savannah (https://en.m.wikipedia.org/
> >>> wiki/GNU_Savannah) may be other alternatives!
> >>>
> >>> Regards,
> >>> Nehal
> >>>
> >>> सा विद्या या विमुक्तये
> >>>
> >>
> >
>
>


Re: pgint.l

2019-01-16 Thread pd
Thanks for your great job

In my opinion:

> 1) should I use PostgreSQL error codes and throw exceptions based on
them? So you could probably write:
>
> (catch 'PGintegrityError ...)
> (catch 'PGconstraintError ...)

You should.

It's a good practice to handle exceptions and this allow developers to
control what happens and made robust soft

> 2) probably I have to extract pg types <-> pico types translation to some
kind of abstract table to support extensibility? So devs could add their
own types to translation table without encoding-decoding by hand.

I think it should be a nice feature but maybe not required


Re: PicoLisp for 9-11 years' kids

2019-04-14 Thread pd
I'm aware of the existence of a project based in picolisp and focused on
education and learning children, I remember it was developed by french
people but can't remember any name

That Project had a web, a web based editor to type code and execute it and
also graphic capabilities

I cannot remember if I Heard about it here in this list or surfing the web,
sorry

On Sun, Apr 14, 2019 at 3:11 PM Alexander Burger 
wrote:

> Hi Nehal,
>
> > Discussion over IRC is a good idea. What time will be best?
>
> I think almost any time is good, as there are usually members from east
> Asia
> over Europe till the Amerikas.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: PicoLisp for 9-11 years' kids

2019-04-15 Thread pd
On Sun, Apr 14, 2019 at 8:08 PM cilz  wrote:

> Hello folks,
>
> I guess it's microAlg which you can find here:
>
> http://microalg.info/
>
> I' dont know if there is an english translation of the website which is
> french.
>
>
yes, that it is.  A very interesting project specially for education


Re: PicoLisp for 9-11 years' kids

2019-04-16 Thread pd
Hi Christophe,  lot of thanks for your work it's awesome

On Tue, Apr 16, 2019 at 6:50 PM Christophe Gragnic <
christophegrag...@gmail.com> wrote:

>
>
> On Mon, Apr 15, 2019 at 11:20 AM pd  wrote:
> >
> > yes, that it is.  A very interesting project specially for education
>
> Thanks for your interest.
> The project is now stopped because Python must now be used in high
> school in France.
> If ever you are in a French speaking env and are interested in
> teaching I'd be glad to chat.
>

I'm very interested in MicroAlg, I remember I was tempted to translate it
to my own language when I first met but then initial momentum waned

It's sad to know government is establishing the programming language to
teach in schools... too autoritarian for me  ;-)
I'm not in a french speaking environment but a rather similar one, langue
d'oc not langue d'oil but close enough indeed.  Anyway I'll very
interesting in translating effort to my languages and also to help you
improve and continue evolving the project.


Re: freemint in Tokyo

2019-12-13 Thread pd
nice picture, nice message and nice Tshirt!

On Fri, Dec 13, 2019 at 6:26 AM George-Phillip Orais <
orais.georgephil...@gmail.com> wrote:

> Hi everyone,
>
> Just want to share this picture taken last night.
>
> From left to right: Anna (freemint's girlfriend), freemint, me, Jeff
> Dionne (founder of uClinux)
>
> It's great meeting new people.. hope to see you again freemint!
>
>
> BR,
> geo
>


Re: Proposal: PilCon 2020

2019-12-27 Thread pd
I'd like to go there but I cannot tell nowadays. Anyway I join to the
recording proposal ;-)

greets

On Wed, Dec 25, 2019 at 11:04 AM Alexander Burger 
wrote:

> 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 people, in "Kulturbahnhof", the old
> Langweid
> train station building.
>
> With this mail I'd like to find out how many people are actually
> interested to
> participate, and their probabilities of attendance (in percent).
>
> Langweid is by train 15 minutes from Augsburg, or one hour from München
> central
> station. There are some hotels/pensions in Langweid, and more in Augsburg
> or one
> of the villages nearby (reachable by train or bus).
>
> I could make two or three presentations about what I'm working on
> currently,
> anybody else is welcome to do the same, and/or we could make a general
> PicoLisp
> workshop.
>
> One of the oldest PicoLisp customers (since 2002, also the one with the
> largest
> user base) is about 3 km from Langweid, and I have a probable OK that some
> interested conference attendees might join to visit them.
>
> Let's discuss further details here in the list, or perhaps in the wiki at
> picolisp.com.
>
>
> I wish peaceful days and a good start into 2020 for all of you!
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


accessing list items and other structures

2020-01-28 Thread pd
Hello,

I'd like to know if there's in picolisp the common lisp concept of places,
I mean, is it possible to do this:

(setq L (1 2 3))
(set (car L) 'x)
L -> (1 x 3)
(set (cdr L) '(a b))
L -> (1 a b)

I'd say it is not places in picolisp, but reference manual says:

: (set 'L '(a b c)  (cdr L) '999)
-> 999
: L
-> (a 999 c)


Which seems similar to places or at least to the use of setf in common
lisp, but what I find strange is in my understanding the set form above
should lead to L -> (a 999)  or even (a . 999) because (cdr L) is (b c) and
thus replacing cdr L with 999 leads to (a 999)... where's my error?
For me L should be (a 999 c) only if the set form were:

: (set 'L '(a b c) (cadr L) '999)

Also, if not having places, have we got scheme's setcar and setcdr at least?

Is there any way of manipulating parts of lists and even objects rather
than using specific functions such as delete, replace and so on ?

regards


Re: Do free Open Source Foundation's Software Stacks fall under US Export Law?

2020-05-10 Thread pd
Thanks Alex for your absolute amazing and beautiful work and dedication.

Fortunately noise is over and list returns to pure signal.

El vie., 8 may. 2020 0:15, David Bloom  escribió:

> FWIW I have been enjoying a fantastic feature of e-mail, FILTERS!
>
> Thanks Alex and community for your work, your examples, your help when
> someone posts to the list, and most of all for being sane voices in a less
> than sane world.
>
> On Thu, May 7, 2020 at 3:52 PM  wrote:
>
>> On Wed, 06 May 2020 17:02 -04:00, Brian Cleary wrote:
>> > It's the end of an error.
>>
>> This was my favorite.  hehe.
>>
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>


Re: Do free Open Source Foundation's Software Stacks fall under US Export Law?

2020-05-16 Thread pd
Nice to hear is fun for you, for me is fun to use picolisp and also this
list where you are do accesible and kind, it's a real privilege!

Sad to know of that bulling, usually the better is simply ignore him but
sometimes it's not enough. Hope this stop quickly

Regards

El sáb., 16 may. 2020 12:47, Alexander Burger 
escribió:

> On Sun, May 10, 2020 at 04:06:47PM +0200, pd wrote:
> > Thanks Alex for your absolute amazing and beautiful work and dedication


Re: Pil21 can bootstrap

2020-05-18 Thread pd
terrific!  great news! :-)

On Sun, May 17, 2020 at 1:13 PM Alexander Burger 
wrote:

> Hi all,
>
> a short note about the Pil21 status:
>
> It can now bootstrap by itself, meaning that it does no longer need another
> PicoLisp to build the *.ll and *.bc files from the sources.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


PilCon

2020-08-23 Thread pd
Hi all,

Sadly I couldn't attend PilCon so I'd like to know if it is recorded in any
way and publicly available

Thanks for making all this happening

regards


Re: Next PilCon tomorrow

2020-09-18 Thread pd
I'm logged into the meet room but see nobody there. I think I'm in time
(16:00 UTC)  does anybody know if there's any problem?

On Thu, Sep 17, 2020 at 8:43 AM Alexander Burger 
wrote:

> Hi all,
>
> tomorrow we have our next PilCon.
>
> As every third Friday of a month, we start at 16:00 UTC on
>
>https://meeting.itship.ch/PilCon
>
> Any suggestions or questions welcome! :)
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: Next PilCon tomorrow

2020-09-18 Thread pd
Ok, see you soon!  Great to know everything goes as planned ;-)

On Fri, Sep 18, 2020 at 5:41 PM Alexander Burger 
wrote:

> Hi pd,
>
> > I'm logged into the meet room but see nobody there. I think I'm in time
> > (16:00 UTC)  does anybody know if there's any problem?
>
> 16:00 UTC is in 25 minutes :)
>
> I hurry and will be with you in a few minutes.
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: PilCon tomorrow

2020-10-01 Thread pd
it should be great talking about any of these themes:

- compilation process in picolisp   (sources are mainly based in lisp
itself and a kind of lisp-assembler, rather than C) to make the picolisp
executable
- how to include common technologies and frameworks in picolisp
applications (such as CSS --how to assign classes and id's to picolisp
objects--, javascript, etc)
- how java communication works, I know it uses java reflection api but
don't know if a pipe or something similar is needed for communication
- how picolisp reader works in order to enhance syntax, for example with
sweet expressions

regards

On Thu, Oct 1, 2020 at 8:34 AM Alexander Burger  wrote:

> Hi all,
>
> tomorrow, Fri 8:00 UTC we have PilCon again :)
>
> Any requests or proposals?
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: PilCon tomorrow

2020-10-15 Thread pd
On Thu, Oct 15, 2020 at 7:30 AM Alexander Burger 
wrote:

>
>
> Any proposals? From my side, I could report a little about the state of
> pil21
>
>
that's good for me. Also we can continue talking about pendent proposals in
proposals list

regards


Re: PilCon tomorrow

2020-10-17 Thread pd
it would be great if someone attending the meeting could record the event,
just capturing sound and video while attending it.

This way the meeting could be uploaded to youtube or another video
streaming repository for public access (If A. Burger agrees, of course).

I try to plan and reserve time each friday for the meeting but live plays a
role and sometimes (like yesterday) it's not possible to finally attend, so
I think a lot of people will find great profit in having Pilcons public
available

regards

On Thu, Oct 15, 2020 at 7:30 AM Alexander Burger 
wrote:

> Hi all,
>
> let's meet again tomorrow, Fr 16oct20, at 16:00 UTC
>
>https://meeting.itship.ch/PilCon
>
> Any proposals? From my side, I could report a little about the state of
> pil21
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: PilCon tomorrow

2020-10-22 Thread pd
El mar., 20 oct. 2020 14:13, Laurent A

>
> Though I agree that without at least a table of content — meaning more
> time
> spent on the thing — it wouldn’t be as useful: the ability to skip a
> subject one
> isn’t interested in is the big advantage I find to the list! :-)
>

TOC can be made in postprocessing step if the uploader annotates themes and
minutes in descripción field ;)

>


Re: PilCon Friday

2020-11-07 Thread pd
About best date and time for PilCon I think keeping two different times,
one in the morning and another in the afternoon is a good compromise for
people from different timezones over the world.

Since I'm european and thus in a european continental timeline, I really
don't care about keep with the actual time or switching to mornings, noon
or evening. The same for day of week because friday is a working day for me
making hard to attend to every meeting but happily I have two chances at
differente hours, saturday is not a work day so it's supposed to be better
to attend but that day have family time attached so it's as hard as working
day.

At the end I think the time heavily depends on location of people attending
the meeting, which is dynamic enough to set a general date and time, best
would be a poll in days before the meeting but maybe too hard to manage. If
people attending is located is hererogenus location will be hard to find a
common time good for all of us.

So, I agree to stay like that or to switch to saturday,  I think it's
important to keep two different time zones to give more chances to attend
(even when I'd prefer same hour at evening ;-)

best regards

On Sat, Nov 7, 2020 at 2:02 PM Erik Gustafson 
wrote:

> Another vote for Saturdays 8:00 / 16:00 UTC here
>
> On Sat, Nov 7, 2020, 6:14 AM Davide BERTOLOTTO <
> davide.bertolo...@gmail.com> wrote:
>
>> Saturdays with the usual schedule sounds good for me
>>
>


Re: Licence Dilemma

2020-11-22 Thread pd
my vote to go for GPL and readline. As you said compatibility is guaranteed
and everybody knows it.

On Sat, Nov 21, 2020 at 9:23 AM Alexander Burger 
wrote:

> Hi all,
>
> at yesterday's PilCon it turned out that pil21 has a serious licence
> problem.
>
> A major design decision of pil21 was to use readline(3) instead of the
> self-
> rolled @lib/led.l from pil64/pil32.
>
> The reason was compatibility with the rest of the world (readline supports
> both
> vi- and emacs-mode right out of the box, uses the same ~/.inputrc as bash
> and
> other tools, and everybody is used to it), and high configurability.
>
>
> I took a look at editline() / libedit. Very different API! It does not
> even use
> ~/.inputrc but requires a separate ~/.editrc.
>
> I don't see that it supports all the features pil21 needs (hooks to various
> functions for signal handling, background tasks and display control (see
> pil21/src/lib.c).
>
>
> Better go back to GPL with pil21?
>
> I'm getting fed up with these licence wars!
>
> ☹/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>
>


Re: Pil21 is now in Debian Unstable

2020-12-29 Thread pd
great news! thanks!

On Tue, Dec 29, 2020 at 4:26 PM r cs  wrote:

> Alex:
>
> Congratulations and thank you!
>
> ☺ / rcs
>
> On Tue, Dec 29, 2020 at 6:01 AM Alexander Burger 
> wrote:
>
>> Hi all,
>>
>> pil21 is now available in Debian unstable.
>>
>> This means we are now "officially" on pil21!
>>
>> ☺/ A!ex
>>
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>
>
> --
> *Níl aon tinteán mar do thinteán féin. *[Irish Gaelic]
> (There is no fireside like your own fireside.)
>
>
>


Re: Picolisp Outlook

2021-02-22 Thread pd
El lun., 22 feb. 2021 9:31, Alexander Burger  escribió:

> ... and immune to temporary hypes.
>

What a nice desire being rejected by history of humankind again and again ;)

Specially in computer science

>


Re: Picolisp Outlook

2021-02-23 Thread pd
On Tue, Feb 23, 2021 at 5:00 PM Danilo Kordic 
wrote:

>   'float' could be implemented as a lib.
>

yes, but the point here it is not at core and even having a float lib or
whatever science lib, python is plenty of them and a nicer syntax

it's not about me neither talking about (pico)lisp features and better
syntax, I'm yet convinced 'cause I'm a schemer thus a lisper and I'm here
in that list after all
But most people don't think so and no matter how better and nicer I find
the lisp syntax, the world thinks the opposite ;-)

maybe you can find a killer app or even a killer science app leting
picolisp shine but as soon as people has to program in picolisp (I mean
scripting) they will feel uncofortable, they will always prefer R or
python, just for syntax, not talking about huge amount of libraries and
community support,  developers should enjoy (pico)lisp facilities to
develop and organice knowledge but as soon as had practical issue the lack
of specialized libraries will make them comply thinking in wide spread
python or ruby (just talking dynamic 'script' languages only)...

It's not a problem of picolisp only, it's common to all lisp dialects and
even cool minor languages... This is the reason for using lua for scripting
rather than picolisp, guile or even tcl
Also this is the problem for all lisp about their use in real apps,  I see
this in common lisp, in scheme, ...  The only lisp-like with hype and
relative wide use is clojure and one key reason is libraries (achieved by
jvm side)

And this is how it's gonna be... we live in the dictatorship of C-like
syntax world! ;-)

(damnification is not only in lisp world,  same happen to smalltalk and
derivatives, forth-like derivatives and so on)


Re: Picolisp Outlook

2021-02-24 Thread pd
>
> On Tue, Feb 23, 2021, 21:03 pd  wrote:
>>
>>>
>>>
>>>
>   This is complete rubbish (IMHO)!!  You are not even a normie, but an
> NPC!!
>

Maybe if you explain your arguments we can build a little discussion, I'm
not a normie but kinda opposite, don't know what are you refering with NPC
(maybe Non Player Character?)

The point is not what I am but what most people is or believes


Re: Picolisp Outlook

2021-02-24 Thread pd
On Tue, Feb 23, 2021 at 11:06 PM Davide BERTOLOTTO <
davide.bertolo...@gmail.com> wrote:

> After all these years I am still wondering how people like complicated
> sintaxes full of special forms more than the simplicity of lisp. After all,
> the parentheses and the prefix notation do not look so terrible to me,
> especially considering that you gain a lot in clarity and simplicity of the
> language. Probably is the same reason that pushes people to create yet
> another programming language every now and then xD.
>

I wonder the same. My conclusion is this is due to two main related reasons:

1 people doesn't know about more simpler, nicer and powerful syntax and
don't want to know because feel comfortable in the point it is
2 people is trained in only a way (that's is a relevant bias)

In most universities and programming lessons the adopted point of view is a
turing machine one specially about programming and even taking lessons
about other programming paradigms (for sure lambda calculus and functional
programming is teached) the exercises, training and 'work-oriented'
practices are always inserted into the turing machine object oriented
style, usually java.

The result is people is used to infix notation, math-like syntax and even
point-access syntax which are commonly used by TMOO languages to the point
most functional ones adopt the same syntax, thus is always more natural for
programmers to follow the path from C or java to haskell or python rather
than smalltalk, lisp, factor, etc  The thing is so biased that most
alternative languages provide syntactic sugar to present own syntax as
c-like syntax and even abandon own syntax in favour of c-like one.

IMHO is very strange since prefix notation is simpler, easier to read and
most powerful, and more similar to math notation (skipping operators) than
infix notation. Adaptation is very easy too so my conclusion is it all
about comfort and extension.

A clearly example is all that complaints about parens hell in lisp but very
few about curly brackets hell  (for stating just one evident thing)

regards


Re: FEXPRs / PilCon

2021-03-13 Thread pd
That's true but with comments ;)

Composing strings (packing) have two main advantages:

1. Strings may be inmutable (you can return a new different string, maybe a
copy)
2. Strings can be passed as parameter

The fexpr writing directly to stdout with print and running a program does
not returns a string with the intended result:

: (de  P (prin "") (run P) (prin ""))
-> 
: ( hallo)
-> ""
: (length ( hallo))
-> 4
: (setq X ( hallo))
-> ""
: X
-> ""

You can argue return value is nothing you must worry about because you're
only going to print the result, so better use it as a side effect. But this
is not always true, returning a string you can further compose it and make
transformations to it

So first problem with this fexpr (programmed this way) you don't have the
intended return value and thus you cannot use it as parameters to other
function invocation

Second problem is about inmutability, as you don't return the value you
cannot have a completely different memory object.

Ovbiously you can arrange the program (P) you pass to the fexpr and get
those problems solved by example packing into the result but it may become
not easy to write the function due to side effects:

: (de pp P (prin "") (run P) (prin "") (pack "" (run P) "") )

: (pp (+ 2 3))
-> "5"
: (pp 2)
-> "2"
: (pp (print 2))
22-> "2"
: (pp ( (prin "hallo")))
hallohallo-> ""
: (pp (pp (prin "hallo")))
hallohallohallohallo-> "hallo"
: ( ( (print "hallo")))
"hallo"-> ""

so you must code carefully the fexpr, and anyway if you're going to return
a string then side effects are often innecesary.

More interesting is last use of fexpr which is the true reason of existence
of fexpr's, being able to write macros

But even when being needed as the only way to write certain functions (aka
macros), most of the time are not needing, like the intended use with 
showed as an example by Alex.

Given:

: (de p (t) (pack "" t ""))
: (de d (c t) (pack "" t ""))

the example given by Alex to get a multiline div is simply this one-liner:

: (prinl (d "red" (glue "^J" (mapcar p '("ABC" "DEF" "GHI")

ABC
DEF
GHI






El sáb., 13 mar. 2021 8:32, Alexander Burger  escribió:

> Hi all,
>
> at PilCon three days ago we discussed about FEXPRs like
>
>(de  Prg
>   (prin "")
>   (run Prg)
>   (prin "") )
>
>(de  (Col . Prg)
>   (prin "")
>   (run Prg)
>   (prin "") )
>
> which can be called as
>
>( "red" ( (prin "Text")))
>
> giving such output:
>
>Text
>
>
> One question that came up was why FEXPRs could not be replaced with normal
> functions (EXPRs), simply 'pack'ing strings:
>
>(de  (Str)
>   (pack "" Str "") )
>
>(de  (Col Str)
>   (pack
>  "  Col
>  "\">"
>  Str
>  "" ) )
>
>: ( "red" ( "Text"))
>-> "Text"
>
> While this would surely work, I answered that it is a big overhead to
> generate
> the whole page as strings just to print them.
>
>
> But I forgot to explain: The real reason for FEXPRs goes beyond that. They
> have
> the power of passing executable code bodies, with arbitrary flow control,
> to the
> function.
>
> To pick just a minimal example:
>
>( "red"
>   (for S '("ABC" "DEF" "GHI")
>  (prinl)
>  ( (prin S)) )
>   (prinl) )
>
>
>ABC
>DEF
>GHI
>
>
> This cannot be done with EXPRs.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>
>


Re: FEXPRs / PilCon

2021-03-14 Thread pd
On Sat, Mar 13, 2021 at 2:05 PM Alexander Burger 
wrote:

>
> Yes. (And strings are always immutable in PicoLisp anyway)
>

this is pretty interesting to be rembered, good for newbies to discover why
it is that way ;-)


> > : (de pp P (prin "") (run P) (prin "") (pack "" (run P)
> "") )
>
> This is a bit problematic, because the body in P is executed twice. Not
> only is
> this slower, but may create havoc because in a typical GUI program *all*
> logic
> happens in these bodies. This logic would be executed several times, doing
> lots
> of unexpecyed things. Better then:
>
>(de pp P
>   (prin (pack "" (run P) "")) )
>
>
yes, all my examples in my previous email are bad code, just  for output
only, trying to offer examples of how things can go weird
They're are not intended to be right implementations, too bad for that ;-)


> For such a simple example it works. But keep in mind that typically 'P'
> is a large program, with lots of 'if's, 'while's  and arbitrarily deeply
> nested other HTML tags.
>
>
yes sure, I think the PilCon and this email thread are good examples of an
interesting use of fexprs  but  even complex and large programs may be
arranged in a way fexpr are not needed, it's a kind of condig style.

My point is you can do with fexprs everything you do with exprs but the
opposite is not true, fexprs have it own role in lisp. But I prefer to code
in a more functional style working composing functions with inmutable
objects and without side-effects.
It's always a balance between performance and logical beauty (from my point
of view), but performance is not only about computing performarce but also
logic and conceptual performarce and even profiling or debugging
performance.

At the end the smart decision is to choose the better tool for the job ;-)

 greets


Re: FEXPRs / PilCon

2021-03-15 Thread pd
On Sun, Mar 14, 2021 at 10:19 PM Alexander Burger 
wrote:

> Hi pd,
>
> > They're are not intended to be right implementations, too bad for that
> ;-)
>
> No no, I did not say that :)
>

:)  ok  but *I* say that,   it's really not a code to show, only intended
to show output


> Right. The point is that FEXPRs allow you to write flow control in a way
> not
> possible with EXPRs.
>

exactly,



> OK. But please don't mix up the issue with side effects. They have nothing
> to do
> with FEXPRs.
>

that's true, you can code for side-effects using fexprs or exprs. I simply
said I prefer to code not using side-effects (even when sometimes are
needed or the better solution)


>
> And in most cases you can get both (beauty and performance).
>
>
touché! ;-)


regards


Re: PilCon tomorrow (Anatomy of Vip)

2021-04-09 Thread pd
this time I will try to record the session if you all agree (and if I can
attend)

regards

On Fri, Apr 9, 2021 at 9:44 AM Alexander Burger  wrote:

> Hi all,
>
> let's have a PilCon tomorrow (10th of Aqril, 8:00 UTC)!
> As ever, at https://meeting.itship.ch/PilCon
>
> If no questions, I might talk about the "Anatomy of Vip".
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: PilCon tomorrow (Anatomy of Vip)

2021-04-13 Thread pd
Hello all,

I'm recorded the PilCon session but sadly I couldn't attend the whole
session and thus set up a quick and dirty recording session, anyway I
include the video to show what can be done.  Next time will be better
styled and fully recorded.

I include a link to the video in vimeo as an example but it seems vimeo has
downgrade quality, original have a better resolution I can give it to
anybody interested. For a test vimeo video is ok.

https://vimeo.com/536507279

regards

On Fri, Apr 9, 2021 at 9:44 AM Alexander Burger  wrote:

> Hi all,
>
> let's have a PilCon tomorrow (10th of Aqril, 8:00 UTC)!
> As ever, at https://meeting.itship.ch/PilCon
>
> If no questions, I might talk about the "Anatomy of Vip".
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: PilCon yesterday - the screen share hassle

2021-09-22 Thread pd
Hello,

I don't have a stablished opinion because don't know so much about current
platforms and services. So I really don't care while enjoying good service
during the meeting.

As far as I know, twitch deletes video recordings after a while and this
may be an advantage or an inconvenient

I think the better platform would be that on which Alex feel more
comfortable.

I still think it should be a good idea to record the meetings and publish
them in a video repository such as youtube, vimeo or a similar one.  I've
done a test recording a meeting and publishing it in vimeo and I see it's
possible, the problem is I cannot attend every meeting, it would be great
having several people who could cover the recording.

One problem is the duration of the meeting that ends in a long video file,
difficult to upload, in my tests it exceed the length allowed by youtube.
You always can remaster the video changing quality or size or even cutting
it in pieces but all this is quite tedious.

greets.


On Wed, Sep 22, 2021 at 11:49 AM O.Hamann  wrote:

> Hi Alex,
>
> would be great to have shared Tmux via SSH again in PilCon meetings!
>
> It would be no problem to provide a payed Zoom Meeting Room without the
> need of reconnecting after 40minutes, but I'm not sure what the
> community thinks about not using the selfhosted (many thanks to
> beneroth!) Jitsi server.
>
> What do others think?
>
> Or could it be a way, to announce certain 'screenshare-required PilCon
> Session taking place on ... ...' if necessary, but in general continue
> with jitsi and ssh terminal?
>
> What about other (commercial) solutions, which promise more data
> security, like www.teamviewer.com/en/meeting ?
>
> I can't technically judge, what teamviewer claims (see below), but in
> general European or Germamny based companies have to obey more rules
> concerning data and privacy awareness, I think.
>
> They say:
> "Unlike other online meeting tools, TeamViewer Meeting provides a GDPR
> and HIPAA compliant platform with RSA 4096 public/private key exchange
> and 256-bit end-to-end encrypted videoconference calls, designed to
> protect sensitive, highly confidential information. Lock meetings and
> add meeting passwords to keep uninvited guests out of private discussions"
>
>
> For me it would be worth a few bucks per month to provide a stable
> screen sharing session for our PilCon Meetings, but I also would like to
> *not* exclude anyone because of choosing inacceptable tools.
>
> What do you think?
>
> Kind Regards,
>
> Olaf
>
>
> On 21.09.21 11:27, Alexander Burger wrote:
> > Hi all,
> >
> > yesterday's PilCon was a bit chaotic. Sorry for that!
> >
> > I found out why the shared Tmux via SSH did not work. It was a file
> permission
> > problem. Should be OK next time.
> >
> > Screen share in Jitsi is a persistent hassle. It locks up for some
> clients, and
> > sharing from my Android phone sometimes does not work at all, and
> sometimes gets
> > incredibly slow. Any ideas?
> >
> > Please send me questions for the next PilCon a few days earlier, so that
> I can
> > search for examples and use cases!
> >
> > ☺/ A!ex
> >
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
>


picolisp package in debian

2021-09-25 Thread pd
I've just installed picolisp in debian 10.10 (buster) using apt and got
picolisp 18.12-1 i386

picolisp tells version is 18.12.27 C but when running picolisp as:

pil @lib/vip.l +

I get this error:

[/usr/lib/picolisp/lib/vip.l:4]  !? (symbols 'vip 'pico)
symbols --  Undefined
?

and there's no vip executable but there's vip.l

I think the problem is the picolisp package is a 32bit picolisp rather than
64 bits, in fact the picolisp executable is a 32-bit ELF,  but the package
contains a src64 , so  can I build a 64bit picolisp from sources included
in package?  if so, how?

regards


Re: PilCon yesterday - the screen share hassle

2021-09-25 Thread pd
Hello All,

Please don't misunderstand me, I am *NOT* recording pilCon's at all.  I
strongly believe in the right for privacy and recording anything without
permision is absolutely out of my mind.

I've done one and only one attempt to record a PilCon, and obviously it was
previously asked in this list and everybody replying agreed (sadly it
wasn't a great test because I couldn't attend from the very beginning), I
checked for uploading and finally uploaded to vimeo and again emailed it to
the list ( PilCon 10-04-2010 on Vimeo  ).

As far as I remember there's no personal data in the recording unless the
chat window, anyway I will delete it from vimeo if anyone ask for it.

I agree is hard to edit the recording in a useful way because it would be
great to have an index by minute and theme, the recording is simply the
jitsi & ssh screen and voices talking about, no index, no info about issues
beyond the speech.

My conclusion is recording is not that great and it would be better a
planned video lesson, also in current state with screen turning off
frequently it is simply not possible to record anything, at least from my
computer.

On Fri, Sep 24, 2021 at 11:45 AM O.Hamann  wrote:

>
> I'm not so happy with published recordings without asking about it or at
> least announcing it in the certain session.
>

I've asked before recording, obviously.  I never would record anything
without permision.


> Though publishing recordings might help to 'spread the pil21 word'^^ it
> would require much effort in editing and indexing the stream.
>
> It could be sustainable to publish some shorter excurses of some
> PilCons, but I would like to have a talk before,
> as I totally agree with razzy's view, that PilCon 'is also about
> socialization and trust-building'.
>

I'm also totally for trust-building and secure environments. I'd like to
insist I'm not recording anything and not planning to do it.

As discussed days before, I've suggested it would be a good idea to record
the sessions, I asked to record one as a tested, people agreed, so I did
and uploaded to the only place I could and that's all.   I would expect
everybody to check the result and discuss if it is something interesting or
not.

I still think it's interesting to have videos explaining Picolisp, maybe
PilCon or maybe not, maybe it would be better specific lessons about some
issue, similar to Mia's blog but in video.


>
>
> I like the idea to publish the console history.
>

I like it too, but the raw console history wouldn't be very useful because
the most value is the explanations, that is Alex speech ;-)

maybe the console history may be the roots for a blog article or something
like that deeply explaining the issues involved.


>
> Or to use the old 'script' command line tool, which beneroth brought up
> in IRC.
> (of course I have troubles to understand what script does ... a few
> keystrokes produced megabytes of recording file when trying it without
> reading the man page before ...)
>
> In either tool, we could try to type significant comment lines to
> seperate different topics and make them easier to find when browsing
> through.
>
> If someone who could not take part in the PilCon reads afterwards the
> history or script file - could then specifically ask in the mailing
> list, so that he/she won't get lost of any PilCon topics.
>
>
it could be very useful indeed but also would require editing.  Anyway the
presence in media is a good thing, the objective is not to please the
picolispers but to attract new people to picolisp and to attend newbies'
questions. For spreading out picolisp videos are a better tool than text,
IMHO

greets


Re: Feature request - 'fill'

2021-12-13 Thread pd
On Mon, Dec 13, 2021 at 6:27 PM Alexander Burger 
wrote:

>
> So I went ahead and implemented the extended 'fill' behavior.
>
>: (fill (1 ^(+ 1 1) 3))
>-> (1 2 3)
>
> To make it more consistent, I also changed the '~' read macro in the same
> way.
> Now this works:
>
>: (~(- 4 3) (2 ~(+ 1 2) 4) 5)
>-> (1 (2 3 4) 5)
>

And why not following lisp tradition and use comma character  (,) rather
than caret character (^)  for evaluating expressions?

In fact fill is more or less analogous to backquote (`) (also known as
quasiquote) in several lisps :

`(1 2 3) -> (1 2 3)
`(1 (+ 2 4) 3) -> (1 (+ 2 4)  3)
`(1 ,(+ 2 4) 3) -> (1 8 3)

'(1 ,(+ 1 2)) is short writting for (backquote (unquote (+ 1 2)))

You can also introduce ,@ to insert flat lists like in:

(let (x '(1 2)) `(1 ,x 2)) -> (1 (1 2) 2)
(let (x '(1 2)) `(1 ,@x 2)) -> (1 1 2 2)

Even if you don't want to implement quasiquote and unquote you can use
tradicional symbols in fill, that is using , rather than ^ and maybe
introducing ,@ also in fill

see https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html


Re: Feature request - 'fill'

2021-12-14 Thread pd
On Tue, Dec 14, 2021 at 3:15 AM Erik Gustafson 
wrote:

>
> I think Alex has shown that ',' and ',@' can be rolled into one - '^'
>
> : (let X (1 2) (macro (1 (^ X) 2)))
> -> (1 (1 2) 2)
> : (let X (1 2) (macro (1 ^ X 2)))
> -> (1 1 2 2)
> : (let X (1 2) (macro (1 ^ (apply + X) 2)))
> -> (1 3 2)
>
> the point is precisely that, maybe using , and ,@ is redundant in fill
because of ^   But the point is that it's better to follow lisp tradional
syntax, this way lispers can easy understand the meaning of code in (fill
`( 1 ,x 2 ))  but have to learn a new syntax to understand (fill '(1 ^ X
2)), that is another one "picolisperism"  ;-)


quote form in picolisp

2021-12-15 Thread pd
Hello, this message is somehow related to the one with subject "Feature
request - 'fill'"

After playing with fill and quote in picolisp I've found picolisp
implmentation of quote is a bit "strange" in terms of lisp tradition.

In lisp quote is usually a special form than returns the form passed as
parameter and accepting only and only one parameter, thus:

(quote a)  -> a
(quote (quote a)) -> 'a
(quote (a b c)) -> (a b c)
(quote '(a b c)) -> '(a b c)
(quote) ->  *ERROR*
(quote a b c)  ->  *ERROR*

where ' is an alias for quote,  so   (quote '(a b)) = (quote (quote (a b)))

But this is not the case in picolisp, since quote accept several arguments
it is forced to return always a list even when quoting an atom:

(quote a) -> (a)
(quote 'a) -> ('a)
(quote (a)) -> ((a))
(quote '(a)) -> ('(a))
(quote) -> NIL; which is '()
(quote a b c) -> (a b c)
(quote 7) -> (7)

I think this is incorrect because 7 is not (7), 7 is an atom and it should
still be when quoted, but picolisp turns it into a list

This also have problems, for example in most lisp you are expected to
safely do:

(setq a 4) -> 4
(quote a)  -> a
(eval (quote a)) -> 4

But in picolisp you get:

(set a 4) -> 4
(quote a) -> (a)
(eval (quote a))
Segmentation fault

This is because of converting an atom into a list and then evaluating it
tries to execute a function, the internal one at address 4, and thus you
get a segmentation.

This does not happen trying to evaluate a constant number just due to
picolisp special treatment of lists of numbers to avoid quotation:

(eval (quote 7)) -> (7)

Also there's no coherence between quote form and ' read macro:

(quote 3) -> (3)
'3 -> 3
(quote a) -> (a)
'a -> a
(quote (a b)) -> ((a b))
'(a b) -> (a b)
(quote '(a b)) -> ('(a b))
''(a b) -> '(a b)
(quote (quote (a b)) -> ('((a b)))

even when in the manual it's said "... read-macro in Lisp is the single
quote character ', which expands to a call of the quote function"

it seems read macro ' behaves as expected in lisp but quote form does not.

Maybe I misunderstand the details in quote form because if you use it as
not proper list it seems to behave as it should be:

(quote . 3) -> 3
(quote . a) -> a
(quote . (a b)) -> (a b)
(quote . '(a b)) -> '(a b)
(quote . (quote . (a b)) -> '(a b)

But this is a uncommon syntax and I feel an incorrect use for most lisp out
there.

May you explain and/or discuss this ?
shouldn't be possible that ' read-macro translate transparently into quote
forms and also quote forms and ' read macro were equivalent?
why not restrict quote form to use just one argument as most lisp do?

thanks and best regards


Re: quote form in picolisp

2021-12-15 Thread pd
On Wed, Dec 15, 2021 at 5:18 PM Alexander Burger 
wrote:

>
> It is all explained in this article from 2011:
>
>https://picolisp.com/wiki/?ArticleQuote
>
> So I consider 'quote' in PicoLisp a big improvement over other lisps ;)
>
> interesting point of view but I consider this introduces several drawbacks
just to afford only one cell:

- it breaks compatibility with almost all lisp out there
- it makes a dotted pair or improper list into an application which is not
a right application form in any lisp AFAIK, function application is always
a proper list not a dotted pair

  In all lisp I know you cannot write (+ 1 . 2)  or (quote . a) or (+ . 1),
they all produces an error, the right syntax is (+ 1 . (2)) or (quote .
(a)) or (+ . (1)) because function application must be a proper list not a
improper list

  That is also the case in picolisp, where you can write (quote . a) -> a
but  writing (+ . 1)  produces a Segmentation fault whereas writing (+ .
(1)) -> 1  produces the desired result

  This way the syntax and behaviour in picolist is not internally coherent,
every function application must be a list but for quote, which can be not a
list but an improper list.

examples in picolisp of this strange behaviour:

( + 1) -> 1  ; expected behaviour
(+ . (1)) -> 1  ; expected behaviour
(+ . 1)   ; Segmentation fault
(+ 1 . 2)  ->  1   ; behaviour not expected, it should be 3 (following
quote) or ERROR
(+ 1 . (2)) -> 3   ; expected behaviour
(+ 1 . (5 . 3)) -> 6  ; behaviour not expected, it should be 9 (following
quote) or ERROR

Last example is interesting, It seems to simply ignore last item assuming
last cell cdr as nil even if it is not

It seems to me that incoherence is because picolisp treats all funcional
applications as every lisp but quote form which is treated in a special way:

(+ . (1)) -> 1 but   (quote . (1)) -> 1
(list 3 . 5) -> (3)but  (quote 3 . 5) -> (3 . 5)  even
when(list 3 5) -> (3 5)  and   (quote 3 5) = (quote . (3 5)) -> (3 5)

; with an undefined symbol zz
(print . 'zz)  265606 ->  265606  but   (quote . 'zz) -> 'zz
(print . zz)  NIL->  NIL but   (quote . zz) ->
zz
(print  zz)  NIL->  NIL
(print  zz . vv)  NIL->  NIL  ;  again skiping last symbol

I really don't know what is the number 265606 printed and returned when
calling (print . 'zz)

Maybe I'm misunderstanding something.


Re: quote form in picolisp

2021-12-16 Thread pd
On Thu, Dec 16, 2021 at 12:20 AM pd  wrote:

>   This way the syntax and behaviour in picolist is not internally
> coherent, every function application must be a list but for quote, which
> can be not a list but an improper list.
>
> Maybe I'm misunderstanding something.
>
> indeed the example in picolisp reference for quote [Q (software-lab.de)
<https://software-lab.de/doc/refQ.html#quote>] seems strange to me, it
suggest you should use quote in a proper list as in all lisp:

: (quote (quote (quote a)))
-> ('('(a)))

but I think it should be written   (quote . (quote . (quote . a))) to be
compatible with quote syntax in picolisp and also with the behaviour of all
lisp I know about, in any lisp you get:

: (quote (quote (quote a)))
-> (quote (quote a))

(quote (quote a))  is equal to ''a   which is what you get in picolisp
with  (quote . (quote . (quote . a)))

Also I think you get collateral damage,  in lisp:

(eval (quote (quote (quote a  ->  (quote a)

in picolisp:

(eval (quote (quote (quote a
|? ('(a))
quote -- Protected
?

regards


Re: quote form in picolisp

2021-12-16 Thread pd
On Thu, Dec 16, 2021 at 6:35 AM Danilo Kordic 
wrote:

> Hi pd
>
>   It seems You are looking for Wikipedia/Currying .  What are Your further
> thoughts?
>

No I don't


>
>   What do  You think about Wikipedia/De_Bruijn_index ?
>

I think it's an interesting proposal for using with lambda calculus.

I'm not using Wikipedia at all and both questions you wrote are not related
at all with what I was talking about  (well they're related as a theorical
level since are questions related to lambda calculus, of course, but not
for the questions I'm discusing here)

 regards


Re: quote form in picolisp

2021-12-16 Thread pd
Thanks for your explanation, Alex

On Thu, Dec 16, 2021 at 10:24 AM Alexander Burger 
wrote:

>
> First of all, forget other Lisps! I always say it is best if you start with
> PicoLisp without knowing "Lisp".
>

:)  That's a nice advice but sadly I feel I can't do that  ;-)


> The term "improper list" does not exist in PicoLisp. Everything is either a
> number, a symbol or a pair.
>

As you sure know proper or improper list always exist because is a semantic
convention or noun, every list is a pair just only happen that when a list
(a chained dotted pair) ends in NIL we call it proper list and when not
ending in NIL but in any other atom, we call it improper list.
So picolisp HAS proper and improper list ;-)   in fact a circular list is a
kind of improper list and we all known picolisp has circular lists


> As we are interpreter-only, every function is free to decide for itself
> how to
> handle its arguments. Thus *every* built-in function is an FSUBR, always
> of the
> form (fun . args).
>
>
I think I have a problem with picolisp documentation (my fault), it says "A
dotted pair notation in the argument list like (... 'any . prg) indicates
an unevaluated list of further arguments." which is what you said in
previous paragraph and the way of constructing functions not evaluating
arguments, to me this means in function application you should have a list
of function name and arguments, like this (f) ,  (f 1) , (f a b c) ...

being the doc of fun "(fun . args)" then:

(fun )  ; args = '()
(fun 1); args = '(1)
(fun a b) ; args = '(a b)

so a doc like "(de sym . any) -> sym" is quite different from a doc like
"(quote . any) -> any".

doc "(de sym . any) -> sym" means you should pass at least one argument and
the rest if any are collected in a list, so every function call should be
the kind of:

(de f ) ; any = '()
(de f 3)   ; any = '(3)
(de f (x) (+ 2 1)) ; any = '((X) (+ 2 1))

but it cannot be:

(de f . 4) ; any = ??

but it can:

(def f . 4)   ; makes f = 4   and so any should not be a list but atom 4,
contrary to doc definition "A dotted pair like (... 'any . prg) indicates
an unevaluated list of further arguments."

And so what means the doc "(quote . any) -> any"?  following doc convention
any should be binded to an evaluated list of arguments, and arguments can
be anything or nothing:

(quote)   ; any = '()
(quote 1); any = '(1)
(quote a b) ; any = '(a b)

but again what about (quote . a) ?  what to bind to any?  it only can be
atom a and thus is what really happen but as said in doc, any is a list not
an atom

For my mind this is already so bad, but it's even worse because the
behaviour is not predictible:  (+ 1 . 2)  does not return 3 but 1

ok, you can assume you can pass arguments to functions in cdr part of cell
and thus (quote . a) is another way to express normal lisp behaviour (quote
a) and thus if (quote . a) is a, then you can say (quote a) is effectivey
like (quote . (a . NIL)) and thus your are passsing a list to quote
returning (a),  but it should work also for + or print

I think the point is most lisp assume parameters to functions are always
passed in CAR position of cells, which is the same of saying all functiion
applications are proper list, while picolisp allow to pass arguments to
functions in CDR position of cells and thus function applications are not
proper list, but the problem is it seems this is not a general behaviour
since some functions work with parameters in cdr position while others
don't.

Maybe I'm misunderstanding details and after all picolisp is breaking
traditions as stated in documentation, but this behaviour blows my square
mind ;-)

Anyway I think it worths to think about all this to further understand
picolisp internals  and picolisp way of lisp ;-)

best regards


Re: quote form in picolisp

2021-12-16 Thread pd
On Thu, Dec 16, 2021 at 11:51 AM  wrote:

>
> In which practical use case do you ever need such an abhorrent nesting of
> quotes?
>
it's not a question of practical use but compatibility and tradition, also
a question of semantics


> But I'm having doubts about this being not just a superficial theoretical
> whim, are there really any lisp dialects between which general lisp
> knowledge is enough to be effective, without studying the specific
> language? I have the impression that lisp dialects are very diverse, while
> looking similar the differences are very consequential and no useful
> programming can be done without studying them, maybe even more so than the
> many languages which follow C syntax style.
>
you're right, every language contains itself a "deviation" of its own
family and at the end you must learn special features of a concrete
dialect, so there's no common knowledge you can learn applicable to all
language dialects. But there's stablished traditions and there're formal
theory you should comply with.   I think quote behaviour is one of them and
also list application.

regards


some questions relating pilog

2022-02-08 Thread pd
Hello,

I'm using picolisp version 18.12.27 C in a debian 10.10 based distro,
installed as package picolisp 18.12-1

I'm playing with pilog and there're some examples that does not run:

1- the example in doc reference for repeat/0 [1] :

: (be integer (@I)   # Generate unlimited supply of integers
   (^ @C (box 0))# Init to zero
   (repeat)  # Repeat from here
   (^ @I (inc @C)) )
-> integer

: (? (integer @X))
 @X=1
 @X=2
 @X=3
 @X=4.   # Stop
-> NIL

but I got nothing printed, no values for @X var, it keeps doing apparently
nothing until I kill the process

I can make it work if I use the -> functon this way:

: (be integer (@I)
   (^ @C (box 0))
   (repeat)
   (^ @I (inc (-> @C))) )

Is the reference documentation incorrect?

2- the example of factorial in Mia's blog  [2] :

: (be factorial (0 1) T)
-> factorial

: (be factorial (@N @X)
  (^ @A (dec @N))
  (factorial @A @B)
  (^ @X (* @N @B)) )
-> factorial

: (? (factorial 5 @X))
 @X=120
-> NIL

but when I execute (? (factorial 5 @X)) in my lisp I got:

: (? (factorial 5 @X))
-> NIL

only valid result is when executing  (? (factorial 0 @X)) :

: (? (factorial 0 @X))
 @X=1
-> NIL

debugging does not help:

: (? factorial (factorial 0 @X))
1 (factorial 0 1)
 @X=1
-> NIL

: (? factorial (factorial 5 @X))
2 (factorial 5 @X)
-> NIL

Again I get it working using the -> function this way:

: (be factorial (@N @X)
  (^ @A (dec (-> @N)))
  (factorial @A @B)
  (^ @X (* (-> @N) (-> @B))) )
-> factorial

Now:

: (? (factorial 5 @X))
 @X=120
-> NIL

but I cannot get an answer for the inverse query:

: (? (factorial @X 120))
-> NIL

any hint?

I assume the use of -> function is needed but that means picolisp
documentation and Mia's blog is wrong.

Also I would like to know if pilog unification deals with compound
predicates, I mean, in prolog you can write:

p(a).
p(R(y)).
? p( X )
X=a
X=R(y)

Querying for values of X veryfing a p predicate. How can you get that in
pilog?

I've tried this two:

(be p ((R y)))

(be pp ((R (y

and it appears to work:

(? (p @X))
@X=(R y)
-> NIL

(? (pp @X))
@X=(R (y))
-> NIL

but I'm not sure it's the same semantics as prolog, because this appears to
me as stating p as a list , not a compound predicate.

In other words, what is the correct translation to this prolog clauses to
pilog?

prolog  pilog
p(a).   (be p (a))
p(x,y). (be p (x y))
p(r(b)).(be p (r (b)))  ? not working  (-> NIL)
(be p ((r (b? gets @X=(r (b))
(be p ((r b)))  ? gets @X=(r b)
p(z(a),b)   (be p ((z a) b))? gets @X=(z a) @Y=b
(be p ((z (a)) b))  ? gets @X=(z (a)) @Y=b


best regards

[1] R (software-lab.de) 
[2] How to use Pilog in PicoLisp (picolisp-explored.com)



Re: some questions relating pilog

2022-02-09 Thread pd
Hi Alex, thanks for quick reply

On Wed, Feb 9, 2022 at 8:13 AM Alexander Burger  wrote:

>
> > Is the reference documentation incorrect?
>
> No, but it seems that you looked at the reference for pil21.
>
> The syntax for calling Lisp expressions in Pilog was made a little
> friendlier in
> pil21, by binding variables directly, so that calling '->' is normally not
> needed any more.
>
>
Ok, thanks for the clarification


> > but I cannot get an answer for the inverse query:
> >
> > : (? (factorial @X 120))
> > -> NIL
>
> This is another issue. This Pilog version of factorial cannot do reverse
> lookup,
> as it calculate numeric values via Lisp calls.
>

Ok, I suspected that but is there any way to do arithmetic in pilog?  My
understanding is you have to use picolisp for arithmetic

How should be declared factorial primitive to be compatible with reverse
lookup?


> > Also I would like to know if pilog unification deals with compound
> > predicates, I mean, in prolog you can write:
> >
> > p(a).
> > p(R(y)).
> > ? p( X )
> > X=a
> > X=R(y)
> >
> > Querying for values of X veryfing a p predicate. How can you get that in
> > pilog?
>
> Yes, you can do that, but not in that direct syntax.
>
> You could take a look at how 'not', 'call' or 'or' are implemented in
> @lib/pilog.l for examples.
>
>
Ok, I'm doing, I'll post any question about it

May you tell me what syntax is the right one for prolog primitives
translated to pilog?

prolog  pilog
p(r(b)).(be p (r (b)))  -(1)-   or
(be p ((r (b-(2)-   or
(be p ((r b)))  -(3)-
p(z(a),b)   (be p ((z a) b))-(1)-   or
(be p ((z (a)) b))  -(2)-

what is supposed to mean (be p (r (b))) if anything?
May you explain the estructure of a pilog environment (and the use of unify
function)  and how pilog clauses are converted to property lists?   what
kind of unification algorithm uses pilog?   maybe in a PilCon session

thanks and best regards


Re: some questions relating pilog

2022-02-11 Thread pd
Hi Alex,

On Wed, Feb 9, 2022 at 9:53 PM Alexander Burger  wrote:

>
> > > > : (? (factorial @X 120))
> > > > -> NIL
> > >
>
> > How should be declared factorial primitive to be compatible with reverse
> > lookup?
>
> I have not tried. How is it in real Prolog?
>

In modern prolog you use this form:

fac(0,1).
fac(N,X) :- N #> 0, A #= N - 1, X #= N * X1, fac(A,X1).

but it depends on CLP(FD) which is not implemented in pilog I'm afraid.

A workaround is using an accumulator for both then number and the
factorial, assuming factorial is defined for numbers > 0:

factorial(0,1).
factorial(X, XFact) :- f(X, 1, 1, XFact).
f(N, N, F, F) :- !.
f(N, N0, F0, F) :- succ(N0, N1), F1 is F0 * N1, f(N, N1, F1, F).

But it seems pilog doesn't manage properly this either:

(be fa (0 1))
(be fa (@X @XF) (f @X 1 1 @XF))
(be f (@N @N @F @F) T)
(be f (@N @N0 @F0 @F) (^ @N1 (inc (-> @N0))) (^ @F1 (* (-> @F0) (-> @N1)))
(f @N @N1 @F1 @F))

Now asking for factorial of 6 I get:

: (? (fa 6 @X))
@X=720
-> NIL

the other way works perfectly:

: (? (fa @X 6))
@X=3
-> NIL

: (? (fa @X 1))
@X=0
@X=1
-> NIL

but it haves problems when asking for factorial of 0:

: (? (fa 0 @X))
@X=1


2454 No memory
$

Similar behaviour when asking for factorial of 1,  this time pilogs appears
to hang out without doing nothing but if you press ctrl-C you get a clue
about where it stopped:

: (? (fa 1 @X))
@X=1


(inc (-> @N0))
! (inc (-> @N0))
! (inc (-> @N0))
!  (-> @N1)
! (inc (-> @N0))
! (inc (-> @N0))
! (inc (-> @N0))
.. (several ctrl-C hits)
$

Maybe introducing a predicate asserting N should be greater than 0 but I
didn't find the way.

A similar problem appears when defining list_length predicate, in prolog
you get:

ll([],0).
ll([H|T],N) :- ll(T,N1), N is N1 + 1.

?- ll(X,5).
X = [_606, _612, _618, _624, _630] .

?- ll(X,Y).
X = [],
Y = 0 ;
X = [_860],
Y = 1 ;
X = [_860, _866],
Y = 2 ;
X = [_860, _866, _872],
Y = 3 ;
X = [_860, _866, _872, _878],
Y = 4 ;
X = [_860, _866, _872, _878, _884],
Y = 5 ;
X = [_860, _866, _872, _878, _884, _890],
Y = 6 .

when trying to translate it to pilog I get:

(be ll (NIL 0))
(be ll ((@ . @T) @N) (ll @T @N0) (^ @N (inc (-> @N0

(? (ll NIL @X))
@X=0
-> NIL

(? (ll (1) @X))
@X=1
-> NIL

(? (ll (b a) @X))  #->  this is b(a) ? this is the syntax used
in "be" then it should be X=1
@X=2
-> NIL

(? (ll (b (a)) @X))#->  same here, semantics is not clear for me
@X=2
-> NIL

(? (ll @L 2))  # this apparently hangs
@L=(@ @)


(? (ll @L @M))
@L=NIL @M=0
@L=(@) @M=1
@L=(@ @) @M=2
@L=(@ @ @) @M=3
@L=(@ @ @ @) @M=4
..

which is ok


> To take an example a bit simpler than the factorial function, you could
> start
> with addition as:
>
>
That's a nice implementation of logic + specially your next post which
solves +(X,Y,4) for example. Still there's something I don't fully
understand, I will comment it in your next post.


> But where will that end? Should we also handle two or three variables,
> generating all combinations of natural numbers? This could surely be done
> (similar to what 'append/3' does for lists), but I never saw a need for
> that.
>
> Not really a pragmatical use or need, but it could be useful in some
situations. I really was testing how similar is pilog to real prolog.


> The second one. But I think it does not matter, you can pass any pattern
> to a
> predicate, it is matched in any case.
>
> but the way it matches it's important because you have to match compound
terms not treating them as lists


> > what is supposed to mean (be p (r (b))) if anything?
>
> Yeah, there is no "meaning". It is just a pattern.
>
>: (? (p @A @B))
> @A=r @B=(b)
>
>
but that matching corresponds to a prolog list or a prolog term?  I mean,
that matches with prolog [r b] or with prolog r(b) ?


>
> > May you explain the estructure of a pilog environment (and the use of
> unify
> > function)
>
> The environments are nested association lists, with numbers for the levels
> and
> then the symbols for the values at these levels.
>
> and levels are related to backtracking somehow?


regards


Re: some questions relating pilog

2022-02-11 Thread pd
On Thu, Feb 10, 2022 at 6:27 PM Alexander Burger 
wrote:

>
> Could not resist. I elaborated a little :)
>
> If we define '+' as
>
>(be + (@A @B @C)
>   (^ @C (+ @A @B))  T )
>
>(be + (@A @B @C)
>   (^ @B (- @C @A))  T )
>
>(be + (@A @B @C)
>   (^ @A (- @C @B))  T )
>
>(be + (@A 0 @A))
>
>(be + (@A @B @C)
>   (^ @Z (dec @C))
>   (+ @A @Y @Z)
>   (^ @B (inc @Y)) )
>
> then we can use it as
>
>: (? (+ 3 4 @X))
> @X=7
>
>: (? (+ 3 @X 7))
> @X=4
>
>: (? (+ @X 4 7))
> @X=3
>
>: (? (+ @X @Y 7))
> @X=7 @Y=0
> @X=6 @Y=1
> ...
>
>
I suppose pilog search for rules in order, so the goal  (? (+ 3 @X 7))
always matches first three rules with the cut, but shouldn't the last goal
match also one of the first three line thus avoiding backtracking?   I
think I don't fully understand how it works.

Also, when a goal return a non terminating list, what happend if we try the
function solve with it? is there any way to get an exception or a stream?

regards


error making pil21

2022-02-11 Thread pd
Hello,

I'm trying to build pil21 in a amd64 debian linux, I've tried pil21-12 and
pil21.tgz, both fails when making (cd src; make) with the error message
"error: expected relocatable expression .quad (SymTab+8)"  in
different lines, for example:

picolisp.s:152966:8 error: expected relocatable expression
.quad   (SymTab+8)&4294967295
^

Anybody got the same error message?

regards

-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


Re: some questions relating pilog

2022-02-15 Thread pd
On Sat, Feb 12, 2022 at 8:37 AM Alexander Burger 
wrote:

>
> > >(be + (@A @B @C)
> > >   (^ @C (+ @A @B))
> > >   T )
> > >
> > >(be + (@A @B @C)
> > >   (^ @B (- @C @A))
> > >   T )
> > I suppose pilog search for rules in order, so the goal  (? (+ 3 @X 7))
> > always matches first three rules with the cut,
>
> It tries the first one but does not succeed. The second one matches, so the
> others are not tried because of the cut.
>

This is interesting, in my understanding when matching the first rule it
should try to unify @C to the result of  @A + @B but since @B is @X  you
have @B unified to a variable or symbol and thus @B is not instantiated, it
has no value and so you cannot do the + operation, in my understanding you
should have got an exception or an error, in fact this is what you get in
prolog:

 ?- +(3,X,7).
   Call: (8) +(3, _7186, 7) ? creep
   Call: (9) 3 is 7-_7186 ? creep
ERROR: Arguments are not sufficiently instantiated
ERROR: In:
ERROR:[9] 3 is 7-_7806
ERROR:[8] +(3,_7832,7) at /prolog_.pl:30
ERROR:[7] 


I suppose what happens is first rule don't give an error trying to add @A
and @B, it simply fails and returns with @C not unified (not binded) and
thus the cut is never executed so it tries next rule, the second one, now
it succeeds and executes the cut stopping further matching.

In this case my question is, what value is binded to @B when passed to lisp
function + ?   is it nil maybe?   or function ^ detects an unbinded pilog
variable and just returns with false?


> but shouldn't the last goal
> > match also one of the first three line thus avoiding backtracking?
>
> A query like (+ @X @Y 7) will not be satisfied by the first four rules, so

finally the fifth fires (and finally terminates recursion with the fourth).
>

so this is the same case as before, this works because (^ @X (op @A @B))
fails when @A or @B are not binded, being possible to explorer other rule
matching

regards


Re: PicoLisp Matrix Room

2022-03-02 Thread pd
I'm in!  @reboludo:matrix.org

On Sun, Feb 27, 2022 at 3:21 PM Alexander Burger 
wrote:

> Hi all,
>
> Matrix (https://matrix.org) is an open, decentralized communicatio
> network. I
> like it, because it is federated and does not depend on a single server or
> provider.
>
> My user id is:
>
>@abu:7fach.de
>
> We created also a Matrix room for PicoLisp:
>
>#picolisp:7fach.de
>
> Please feel free to join!
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: PicoLisp Matrix Room

2022-03-02 Thread pd
No, I can't.

that chatroom is not available, when searching for picolisp I only got a
thai chat room about picolisp and a bridge to irc.  If I try to add the
server 7fach.de I get the error message "You have no access to chat list of
this server"


On Wed, Mar 2, 2022 at 3:05 PM Alexander Burger  wrote:

> Hi pd,
>
> > I'm in!  @reboludo:matrix.org
>
> Cool! Can you try to join #picolisp:7fach.de ?
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


penti keyboard

2022-03-10 Thread pd
Hello,

In today Pilcon I had an interest in penti keyboard and decided to test it
, so I've installed it from Android Store into my android 7.1.1 phone.

I had to activate it as a virtual keyboard and select it as default
keyboard, but when try to use it something is wrong, I see a word "Pent" in
the middle of screen and no circles at all and I cannot type anything, but
when moving the phone I see a lot of random symbols typed in.

Is there anything else necessary to install in order to use the keyboard?

regards

-- 
Andrés

*~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar
Wilde* ~


Re: penti keyboard

2022-03-10 Thread pd
>   How can I change the size of circles? and even better how can I
> recalibrate again to change circle positions?
>
>
Ok I see after a while not touching the phone the "Pent" letters appear
again and I have to calibrate it in order to use it, so it's easy to
recalibrate, just wait until "Pent" word appears.  But then is there any
way to save the current calibration?


Re: penti keyboard

2022-03-10 Thread pd
Hello,

I was playing a little and surprisingly it's fun and I'm not too dumb,
still I realized two facts:

- I'm not able to place all circles inside the screen
- my little finger is useless

I see almost all my questions and problems are explained in the link you
gave me about penti, so sorry for bothering you with my questions, I should
RTFM before asking.

On Thu, Mar 10, 2022 at 9:58 PM Alexander Burger 
wrote:

> On Thu, Mar 10, 2022 at 08:46:29PM +0100, pd wrote:
> > Ok I see after a while not touching the phone the "Pent" letters appear
> > again and I have to calibrate it in order to use it, so it's easy to
>
> This does not happen. Penti is reset only if you type Func-Space, or
> switch to
> another keyboard and then back to Penti.
>
>
I discovered the use case, it is when screen layout changes,  when I put my
phone on the table it turns the screen from vertical layout to
horizonatal layout and this makes "Penti" word appear on the screen and I
have to recalibrate.

It's a bit annoying but it's also logical to act this way since screen
dimensions change when you change layout, I suppose the obvious solution is
to block layout change

regards


Re: penti keyboard

2022-03-11 Thread pd
On Fri, Mar 11, 2022 at 7:03 AM Alexander Burger 
wrote:

> On Thu, Mar 10, 2022 at 10:43:57PM +0100, pd wrote:
> > - I'm not able to place all circles inside the screen
> > - my little finger is useless
>
> Really? So is the screen too small? But note that the circles do not have
> to fit
> all completely. The attached screenshot shows a typical layout convenient
> for me
> on a 6.41 inch screen.
>

not really so small but cannot fit all circles completely inside the
screen, some circles always get cut off, it doesn't matter because it's
fully operational but I consider a personal challenge to completely fill
all circles in screen ;-)


Re: PicoLisp REPL on Twitter

2022-04-19 Thread pd
Nice!

On Tue, Apr 19, 2022 at 7:36 AM Alexander Burger 
wrote:

> Hi all,
>
> I started a new Twitter account @picolispRepl
>
>https://twitter.com/picolispRepl
>
> >From time to time I will post tips and tricks as short code snippets.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: PicoLisp-22.6

2022-07-07 Thread pd
great!

On Wed, Jul 6, 2022 at 8:30 AM Alexander Burger  wrote:

> Hi all,
>
> PicoLisp-22.6 was released, and is now available in Debian Testing.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>