Re: Understanding spacing in Wiki edit

2018-05-25 Thread Alexander Burger
On Fri, May 25, 2018 at 06:35:00PM +0200, Arie van Wingerden wrote:
> Now I am *really* confused ... ;-) Forgive me my ignorance.

No problem :)


> I was talking about the Wiki, not about building a PicoLisp App.

Yes, me too. The code below is copy/pasted from
https://picolisp.com/wiki/?PilBox


> *Is this https://picolisp.com/wiki/?help 
> all the information on editing the Wiki?*

Yes. Except you go for the direct way and look at the sources in
https://software-lab.de/wiki.tgz

> It seems I miss quite some info (e.g. about centering, colors etc.)

There ain't any :)

♪♫ Alex


> 2018-05-25 18:08 GMT+02:00 Alexander Burger :
> 
> > On Fri, May 25, 2018 at 05:54:00PM +0200, Arie van Wingerden wrote:
> > > Solved!
> > >
> > > instead of writing:
> > >
> > > :{
> > > > lines of code
> > > > ...
> > > > ...
> > > > }
> > > >
> > > > New section
> > > >
> > >
> > > I should write:
> > >
> > > :{
> > > > lines of code
> > > > ...
> > > > ...}
> > > > New section
> >
> > I always used it in two ways.
> >
> > 1. Inline
> >
> >terminal program like :{Termux} with :{vim} or :{emacs},
> >
> > 2. As a block
> >
> >a single file :{App.l}. This file contains:
> >:{
> >   "Hello World"
> >
> >   (menu "Hello World!"
> >  ( "center blue" "Hello World!") )
> >}
> >The first line gives the App's name, and the :{menu} expression
> > displays a
> >
> > Thus, just between your versions :)
> > ♪♫ Alex
> >
> > --
> > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> >

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


Re: Understanding spacing in Wiki edit

2018-05-25 Thread Arie van Wingerden
Now I am *really* confused ... ;-) Forgive me my ignorance.

I was talking about the Wiki, not about building a PicoLisp App.

Question:
*Is this https://picolisp.com/wiki/?help 
all the information on editing the Wiki?*
It seems I miss quite some info (e.g. about centering, colors etc.)


2018-05-25 18:08 GMT+02:00 Alexander Burger :

> On Fri, May 25, 2018 at 05:54:00PM +0200, Arie van Wingerden wrote:
> > Solved!
> >
> > instead of writing:
> >
> > :{
> > > lines of code
> > > ...
> > > ...
> > > }
> > >
> > > New section
> > >
> >
> > I should write:
> >
> > :{
> > > lines of code
> > > ...
> > > ...}
> > > New section
>
> I always used it in two ways.
>
> 1. Inline
>
>terminal program like :{Termux} with :{vim} or :{emacs},
>
> 2. As a block
>
>a single file :{App.l}. This file contains:
>:{
>   "Hello World"
>
>   (menu "Hello World!"
>  ( "center blue" "Hello World!") )
>}
>The first line gives the App's name, and the :{menu} expression
> displays a
>
> Thus, just between your versions :)
> ♪♫ Alex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: Understanding spacing in Wiki edit

2018-05-25 Thread Alexander Burger
On Fri, May 25, 2018 at 05:54:00PM +0200, Arie van Wingerden wrote:
> Solved!
> 
> instead of writing:
> 
> :{
> > lines of code
> > ...
> > ...
> > }
> >
> > New section
> >
> 
> I should write:
> 
> :{
> > lines of code
> > ...
> > ...}
> > New section

I always used it in two ways.

1. Inline

   terminal program like :{Termux} with :{vim} or :{emacs},

2. As a block

   a single file :{App.l}. This file contains:
   :{
  "Hello World"

  (menu "Hello World!"
 ( "center blue" "Hello World!") )
   }
   The first line gives the App's name, and the :{menu} expression displays a

Thus, just between your versions :)
♪♫ Alex

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


Re: Understanding spacing in Wiki edit

2018-05-25 Thread Arie van Wingerden
Solved!

instead of writing:

:{
> lines of code
> ...
> ...
> }
>
> New section
>

I should write:

:{
> lines of code
> ...
> ...}
> New section
>



2018-05-25 17:01 GMT+02:00 Arie van Wingerden :

> Hi Alex,
>
> think I found out why the spacing was different.
>
> *Spacing is BIGGER directly after a :{} code section than after a line of
> text.*
>
> So I just put a line of text after the last piece of code before a new
> "section" (underlined line).
>
> Maybe there is a way to change that behavior, because it seems to be
> inconsistent.
>
> Question:
> *Is this https://picolisp.com/wiki/?help 
> all the information on editing the Wiki.*
> *I saw somewhere a construct to center things on a line ... but that's not
> in that doc.*
>
> Thx!
>Arie
>
>
>
> 2018-05-25 15:35 GMT+02:00 Alexander Burger :
>
>> Hi Arie,
>>
>> > I can't get spacing between lines as I want it.
>> > Tried with just empty lines and also with &{n}.
>>
>> Strange, why should this not work? "&{n}" is fine.
>>
>> > I'd like to have exactly one blank line before each underlined line.
>> > https://picolisp.com/34809/7667136248745052~?pce-de-function
>>
>> (For the records:
>>The permanent link would be https://picolisp.com/wiki/?pcedefunction )
>>
>> I can see the s in the generated HTML. Is this not OK?
>>
>> ♪♫ Alex
>>
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>
>


Re: Request

2018-05-25 Thread Alexander Burger
Hi Arie,

> OK. Maybe it then should be in that readme?

The README file has no http links.

And just "WSL" would not be understandable probably.

♪♫ Alex

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


Re: Understanding spacing in Wiki edit

2018-05-25 Thread Arie van Wingerden
Hi Alex,

think I found out why the spacing was different.

*Spacing is BIGGER directly after a :{} code section than after a line of
text.*

So I just put a line of text after the last piece of code before a new
"section" (underlined line).

Maybe there is a way to change that behavior, because it seems to be
inconsistent.

Question:
*Is this https://picolisp.com/wiki/?help 
all the information on editing the Wiki.*
*I saw somewhere a construct to center things on a line ... but that's not
in that doc.*

Thx!
   Arie



2018-05-25 15:35 GMT+02:00 Alexander Burger :

> Hi Arie,
>
> > I can't get spacing between lines as I want it.
> > Tried with just empty lines and also with &{n}.
>
> Strange, why should this not work? "&{n}" is fine.
>
> > I'd like to have exactly one blank line before each underlined line.
> > https://picolisp.com/34809/7667136248745052~?pce-de-function
>
> (For the records:
>The permanent link would be https://picolisp.com/wiki/?pcedefunction )
>
> I can see the s in the generated HTML. Is this not OK?
>
> ♪♫ Alex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: Request

2018-05-25 Thread Arie van Wingerden
OK. Maybe it then should be in that readme?

2018-05-25 15:26 GMT+02:00 Alexander Burger :

> On Fri, May 25, 2018 at 02:04:02PM +0200, Arie van Wingerden wrote:
> > maybe it is useful to reference the Windows WSL installation Wiki page
> also
> > here:
> >https://software-lab.de/down.html
> >
> > The link is:
> >https://picolisp.com/wiki/?WSL
>
> Yes. However, I just notice that down.html contains some things which are
> no
> longer correct.
>
> It runs no longer on 32-bit Mac OS (due to clang) and also not on 64-bit
> Macs
> (needs x86-64 position independent code). And it never ran fully on Cygwin.
>
> So I better remove this stuff altogether, and just point to the README
> file.
>
> ♪♫ Alex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: Understanding spacing in Wiki edit

2018-05-25 Thread Alexander Burger
Hi Arie,

> I can't get spacing between lines as I want it.
> Tried with just empty lines and also with &{n}.

Strange, why should this not work? "&{n}" is fine.

> I'd like to have exactly one blank line before each underlined line.
> https://picolisp.com/34809/7667136248745052~?pce-de-function

(For the records:
   The permanent link would be https://picolisp.com/wiki/?pcedefunction )

I can see the s in the generated HTML. Is this not OK?

♪♫ Alex

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


Re: Request

2018-05-25 Thread Alexander Burger
On Fri, May 25, 2018 at 02:04:02PM +0200, Arie van Wingerden wrote:
> maybe it is useful to reference the Windows WSL installation Wiki page also
> here:
>https://software-lab.de/down.html
> 
> The link is:
>https://picolisp.com/wiki/?WSL

Yes. However, I just notice that down.html contains some things which are no
longer correct.

It runs no longer on 32-bit Mac OS (due to clang) and also not on 64-bit Macs
(needs x86-64 position independent code). And it never ran fully on Cygwin.

So I better remove this stuff altogether, and just point to the README file.

♪♫ Alex

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


Understanding spacing in Wiki edit

2018-05-25 Thread Arie van Wingerden
Hi Alex,

I can't get spacing between lines as I want it.

Tried with just empty lines and also with &{n}.

I'd like to have exactly one blank line before each underlined line.

https://picolisp.com/34809/7667136248745052~?pce-de-function

Any idea?

(I will update later with latest remarks)

Thx,
   Arie


Re: Public link to my PicoLisp notes in EvenNote

2018-05-25 Thread Alexander Burger
On Fri, May 25, 2018 at 01:23:00PM +0200, Arie van Wingerden wrote:
> I've rewritten the article, but not yet on the Wiki. I cleaned up a lot of
> unnecessary markup stuff.
> I'll post it within this mail.Please comment before I put it up on the Wiki!

OK

>- nil and t are just symbols (yoy could define a function using those as
>names). NIL and T are the boolean values for False and True

Yes, but what I meant is that 'nil' and 't' *are* already functions. You
can redefine them though.


>- NIL is equal to the empty list () since: (= NIL ())

Yes, and much more, see: https://software-lab.de/doc/ref.html#nilSym


> --
> Value of symbol 'de'
> 
> :de
> -> 266836
> 
> returns the address of function 'de' in memory
> 
> --
> Function 'de' accepts 2 arguments, which are by default NIL

I would not explicitly stress here that arguments default to NIL,
as this a general automatic mechanism, not specific to 'de'.

Also, to be exact, 'de' is not restricted to 2 arguments. It is a function which
expects an arbitrary number of arguments, and which does not evaluate them (i.e.
an FEXPR (or, more correct, an FSUBR as it is a built-in)).

### ... all correct ... ###

> : (de x (a b) (println a) (println b) (println (+ a b))  (+ 5 6))
> -> x
> 
> : x
> -> ((a b) (println a) (println b) (println (+ a b)) (+ 5 6))
> 
> where a and b are the formal parameters and we also see 4 expressions in
> the function body

This is correct too, but I would recommend to stick to the naming conventions
and use upper-case names for parameters and local variables.

: (de x (A B) (println A) (println B) (println (+ A B))  (+ 5 6))


> : (setq x '((p q) (println p) (println q) (+ p q)))
> -> ((p q) (println p) (println q) (+ p q))

Same here, better is P and Q and later X and Y.

Good! :)

♪♫ Alex

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


Request

2018-05-25 Thread Arie van Wingerden
Hi Alex,

maybe it is useful to reference the Windows WSL installation Wiki page also
here:
   https://software-lab.de/down.html

The link is:
   https://picolisp.com/wiki/?WSL

Thx
   Arie


Re: Public link to my PicoLisp notes in EvenNote

2018-05-25 Thread Arie van Wingerden
I've rewritten the article, but not yet on the Wiki. I cleaned up a lot of
unnecessary markup stuff.
I'll post it within this mail.Please comment before I put it up on the Wiki!

The de-function

--
Reference: https://software-lab.de/doc/refD.html#de

--
Notes upfront

   - before each example, PicoLisp is restarted to avoid side effects


   - nil and t are just symbols (yoy could define a function using those as
   names). NIL and T are the boolean values for False and True


   - NIL is equal to the empty list () since: (= NIL ())


--
Value of symbol 'de'

:de
-> 266836

returns the address of function 'de' in memory

--
Function 'de' accepts 2 arguments, which are by default NIL

:(de)
!? (de)
NIL -- Protected symbol

is equivalent to

: (de NIL NIL)
!? (de NIL NIL)
NIL -- Protected symbol

redefining NIL is not allowed

--
First argument of 'de' must be a (unprotected) symbol

: (de 1)
!? (de 1)
1 -- Symbol expected

--
Function 'de' just sets a symbol to some value (which *can* be a function
definition)

: (de x a b c)
-> x

: x
-> (a b c)

which is (under the hood) equivalent to

: (de x . (a b c))
-> x
: x
-> (a b c)

which explains why a function can have multiple body expressions

: (de x (a b) (println a) (println b) (println (+ a b))  (+ 5 6))
-> x

: x
-> ((a b) (println a) (println b) (println (+ a b)) (+ 5 6))

where a and b are the formal parameters and we also see 4 expressions in
the function body

: (x 1 2)
1->output of first 'println'
2->output of second 'println'
3->output of third 'println'
-> 11->result of the expression (+ 5 6)

--
The function 'de' isn't really needed (e.g. for creating a function
definition)

: (setq x '((p q) (println p) (println q) (+ p q)))
-> ((p q) (println p) (println q) (+ p q))

: x
-> ((p q) (println p) (println q) (+ p q))

: (x 1 2)
1
2
-> 3

--
Also a function definition is nothing special, It is just a list

: (de x (x y) (println x) (println y) (+ x y))
-> x

: x
-> ((x y) (println x) (println y) (+ x y))

: (car x)
-> (x y)

: (cadr x)
-> (println x)

: (caddr x)
-> (println y)

: (cadddr x)
-> (+ x y)

--
Conclusion

So in general, 'de' is a very uninteresting function. You could use 'set'
or 'setq' instead:  (set 'x '(a b c)) or (setq x '(a b c))
-- Alexander Burger


2018-05-25 12:39 GMT+02:00 Alexander Burger :

> Hi Arie,
>
> > In order to get things right, I will rewrite the article and put it on
> the
> > Wiki.
> > Personally I find this a very nice way to try and also learn a lot, even
> > with "very uninteresting functions".
>
> Indeed! And "uninteresting" was perhaps the wrong word :)
>
> ♪♫ Alex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: Public link to my PicoLisp notes in EvenNote

2018-05-25 Thread Alexander Burger
Hi Arie,

> In order to get things right, I will rewrite the article and put it on the
> Wiki.
> Personally I find this a very nice way to try and also learn a lot, even
> with "very uninteresting functions".

Indeed! And "uninteresting" was perhaps the wrong word :)

♪♫ Alex

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


Re: Public link to my PicoLisp notes in EvenNote

2018-05-25 Thread Arie van Wingerden
Hi Alex!


A bit tedious is that evernote needs JavaScript. I have JS off by default
> in Chrome, and use I mostly w3m anyway.
>

​Haha! Could have guessed you'd use a more minimalist​ (pico)browser :-)
Well, I'll dive deeper into the Wiki then for the better ...


> "nil is just a symbol" could well be "'nil' is a function". Same for 't'
>

​Yes. I did understand that. But is is OK to write that down explicitly.​


> 'de' can be used to define *anything*, not just functions. Functions are
> just data anyway.
>

​Yes. That was what I concluded.​


> (de) gives a "protected symbol" error, because it is in fact (de NIL NIL)
> (unsupplied arguments are NIL in pil), so it tries to redefine NIL
>

​Right!​


> Well, 'de'
> does not list anything, it just 'set's a value: (de x a b c) is (de x . (a
> b c))
> so the first arg (here 'x') is set to the CDDR (here (a b c)). The list (a
> b c)
> is not built here, it is only a pointer move. The list itself has been
> built by
> the Lisp reader.
>

​OK; clear!​


> So in general, 'de' is a very uninteresting function. You could use 'set'
> or 'setq' instead:  (set 'x '(a b c)) or (setq x '(a b c))
>

​I found that more or less out.

In order to get things right, I will rewrite the article and put it on the
Wiki.
Personally I find this a very nice way to try and also learn a lot, even
with "very uninteresting functions".

Thx!
   Arie


Re: Public link to my PicoLisp notes in EvenNote

2018-05-25 Thread Alexander Burger
Hi Arie,

> here is the public link:
>https://www.evernote.com/pub/hotcore/picolisp
> 
> There are 2 ways to use it:
> 1. just use the link in a browser

A bit tedious is that evernote needs JavaScript. I have JS off by default
in Chrome, and use I mostly w3m anyway.


A few notes:

"nil is just a symbol" could well be "'nil' is a function". Same for 't'

'de' can be used to define *anything*, not just functions. Functions are
just data anyway.

(de) gives a "protected symbol" error, because it is in fact (de NIL NIL)
(unsupplied arguments are NIL in pil), so it tries to redefine NIL

"Because de always lists its arguments except for the first one". Well, 'de'
does not list anything, it just 'set's a value: (de x a b c) is (de x . (a b c))
so the first arg (here 'x') is set to the CDDR (here (a b c)). The list (a b c)
is not built here, it is only a pointer move. The list itself has been built by
the Lisp reader.

Same in "Without arguments beyond the first, it thus creates an empty list".
Nothing is created, only the pointer to NILT moved into the value cell of 'x'


So in general, 'de' is a very uninteresting function. You could use 'set'
or 'setq' instead:  (set 'x '(a b c)) or (setq x '(a b c))

♪♫ Alex

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


Re: Ins and outs of the 'de' function

2018-05-25 Thread O.Hamann

If you feel comfortable, yes, please do, Arie!

Greetings from a (most-of-the-time) reader :-)


On 24.05.2018 20:00, Arie van Wingerden wrote:

[...]

If and only if such things will be appreciated, I intend to continue bit by
bit to create some useful docs with examples and a bit of extra explanation



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


Re: Ins and outs of the 'de' function

2018-05-25 Thread Arie van Wingerden
Hi all,

thx for the heads up!
I will continue then :-)

@michel that's indeed interesting. It confirms my findings that any well
formed list can be used as a function.

Thx,
  Arie

2018-05-25 7:50 GMT+02:00 Manuel Cano :

> Yeah go ahead! I'll surelly read it. (I always need some explanation! ;)
>
> Kind regards,
> Manu
>
> 2018-05-24 20:00 GMT+02:00 Arie van Wingerden :
>
>> Hi,
>>
>> since first contact with PicoLisp I was convinced to it's possibilities,
>> the small footprint and the extra's built-in, like GUI and DB.
>>
>> Since I've got some spare time, I am now trying to get a better grasp on
>> things.
>>
>> Yesterday I already posted about some trial and error.
>> Today, I tried to approach one function (de) in a structured manner and
>> wrote it down.
>>
>> If and only if such things will be appreciated, I intend to continue bit
>> by
>> bit to create some useful docs with examples and a bit of extra
>> explanation
>
>
>


Re: Latest (better) way to install PicoLisp on Windows WSL + Question

2018-05-25 Thread Arie van Wingerden
Hi,

pil -version -bye
18.2.17

HTH,
   Arie

2018-05-25 10:37 GMT+02:00 O.Hamann :

> Thank you for updating your recipes, Arie!
>
> Could you please have a look and tell, which version of picolisp you got
> by this procedure?
>
> I think " pil -version -bye " or similar on the commandline should do.
>
> Kind regards.
>
>
> On 20.05.2018 14:44, Arie van Wingerden wrote:
>
>> Hi all,
>>
>> as I had to fight the first time to get WSL and PicoLisp working, I
>> now just overlooked the easy way ;-)
>>
>> The steps involved in installing WSL/Ubuntu and PicoLisp can now be
>> reduced to just:
>>
>> *Start the "Microsoft Store" App:
>> 01. search for "Ubuntu"
>> 02. install latest Ubuntu version (currently 18.04)
>> Ubuntu Bash shell opens during last step:
>> 01. you are asked for your User name and Password (twice)
>> 02. update Ubuntu (packages):sudo apt-get update
>> sudo apt-get upgrade
>> sudo apt-get dist-upgrade
>> sudo apt autoremove
>> sudo apt-get update
>> 04. go into your home directory:
>> cd ~
>> 05. install PicoLisp:
>> sudo apt install PicoLisp*
>>
>>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: Latest (better) way to install PicoLisp on Windows WSL + Question

2018-05-25 Thread O.Hamann

Thank you for updating your recipes, Arie!

Could you please have a look and tell, which version of picolisp you got 
by this procedure?


I think " pil -version -bye " or similar on the commandline should do.

Kind regards.


On 20.05.2018 14:44, Arie van Wingerden wrote:

Hi all,

as I had to fight the first time to get WSL and PicoLisp working, I
now just overlooked the easy way ;-)

The steps involved in installing WSL/Ubuntu and PicoLisp can now be
reduced to just:

*Start the "Microsoft Store" App:
01. search for "Ubuntu"
02. install latest Ubuntu version (currently 18.04)
Ubuntu Bash shell opens during last step:
01. you are asked for your User name and Password (twice)
02. update Ubuntu (packages):sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt autoremove
sudo apt-get update
04. go into your home directory:
cd ~
05. install PicoLisp:
sudo apt install PicoLisp*



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