Re: pil21 on Mac, some errors

2020-11-09 Thread Jon Kleiser
Hi Alex,

Yes, but after the Ctrl-D I have to click in the cube window to make it go 
away. OK as long as one knows this.

The pil21 now seems to be usable on macOS, however, the "(cd src; make)” did 
not work for me; I got some errors. I used the instructions at 
https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md 
 instead.

/Jon

> On 9 Nov 2020, at 09:11, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> All three misc examples now worked quite fine.
> 
> Great! So we can say pil21 is usable on MacOS.
> 
> 
>> The only problem I had, was exiting the cube.l in a nice way. I can maybe 
>> take
>> a look at that tomorrow.
> 
> Just press Ctrl-D at the REPL prompt.
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-08 Thread Jon Kleiser
Hi all,

I now installed a fresh pil21 from https://software-lab.de/pil21.tgz 
, followed the build instructions at 
https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md 
, and 
used the modified lib/openGl.l that I had from my previous try. All three misc 
examples now worked quite fine. The only problem I had, was exiting the cube.l 
in a nice way. I can maybe take a look at that tomorrow.
It was nice to see my old pyramids.l working again. I still haven’t got around 
to have something similar working with WebGL in the browser. ;-)
Thanks for the nice work!

/Jon

> On 8 Nov 2020, at 17:02, Alexander Burger  wrote:
> 
> Hi Andras,
> 
>> On Ubuntu only -D_GNU_SOURCE helps, -D__USE_GNU is not enough.
> 
> On plain Debian, only _GNU_SOURCE still gives an error. So I've defined both 
> now
> (in @src/lib.c, to keep it local).
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> 



Re: pil21 on Mac, some errors

2020-11-07 Thread Jon Kleiser
Hi Alex,

I have now changed lib/openGl.l as you described, and when I do
$ ./pil misc/sphere.l +
then I get a nice sphere.

If I do
$ ./pil misc/cube.l +
then I get a window with a gray background, but no visible cube.

If I do
$ ./pil misc/pyramids.l +
then I get no graphics, only this:
[misc/pyramids.l:182] !? (%@ "cos" 100 "Dbl1")
Bad ffi
openGl? 

In my opinion, the *OS value on macOS should be "macOS", as that’s the correct 
spelling according to Apple.

/Jon

> On 7 Nov 2020, at 11:31, Alexander Burger  wrote:
> 
> On Sat, Nov 07, 2020 at 11:14:13AM +0100, Andras Pahi wrote:
>> I’ve checked Alex’s code on my picoLisp fork only.
>> What is the value of *OS on pil21 ?
>> It seems, that it is NOT “Darwin”, because *GlutLib is “libglut.so.3” 
>> instead of “GLUT.framework/GLUT"
> 
> Yes, I have already changed
> 
>   < (if (= *OS "Darwin")
>   ---
>> (if (= *OS "Macos")
>   17,18c17,18
>   <   *GluLib "libGLU.so.1"
>   <   *GlutLib "libglut.so.3" ) )
>   ---
>>  *GluLib "libGLU.so"
>>  *GlutLib "libglut.so" ) )
> 
> in lib/openGl.l
> 
> Not sure what the right lib names are, depending
> on the system.
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> 


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



Re: pil21 on Mac, some errors

2020-11-07 Thread Jon Kleiser
Hi Andras,

I have now modified my openGl.l the same way, but I still get this:

[misc/cube.l:13] !? (native "libglut.so.3" "glutInit" NIL '(NIL (8) . 0))
"libglut.so.3" -- [DLL] dlopen(libglut.so.3, 9): image not found
openGl? 

Am I missing some libglut.so? I have macOS Mojave 10.14.6.

/Jon

> On 5 Nov 2020, at 19:42, Andras Pahi  wrote:
> 
> Hi all,
> 
> I’ve modified openGl.l as follows:
> 
> (if (= *OS "Darwin")
>(default
>   *GluLib "OpenGL.framework/OpenGL"
>   *GlutLib "GLUT.framework/GLUT"
>   *GlutCheckEvent "glutCheckLoop" )
>(default
>   *GluLib "libGLU.so.1"
>   *GlutLib "libglut.so.3"
>   *GlutCheckEvent "glutMainLoopEvent" ) )
> 
> ...
> (de glutMainLoopEvent ()
>(native `*GlutLib `*GlutCheckEvent) )
> 
> Regards,
> Andras
> 
>> On 2020. Nov 5., at 19:35, Andras Pahi > > wrote:
>> 
>> Hi all,
>> 
>> You need to change glutMainLoopEvent to glutCheckLoop on MacOS.
>> Everything works as expected on my fork (not pil21, sorry).
>> 
>> I have attached the screenshots.
>> 
>> Regards,
>> Andras
>> 
>> 
>> 
>> 
>>> On 2020. Nov 5., at 19:00, Alexander Burger >> > wrote:
>>> 
>>> On Thu, Nov 05, 2020 at 07:50:01PM +0200, Mike wrote:
 
> I hear from Mike that "Darwin" is not correct for pil21.
> 
> "Macos"?
 
 This is not issue anymore, I have manually disabled this if to use correct 
 definitions. 
>>> 
>>> Right. But it is needed so that it also runs on other systems.
>>> The else-bodo of the 'if' works for me under Debian.
>>> 
>>> ☺/ A!ex
>>> 
>>> -- 
>>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe 
>>> 
>> 
> 



Re: pil21 on Mac, some errors

2020-11-05 Thread Jon Kleiser
Hi Alex,

I tried
$ ./pil misc/cube.l +

and then I got

[misc/cube.l:13] !? (native "libglut.so.3" "glutInit" NIL '(NIL (8) . 0))
"libglut.so.3" -- [DLL] dlopen(libglut.so.3, 9): image not found
openGl? 

/Jon

> On 4 Nov 2020, at 21:28, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> I have put the files into lib and misc.
> 
> This is all right.
> 
> 
>> However, I have not installed pil21 "globally" with required symlinks. When I
> 
> This is also good. Here on my systems I haven't installed it globally either 
> (I
> usually leave the Linux distro's (older) version global as it is).
> 
> 
>> cd to my pil21 directory and then do
>> $ pil21 misc/cube.l
> 
> Out of the box, the command is
> 
>   $ cd pil21
>   $ ./pil misc/cube.l +
> 
> or anything analog, like
> 
>   $ pil21/pil pil21/misc/cube.l +
> 
> i.e. with relative pathes.
> 
> (the '+' is optional, as ever)
> 
> 
>> then I get this:
>> 
>> [misc/cube.l:6] !? (load "@lib/openGl.l")
>> "@lib/openGl.l" -- Open error: No such file or directory
> 
> PicoLisp determines the value of "@.." from the start path. I don't know what
> 'pil21' is in your case.
> 
> 
>> What is the minimal thing (symlink) I have to fix for the lib/openGl.l to be
>> found?
> 
> If you really want to install it globally, I believe the description in the
> INSTALL file is correct.
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> 


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



Re: pil21 on Mac, some errors

2020-11-04 Thread Jon Kleiser
Hi Alex,

I have put the files into lib and misc. However, I have not installed pil21 
"globally" with required symlinks. When I cd to my pil21 directory and then do
$ pil21 misc/cube.l
then I get this:

[misc/cube.l:6] !? (load "@lib/openGl.l")
"@lib/openGl.l" -- Open error: No such file or directory
? 

What is the minimal thing (symlink) I have to fix for the lib/openGl.l to be 
found?

/Jon

> On 2 Nov 2020, at 09:59, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> I look forward to refresh my PicoLisp knowledge. ;-)
> 
> If you like to experiment:
> 
> I have updated the OpenGL library in @lib/openGl.l (now using a namespace) and
> put it together with some of your demo files (cube, sphere and pyramid) into a
> separate tarball:
> 
>   https://software-lab.de/openGl.tgz
> 
> The reason is that I want to keep the core pil21 distribution small.
> 
> Not sure if it already works on MacOS. As Mike pointed out, there may still be
> issues with the 'native' calls.
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


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



Re: pil21 on Mac, some errors

2020-10-27 Thread Jon Kleiser
Hi Mike,

I now started with a fresh pil21 source and followed your updated macOS 
instructions. This time I got no error messages. Thanks!

My setup is this:

macOS Mojave 10.14.6
llvm 11.0.0
libffi 3.3
ncurses 6.2
readline 8.0.4

I look forward to refresh my PicoLisp knowledge. ;-)

/Jon

> On 26 Oct 2020, at 18:13, Mike  wrote:
> 
> October 26, 2020 10:08 AM, "Jon Kleiser"  wrote:
> 
>> Hi,
>> 
>> Yesterday I tried installing pil21 on my Mac, following Mike Pechkin's 
>> instructions here:
>> 
>> https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md
>> 
>> Here’s the output from the last line:
>> 
>> $ gcc sysdefs.c && ./a.out > ../lib/sysdefs
>> sysdefs.c:45:21: error: use of undeclared identifier '_OS'
>> printf("# %s\n", _OS);
>> ^
>> sysdefs.c:46:21: error: use of undeclared identifier '_CPU'
>> printf("# %s\n", _CPU);
>> ^
>> 2 errors generated.
>> 
>> And here’s the output from my first attempt to use pil:
>> 
>> $ ../pil
>> [../lib/net.l:3] !? (in (or "Alt" "@lib/sysdefs") (if (from (pack "^J[" 
>> "Sym" "]^J")) (while (and
>> (skip) (<> "[" @)) (def (read) (read))) (quit "No sysdefs" "Sym")))
>> "@lib/sysdefs" -- Open error: No such file or directory
>> ?
>> : (version)
>> 21.0.0
>> -> (21 0 0)
>> : (bye)
>> 
>> Is there some easy fix to get rid of these errors?
>> 
> 
> I've updated and tested Macos compilation:
> https://git.envs.net/mpech/pil21-tests/commit/fa7dee9050b736ecc9067433e3c0006b71a5e514
> 
> In general MacOs platform works except (native) interface.
> It requires additional research in portability.
> 
> (mike)
> 
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> 


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



pil21 on Mac, some errors

2020-10-26 Thread Jon Kleiser
Hi,

Yesterday I tried installing pil21 on my Mac, following Mike Pechkin's 
instructions here:
https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md 


Here’s the output from the last line:

$ gcc sysdefs.c && ./a.out > ../lib/sysdefs
sysdefs.c:45:21: error: use of undeclared identifier '_OS'
   printf("# %s\n", _OS);
^
sysdefs.c:46:21: error: use of undeclared identifier '_CPU'
   printf("# %s\n", _CPU);
^
2 errors generated.

And here’s the output from my first attempt to use pil:

$ ../pil
[../lib/net.l:3] !? (in (or "Alt" "@lib/sysdefs") (if (from (pack "^J[" "Sym" 
"]^J")) (while (and (skip) (<> "[" @)) (def (read) (read))) (quit "No sysdefs" 
"Sym")))
"@lib/sysdefs" -- Open error: No such file or directory
? 
: (version)
21.0.0
-> (21 0 0)
: (bye)

Is there some easy fix to get rid of these errors?

/Jon

Re: PicoLisp in Wikipedia

2020-06-29 Thread Jon Kleiser
It’s best if others can come up with the ideas for improvement. For the most of 
the summer I will be concentrating on some JavaScript/TypeScript project of 
mine, when not enjoying outdoors activity.
Have a nice, safe summer!

/Jon

> On 29 Jun 2020, at 16:07, Alexander Burger  wrote:
> 
> On Mon, Jun 29, 2020 at 08:08:53AM -0400, r cs wrote:
>> Sure Alex, I would be happy to do that.
> 
> Great! Thanks a lot! :)
> 
> It would be really nice if you, Jon, and perhaps others, could improve that
> page. It is very bad as it is currently. Any ideas are welcome!
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


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


Re: PicoLisp in Wikipedia

2020-06-29 Thread Jon Kleiser
Hi Alex,

I can edit that page, if you tell me when and what to write. I see that the 
“Stable release 20.6” is now in the box on the right.

/Jon

> On 29 Jun 2020, at 10:29, Alexander Burger  wrote:
> 
> Hi all,
> 
> today I released picoLisp-20.6.
> 
> During those releases every half year, I also fix every time the "latest 
> release
> version" and "latest release date" in the PicoLisp page in Wikipedia
> 
>   https://en.wikipedia.org/wiki/Picolisp
> 
> 
> However, since quite sime time, Wikipedia complains:
> 
>   A major contributor to this article appears to have a close connection with
>   its subject. It may require cleanup to comply with Wikipedia's content
>   policies, particularly neutral point of view.
> 
> Naturally, because I adjust these fields every half year, and I'm the only who
> touched this page since several years.
> 
> So it is not good if *I* maintain this page (sigh).
> 
> Is there anyone interested to do that?
> 
> Thanks!! :)
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


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



Re: Time to say goodbye

2020-05-16 Thread Jon Kleiser
Hi Christophe,

Thanks a lot for friendly words. It would be fun to watch some sessions from 
the upcoming PilCon 2020.
I’m just recovering from the final episode of Le Bureau. ;-)

/Jon

> On 16 May 2020, at 17:01, Christophe Gragnic  
> wrote:
> 
> On Mon, Feb 10, 2020 at 5:06 PM Jon Kleiser  wrote:
>> 
>> Hi Alexander and the rest,
> 
> Hi Jon,
> Just a big thanks, 3 months later, to you Jon.
> You were very helpful and unlocked many possibilities for my project
> that used EmuLisp.
> Maybe we'll see you at PilCon 2020 that we'll have to organize remotely.
> 
> chri
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


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



Re: pil21, some progress

2020-02-12 Thread Jon Kleiser
Hi Jean-Christophe,

If you find llvm-link by doing "which llvm-link”, and get something like this:
/usr/local/opt/llvm/bin/llvm-link
and you have added the two exports to your ~/.bash_profile, then I think you 
only need to make a new terminal window or tab for these exports to take effect.
(In brew there is no separate formula with the name "llvm-link”.)

/Jon

> On 13 Feb 2020, at 05:02, Jean-Christophe Helary 
>  wrote:
> 
> 
> 
>> On Feb 13, 2020, at 1:50, Alexander Burger  wrote:
>> 
>> Hi Jean-Christophe and Kashyap,
>> 
>>> Quick related question - I can build pl21 using LLVM target on Linux right?
>>> I am planning to give it a shot on docker this weekend.
>> 
>> It should require just these steps:
>> 
>>  apt install make clang llvm libffi pkg-config
>>  tar xfz pil21.tgz
>>  cd pil21
>>  (cd src; make) && bin/picolisp
> 
> I seem to have all the required packages intalled with brew on macos but I 
> get this error:
> 
> make: llvm-link: No such file or directory
> make: *** [picolisp.bc] Error 1
> 
> 
> Jean-Christophe 
> 
>> 
>> (or analog for other package managers).
>> 
>> Note that a running PicoLisp is no longer required for bootstrapping (as it 
>> is
>> for pil64), because a pre-built src/base.bc is included in the release.
>> 
>> ☺/ A!ex
>> 
>> -- 
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> 
> Jean-Christophe Helary
> ---
> http://mac4translators.blogspot.com @brandelune
> 
> 
> 
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


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


Re: pil21, some progress

2020-02-12 Thread Jon Kleiser
Hi Jean-Christophe,

It seems I have my llvm installed by “brew install llvm”, and that probably 
also gave me llvm-config. If I do
llvm-config --version , then I get 9.0.0. If I do which llvm-config , then I get
/usr/local/opt/llvm/bin/llvm-config
You can check if you have libffi by doing “brew info libffi” If you have to 
install it, or try to upgrade it, you will probably (if I remember correctly) 
get a suggestion of putting these two lines into your ~/.bash_profile:

export LDFLAGS="-L/usr/local/opt/libffi/lib"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig”

I’m using macOS Mojave, 10.14.6.

/Jon


> On 12 Feb 2020, at 17:15, Jean-Christophe Helary 
>  wrote:
> 
> Jon,
> 
> Would you mind describing how you build pil21 ? I don't seem to be able to 
> "make" it (no pun intended).
> 
> JC
> 
>> On Feb 12, 2020, at 23:00, Jon Kleiser  wrote:
>> 
>> Hi Alex,
>> 
>> Great! Now it works. I just did a “(+ 2 3 4 5)” and got 14. ;-)
>> What’s the most important things missing? Functions or stability?
>> 
>> /Jon
>> 
>>> On 12. Feb, 2020, at 13:16, Alexander Burger  wrote:
>>> 
>>> Hi Jon,
>>> 
>>>> I have now made some progress in building pil21 on my Mac.
>>> 
>>> Good! :)
>>> 
>>> 
>>>> lib.c:7:35: warning: format specifies type 'unsigned long' but the 
>>>> argument has type 'int64_t'
>>>>(aka 'long long') [-Wformat]
>>>> fprintf(stderr, "%s %lX\n", s, n);
>>> 
>>> I see, that's an easy one. Just a warning - I fixed it here now by changing 
>>> the
>>> line 7 in src/lib.c to
>>> 
>>> fprintf(stderr, "%s %lX\n", s, (unsigned long)n);
>>> 
>>> Will be in the next release.
>>> 
>>> The rest of 'make' went through without cemplaints?
>>> 
>>> 
>>>> I noticed that there’s a mail link to me on the
>>>> https://software-lab.de/down.html page. You may change my mail address 
>>>> there
>>>> to jon.klei...@icloud.com.
>>> 
>>> Ah, thanks! Changed.
>>> 
>>>> And the two file links there (gl.tgz and china.tgz)
>>>> will probably go 404 in a few months.
>>> 
>>> OK, I see. I removed them from down.html
>>> 
>>> 
>>> -- 
>>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> 
> 
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21, some progress

2020-02-12 Thread Jon Kleiser
Hi Alex,

Great! Now it works. I just did a “(+ 2 3 4 5)” and got 14. ;-)
What’s the most important things missing? Functions or stability?

/Jon

> On 12. Feb, 2020, at 13:16, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> I have now made some progress in building pil21 on my Mac.
> 
> Good! :)
> 
> 
>> lib.c:7:35: warning: format specifies type 'unsigned long' but the argument 
>> has type 'int64_t'
>>  (aka 'long long') [-Wformat]
>>   fprintf(stderr, "%s %lX\n", s, n);
> 
> I see, that's an easy one. Just a warning - I fixed it here now by changing 
> the
> line 7 in src/lib.c to
> 
>   fprintf(stderr, "%s %lX\n", s, (unsigned long)n);
> 
> Will be in the next release.
> 
> The rest of 'make' went through without cemplaints?
> 
> 
>> I noticed that there’s a mail link to me on the
>> https://software-lab.de/down.html page. You may change my mail address there
>> to jon.klei...@icloud.com.
> 
> Ah, thanks! Changed.
> 
>> And the two file links there (gl.tgz and china.tgz)
>> will probably go 404 in a few months.
> 
> OK, I see. I removed them from down.html
> 
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


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


pil21, some progress

2020-02-12 Thread Jon Kleiser
Hi Alex,

I have now made some progress in building pil21 on my Mac. Here’s what I get 
now:

$ make
lib.c:7:35: warning: format specifies type 'unsigned long' but the argument has 
type 'int64_t'
  (aka 'long long') [-Wformat]
   fprintf(stderr, "%s %lX\n", s, n);
   ~~~^
   %llX
1 warning generated.

- - -

I must also remind you of what I said on Monday:
I noticed that there’s a mail link to me on the 
https://software-lab.de/down.html page. You may change my mail address there to 
jon.klei...@icloud.com. And the two file links there (gl.tgz and china.tgz) 
will probably go 404 in a few months. I don’t work for uio.no any longer, and I 
plan to retire completely this summer.

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


Re: Time to say goodbye

2020-02-10 Thread Jon Kleiser
Hi Alex,

> On 10 Feb 2020, at 20:41, Alexander Burger  wrote:
> 
> On Mon, Feb 10, 2020 at 08:24:10PM +0100, Jon Kleiser wrote:
>>> Especially with Mac users in mind, I'm working on an LLVM version of 
>>> PicoLisp
>>> (https://software-lab.de/pil21.tgz). You should be a little more patient ;)
>> 
>> Now you got me curious! I had to try it right away; maybe a bit early? I did 
>> a ‘make’ in the ‘src’ folder . . .
>> 
>> $ make
>> Package libffi was not found in the pkg-config search path.
> 
> Well, it is still *very* early, more like a proof of concept so far. This is
> also the reason why I did not announce it here officially yet. The plan is to
> get it ready in 2021 (or in the 21st century ;), thus the name "pil21".
> 
> To build it, you need a 64-bit hardware, and install the packages
> 
>   make clang llvm lldb pkg-config
> 
> ☺/ A!ex
> 

Does it mean that the standard macOS “make” is too old? (It’s possible.)

Have you considered implementing PicoLisp in Zig?
https://ziglang.org <https://ziglang.org/>

/Jon

Re: Time to say goodbye

2020-02-10 Thread Jon Kleiser
Hi Alex,

> On 10 Feb 2020, at 17:14, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> I have not been an active PicoLisp user for quite some time. The main reasons
>> for that have been (a) the difficulties related to building PicoLisp for 
>> macOS,
> 
> Oh, that's a pity!
> 
> Especially with Mac users in mind, I'm working on an LLVM version of PicoLisp
> (https://software-lab.de/pil21.tgz). You should be a little more patient ;)
> 

Now you got me curious! I had to try it right away; maybe a bit early? I did a 
‘make’ in the ‘src’ folder . . .

$ make
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
lib.c:7:35: warning: format specifies type 'unsigned long' but the argument has 
type 'int64_t'
  (aka 'long long') [-Wformat]
   fprintf(stderr, "%s %lX\n", s, n);
   ~~~^
   %llX
lib.c:150:10: fatal error: 'ffi.h' file not found
#include 
 ^~~
1 warning and 1 error generated.
make: *** [Makefile:25: lib.bc] Error 1

OK, I see there are things that I may have to provide.

>> and (b) some of my hobby projects (word vectors) requiring floating point 
>> math.
> 
> OK
> 
>> I wish all of you still many years with fun and rewarding PicoLisp use, and
>> have fun at the PilCon 2020!
> 
> Thanks for all code and desgn input, Jon!

I noticed that there’s a mail link to me on the 
https://software-lab.de/down.html  page. You 
may change my mail address there to jon.klei...@icloud.com 
. And the two file links there (gl.tgz and 
china.tgz) will probably go 404 in a few months. I don’t work for uio.no any 
longer, and I plan to retire completely this summer.

/Jon

> 
> Please have a good time :)
> 
> ☺/ A!ex



Re: Wikipedia

2019-01-03 Thread Jon Kleiser
Hi Alex,

Could you give me a complete sentence/paragraph describing the PilBox thing, 
including month and year, and maybe a link?

Shall I delete the paragraph that mentions the PilMCU project?

/Jon

> On 3. Jan, 2019, at 07:59, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> Happy New Year!
> 
> Happy New Year, to you and all! o/
> 
> 
>> I did add a link “Software Preservation Group – PicoLisp and Other Lisps” to
>> the “External links” sections,
> 
> Very good idea!
> 
>> but that didn’t make the warning go away (not unexpected).
> 
> I'm not sure if we have the permission to remove it ourselves. I think I
> faintly remember having removed another such message after fixing things.
> 
> 
>> Is there amilestone or two we (eg. I) could add in the History section?
> 
> PilBox is the largest recent addition. Perhaps it should be mentioned?
> 
> Thanks Jon!
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


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


Re: Wikipedia

2019-01-02 Thread Jon Kleiser
Hi,

Happy New Year!

I did add a link “Software Preservation Group – PicoLisp and Other Lisps” to 
the “External links” sections, but that didn’t make the warning go away (not 
unexpected). Is there a milestone or two we (eg. I) could add in the History 
section?

/Jon

> On 28. Dec, 2018, at 22:54, Jon Kleiser  wrote:
> 
> Hi,
> 
> I suggest we add one or more milestones in the History section, and maybe 
> remove the 2014 PilMCU paragraph (if that was not successful). Give me the 
> text and I shall put it in.
> 
> /Jon
> 
> Sent from my iPhone
> 
> On 28 Dec 2018, at 08:35, Jean-Christophe Helary  wrote:
> 
>> I think the issue with the Wikipedia message is that not much is said of 
>> Picolisp outside of the Picolisp community :) Hence, if we can have a few 
>> articles about *anything* related to Picolisp then we can add a lot of 
>> "neutral" contents and that doesn't have to be you who does the stuff.
>> 
>> So anything you're aware that can be published and possibly be referenced, 
>> go ahead :)
>> 
>> JC
>> 
>>> On Dec 28, 2018, at 16:18, Alexander Burger  wrote:
>>> 
>>> Hi Jean-Christophe,
>>> 
>>>> Do you have a list of commercial applications that were developed in 
>>>> picolisp
>>>> and can be mentioned there?
>>> 
>>> I could put together a list of all my projects during the last 30 years, 
>>> but it
>>> would not be helpful as these are all custom applications, not visible in
>>> public.
>>> 
>>> 
>>>> Are there citations that refer to that (in industry papers, etc.) ?
>>> 
>>> Not that I'm aware of ...
>>> ☺/ A!ex
>>> 
>>> 
>>> -- 
>>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>> 
>> Jean-Christophe Helary
>> ---
>> http://mac4translators.blogspot.com @brandelune
>> 
>> 


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


Re: Wikipedia

2018-12-28 Thread Jon Kleiser
Hi,

I suggest we add one or more milestones in the History section, and maybe 
remove the 2014 PilMCU paragraph (if that was not successful). Give me the text 
and I shall put it in.

/Jon

Sent from my iPhone

> On 28 Dec 2018, at 08:35, Jean-Christophe Helary  wrote:
> 
> I think the issue with the Wikipedia message is that not much is said of 
> Picolisp outside of the Picolisp community :) Hence, if we can have a few 
> articles about *anything* related to Picolisp then we can add a lot of 
> "neutral" contents and that doesn't have to be you who does the stuff.
> 
> So anything you're aware that can be published and possibly be referenced, go 
> ahead :)
> 
> JC
> 
>> On Dec 28, 2018, at 16:18, Alexander Burger  wrote:
>> 
>> Hi Jean-Christophe,
>> 
>>> Do you have a list of commercial applications that were developed in 
>>> picolisp
>>> and can be mentioned there?
>> 
>> I could put together a list of all my projects during the last 30 years, but 
>> it
>> would not be helpful as these are all custom applications, not visible in
>> public.
>> 
>> 
>>> Are there citations that refer to that (in industry papers, etc.) ?
>> 
>> Not that I'm aware of ...
>> ☺/ A!ex
>> 
>> 
>> -- 
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> 
> Jean-Christophe Helary
> ---
> http://mac4translators.blogspot.com @brandelune
> 
> 


Subscribe

2018-12-14 Thread Jon Kleiser
Hello Jon Kleiser  :-)
You are now subscribed



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


Unsubscribe

2018-12-14 Thread Jon Kleiser
Good bye Jon Kleiser  :-(
You are now unsubscribed



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


Re: Function similar to Scheme 'foldl'?

2018-10-09 Thread Jon Kleiser
Thanks for all the answers. The reason I asked was, I’ve been playing a bit 
with Racket doing some “heavy” floating-point math, and I got quite used to the 
‘foldl’ function. Then I couldn’t remember having seen that function or 
anything quite similar i PicoLisp.

/Jon

> On 9. Oct, 2018, at 04:51, r...@tamos.net wrote:
> 
> On Mon, 08 Oct 2018 19:15 +0000, Jon Kleiser wrote:
>> Hi,
>> 
>> Is there a PicoLisp function similar to the Scheme 'foldl'?
> 
> Hi Jon!
> 
> You've probably already gone there, but FWIW this is what I have used in the 
> past.
> 
> (de foldl (Op Init Xs)
>  (let (Acc Init)
>(for X Xs (setq Acc (Op Acc X)))
>Acc))
> 
> In action:
> 
> (de op (X Y) (list 'op X Y))  # The "recon" binary operator :)
> (test '(op 1 2) (op 1 2))
> 
> (test  # Normal usage
>  '(op (op (op (op (op 0 1) 2) 3) 4) 5)
>  (foldl op 0 (1 2 3 4 5)))
> 



idx, Rosettacode Word_count example

2018-06-15 Thread Jon Kleiser
Hi,

I have used the idx function a few times and enjoyed it, but it had never 
occurred to me, until I took a closer look at the Rosettacode Word_count 
example, that I could also store values at the symbols in an idx tree. Wow! ;-) 
I’m quite impressed by the speed of that PicoLisp Word_count example.

http://rosettacode.org/wiki/Word_count#PicoLisp

At first I thought that the word count values were stored in the very idx tree 
structure, but then I thought maybe not. I did a test with two trees B and C 
and made separate functions to register words in B and C:

(de aB (W) (if (idx 'B W T) (inc (car @)) (set W 1)))
(de aC (W) (if (idx 'C W T) (inc (car @)) (set W 1)))

I then did a couple of (aB 'foo) and then (aC 'foo), and noticed that the use 
of aC interferred with the values registered by aB. I think one would need 
separate name spaces for aB and aC if one should need to count words in two 
separate trees at the same time. Maybe the Rosettacode Word_count example 
should be updated with its own name space. As it is right now, it’s a bit 
quick-and-dirty.

/Jon


Re: Beginner RESTful Web app in PicoLisp?

2017-08-17 Thread Jon Kleiser
Beautiful! Even works with 32-bit PicoLisp on Mac. ;-)

/Jon

> On 17. Aug, 2017, at 13:53, Alexander Burger  wrote:
> 
> Hi Christopher,
> 
>> Hi, I want to create a really simple PicoLisp Web application that
>> parses the URL, and does something. Probably something silly, e.g.,
>> visiting http://localhost/addition/2/2 returns a Web page showing 2+2 =
>> 4. Is there some small sample PicoLisp code I could look at or start
>> with?
> 
> How about this:
> 
> 1. Put these four lines into a file "addition.l":
> 
>  (html 0 "Addition" NIL NIL
> (let (A (format (next))  B (format (next)))
>( NIL "Addition")
>(prin A " + " B " = " (+ A B)) ) )
> 
> 2. In the same directory start
> 
>  $ pil @lib/http.l @lib/xhtml.l --server 8080 "" -wait
> 
> 3. Connect a browser to
> 
>  http://localhost:8080/addition.l?2&2
> 
>   or, if httpGate is running with a default of 8080, just
> 
>  http://localhost/addition.l?2&2
> 
> ♪♫ Alex
> 



Cleanup in form reference, Antoine de Saint-Exup???

2017-05-16 Thread Jon Kleiser
Hi,

I see that Nehal Singhal has helped cleaning up the doc/form reference, which 
is very fine. However, the final characters in the name of the author Antoine 
de Saint-Exupéry, in , seem to 
be coded wrong. I’ve checked both IE/Windows and Safari/macOS.

/Jon

PԔ � )mX�����zV�u�.n7�

Re: PicoLisp 64bit on Mac

2017-05-11 Thread Jon Kleiser
Hi Mike,

I think it’s still possible to fix a modern Mac to use old style gcc, and 
thereby be able to build the 32-bit PicoLisp. I’ve done it once, but nowadays I 
have an old Mac that I use for that purpose. If you like, I can supply the 
binaries; it’s only three small files, as far as I know.

The 64-bit, however, has turned out to be very hard (≈ impossible) to build on 
Mac. Sorry.

I recommend you try Docker. It works very fine. Take a look at these two:



I just tried the ‘docker-tinycore-picolisp’ briefly on a MacBook Air, and it 
worked very well.

/Jon

> On 11. May, 2017, at 14:29, Mike Margerum  wrote:
> 
> Hello, Fledgling functional programmer here (25 years of c/c++/objc )! I was 
> going down the Clojure path and then I ran into PicoLisp which looks much 
> more interesting to me.
> 
> I was looking to see if the 64 bit port is working on the mac.  I tried to 
> get the 32 bit code working but it looks like gcc has been aliased to run 
> clang instead.  I can figure out how to get gcc back on the PC, but first I 
> wanted to see if there was support for the 64 bit environment.
> 
> Kind Regards,
> Mike
> -- 

PԔ � )mX�����zV�u�.n7�

Ersatz (sym? -.1) differs from pil32

2017-02-14 Thread Jon Kleiser
Hi,

There seems to be a tiny difference between Ersatz and ordinary PicoLisp in the 
“sym?” function.

In Ersatz (17.1.25 JVM) I get this:

: (mapcar sym? '(+.1 -.1))
-> (T NIL)

In 32-bit PicoLisp (16.12.8 C) I get this:

: (mapcar sym? '(+.1 -.1))
-> (T T)

I have not tested this in 64-bit PicoLisp. Sorry. ;-)

/JonPԔ � )mX�����zV�u�.n7�

Re: A script that concatenates ref. and tutorial files into one file

2017-02-08 Thread Jon Kleiser
Hi Alex,

Thanks for pointing out why I should use ‘use’ on those symbols. I have now 
updated my project.

/Jon

> On 7. Feb, 2017, at 17:36, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> I have noticed that frequent use of ‘setq’ has been questioned recently on
>> this list. In my convConcat.l script there are quite a few setq’s that 
>> possibly
>> could have been coded in a better way. Let me know if you spot some obvious
>> candidates.
> 
> Basically there is nothing bad about 'setq'.
> 
> It is just problematic if you use it to modify not-locally-bound symbols (the
> term is "free variables") without them being clearly meant as global variables
> (by convention with a leading '*'), or from functions meant as local to other
> functions (by convention with a leading '_').
> 
> 'lint' should complain in such cases.
> 
> In case of convConcat.l, you set some globals in the beginning, and local
> variables like 'Head', 'Tail', 'Val' and 'C'. Looks all good.
> 
> 
> If I lint the code, I just get a single warning
> 
>   : (lintAll)
>   -> ((convLink (bnd @Props @After @X @Before)))
> 
> which means "please bind these four symbols" in function 'convLink'.
> 
> This is because 'match' also sets values. You can fix this by calling 'use' on
> them:
> 
>   (de convLink (F Chunk)
>  # First checking special case 
>  (use (@Props @After @X @Before)
> (if (match '(@Before < a " " n a m e = "\"" > @X "\"" > @After) Chunk)
> 
> ♪♫ Alex
> -- 



A script that concatenates ref. and tutorial files into one file

2017-02-07 Thread Jon Kleiser
Hi,

As a few has asked for a monolithic reference (and tutorial) HTML file, I got 
tempted to try to write a PicoLisp program that does such a concatenation. The 
difficult part, of course, was adjusting all the internal links, and it was a 
bit more challenging than I first thought, especially after I understood that 
the files in doc/form/ also should be included.

The script and some more info can be found here:
https://github.com/jkleiser/picolisp-onedoc-html

An example of a complete concatenated file can be seen here:
http://folk.uio.no/jkleiser/pico/one/one.html

- - -

I have noticed that frequent use of ‘setq’ has been questioned recently on this 
list. In my convConcat.l script there are quite a few setq’s that possibly 
could have been coded in a better way. Let me know if you spot some obvious 
candidates.

/JonPԔ � )mX�����zV�u�.n7�

Re: replacement for (let L2 (drop L1 2)....

2017-02-07 Thread Jon Kleiser
Hi,

I wasn’t aware of nor, nand, nond. Maybe there should have been a few more “See 
also” in the docs.

/Jon

> On 7. Feb, 2017, at 08:31, Alexander Burger  wrote:
> 
> On Tue, Feb 07, 2017 at 08:13:06AM +0100, Alexander Burger wrote:
>> Better to use (not Lst).
> 
> One more note: I even try to avoid 'not' whenever possible, as it is an
> additional function call overhead.
> 
> It is often possible to use the complementary flow function,
> like (ifn Lst ..) instead of (if (not Lst) ..).
> 
>   if<->   ifn
>   and   <->   nor
>   or<->   nand
>   when  <->   unless
>   cond  <->   nond
>   while <->   until
> 
> ♪♫ Alex
> -- 

PԔ � )mX�����zV�u�.n7�

Subscribe

2017-02-06 Thread Jon Kleiser
Hello Jon Kleiser <jon.klei...@ceres.no> :-)
You are now subscribed


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


Re: In the docs: within or vice versa, more glitches

2017-01-25 Thread Jon Kleiser
Hi Mattias,

It seems you forgot something in doc/form/refF.html, line 101. I guess there 
should have been “Formatting” just before the final “.”

/Jon

> On 23. Jan, 2017, at 14:12, Mattias Sundblad  wrote:
> 
> Hi Jon,
> 
>> I’ve found a few more glitches:
> 
> Thanks, I'll go through them and change the files.
> 
> Regards,
> Mattias
> -- 



Re: In the docs: within or vice versa, more glitches

2017-01-23 Thread Jon Kleiser
Hi Mattias,

I’ve found a few more glitches:

doc/form/refF.html, line 101: A missing “”
doc/form/refF.html, line 104: “” should have been “”
doc/form/refO.html, line 100: A missing “”
doc/form/refQ.html, line 20: “” should have been “”
doc/form/refS.html, line 67: “” should have been “”
doc/form/refV.html, line 17: “” should have been “”
doc/form/refV.html, line 19: “” should have been “”

There are also quite a few places like in doc/form/form.html, lines 69, 79 and 
83, where I think “” should have been coded like “foo”.

And Alex:

doc/app.html, line 2208: “ On 20. Jan, 2017, at 19:37, Mattias Sundblad  wrote:
> 
> Hello Jon,
> 
>> In the docs there are lots of occurrences (2325) of “”, and also 
>> some (751, mainly within doc/form/) of “”. I haven’t checked 
>> which one is the most correct. However, in doc/form/refC.html, line 82, 
>> there’s a bad mix:
>> 
>> +Chg
> 
> I'll change refC.html. Thanks for noticing!
> 
>> I suspect there may be more of this mixed kind, but I don’t have time to 
>> check it right now.
> 
> There probably is, along with other oversights. I am a bit busy this
> weekend, but I will start going through the form docs and make
> corrections as soon as possible. Good to see the docs being used!
> 
> // Mattias

PԔ � )mX�����zV�u�.n7�

In the docs: within or vice versa

2017-01-20 Thread Jon Kleiser
Hi,

In the docs there are lots of occurrences (2325) of “”, and also 
some (751, mainly within doc/form/) of “”. I haven’t checked which 
one is the most correct. However, in doc/form/refC.html, line 82, there’s a bad 
mix:

+Chg

I suspect there may be more of this mixed kind, but I don’t have time to check 
it right now.

Have a nice weekend!

/Jon

doc/form/refQ.html: missing "" after ""

2017-01-17 Thread Jon Kleiser
Hi,

I have found a few things that should be fixed in doc/form/refQ.html.

line 120: missing "" after ""
line 161: missing space before "

Missing PDF function in wiki

2017-01-16 Thread Jon Kleiser
Hi,

Quite some time ago, before the wiki got its new look, it was possible to 
download a nice PDF version of the selected wiki page (e.g. 
http://picolisp.com/wiki/?bookintro). I cannot see that possibility any longer. 
Why was it removed?

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


Doc example for 'fish atom'

2017-01-02 Thread Jon Kleiser
Hi,

I think it could be useful to include an example like this in the docs for the 
‘fish’ function:

: (fish atom '((a b) c (d e)))
-> (a b c d e)

I found out about ‘fish atom’ here: 
http://rosettacode.org/wiki/Flatten_a_list#PicoLisp

Are there other equally smart ways to flatten a list like '((a b) c (d e)) ?

/JonPԔ � )mX�����zV�u�.n7�

Re: Full documentation in a single document?

2016-12-19 Thread Jon Kleiser
Hi,

This was also discussed back in August 2014, with the subject “Documentation 
again”, . . .



/Jon

> On 19. Dec, 2016, at 15:11, Joh-Tob Schäg  wrote:
> 
> There is not. I talked about he same thing with Regenaxer the day before 
> yesterday. It would be very helpfull if you did create such a script. You 
> might also think about updating the hyperlinks.
> 
> I have an idea for a long term solution but the implemenation migjt take a 
> while.
> 
> Am 19.12.2016 22:51 schrieb "František Fuka" :
> Hello,
> 
> is there a single document containing all PicoLisp documentation (including 
> the function reference), suitable e.g. for reading in Kindle? Or an existing 
> script to generate such a file?
> 
> I could stitch it together rather easily from the existing HTML docs but I 
> just want to make sure I am not doing something that's already done...
> 
> Thanks
> 
> -- 
> -- Frantisek Fuka
> (yes, that IS my real name)
> 
> -- My Personal homepage: www.fuxoft.cz
> -- My Google+ profile: google.com/+fuxoft
> -- My Telegram chat: telegram.fuxoft.cz
> 
> 



Re: insert, remove, place, group redefined

2016-12-19 Thread Jon Kleiser
Hi Alex,

Yes, you guessed it. I had a mix. Now I’ve cleaned it up, and the messages are 
gone. Thanks!

/Jon

> On 19. Dec, 2016, at 07:14, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> I just wanted to try the 32-bit version “16.12.8 C”. When it starts, it 
>> prints this:
>> 
>> # insert redefined
>> # remove redefined
>> # place redefined
>> # group redefined
> 
> These functions were moved from "lib.l" to built-in in October 2016 (see
> "doc/ChangeLog" on "CHANGES").
> 
> 
> There must be a mix of old "lib.l" and new "picolisp" binary on your machine.
> Not sure. Probably this message appears only once, while building the new
> version. It is not critical, may be considered as just a warning.
> 
> - Alex



More filter examples

2016-11-03 Thread Jon Kleiser
Hi,


I think there should be an example in the docs, showing the use of 'filter' 
with more than one list. Here are my two suggestions:


(filter < (2 9 3 8 4 7) (5 4 3 9 9 5))

-> (2 8 4)


(filter and (1 NIL 3 NIL 5) (2 3 4 5 6) (7 8 NIL 1 1))

-> (?1 5)


/Jon


Re: Ersatz source code and EmuLisp

2016-10-31 Thread Jon Kleiser
Hi Chri,

This is how you build ersatz/picolisp.jar, and at the same time get the 
complete PicoLisp.java source:
cd into the ersatz/, the do "pil mkJar +".

I have implemented (partly) a few more functions lately (format, intern, lit, 
unless, when), but I haven't released anything new yet. I may find time to look 
at 'filter'.

Have you had any luck with Clojure(Script)?

/Jon

From: picolisp@software-lab.de <picolisp@software-lab.de> on behalf of 
Christophe Gragnic <christophegrag...@gmail.com>
Sent: 31 October 2016 11:58
To: picolisp@software-lab.de
Subject: Ersatz source code and EmuLisp

Hi PicoLispers,

My question:
Is there any documentation about the building of the Ersatz jar ?
I guess all the keys are in the mkJar file but I'm lost reading it.

Background:
I'm mostly using a JavaScript version of PicoLisp: EmuLisp and
since Jon Kleiser has not much time to extend it further, I have
to try to extend it on my own (this is not a rant! Jon has been
very very helpful!).
If I understood the process correctly, Jon took inspiration from
the source code of Ersatz to structure EmuLisp, but this source
is still cryptic to me.

My current task is to implement 'filter.
This is it's Ersatz implementation:
https://github.com/fuxoft/picolisp/blob/1c6c501cd4ad5737ec74fa1de47201060fad39e3/ersatz/fun.src#L641
I tried to mimic 'mapcar
https://github.com/fuxoft/picolisp/blob/1c6c501cd4ad5737ec74fa1de47201060fad39e3/ersatz/fun.src#L562
and adapt the mapcar found in EmuLisp:
https://github.com/Grahack/EmuLisp/blob/master/emulisp_core.js#L1189
but there are too many things that I don't understand.

Can anyone help me ?


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


Re: Can't compile picoLisp-16.6 on OSX

2016-10-09 Thread Jon Kleiser
Hi Rafik,

I have an old Mac (OS X 10.8.5) that I use mainly for compiling 32-bit 
PicoLisp. The compiled binaries I can copy to newer Macs, where they run fine. 
If you want, I can make the binaries available.

It is possible to install old/standard build tools on a new Mac. I have done it 
once, but I prefer having the original Mac tools, and not having to switch back 
and forth.

If you prefer 64-bit PicoLisp, Docker is a fine solution. If you use this one, 
https://hub.docker.com/r/progit/docker-tinycore-picolisp/, then you (probably) 
get version 16.5.30. Here’s how I start it:

docker run -v /Users/jkleiser/script:/opt/script -it 
progit/docker-tinycore-picolisp

I can then do things like (dir "/opt/script") or (in "/opt/script/foo.sh" 
(echo)) from inside PicoLisp.

/Jon

On 9. okt. 2016, at 08.16, Alexander Burger 
> wrote:

Hi Rafik,

As it turns out, as mac OSx defaults to clang, We get an error preventing
the package to compile:

flow.c:786:37: error: fields must have a constant size: 'variable length
array in structure' extension will never be supported
struct {any sym; any val;} bnd[length(y)];

Yes, this is a known problem. PicoLisp 32-bit depends on dynamically
sized arrays in several places, and clang doesn't support those :(

♪♫ Alex
--



Re: toy-forth-in-picolisp, and a 32-bit problem

2016-08-28 Thread Jon Kleiser
Hi Alex,

I have now tested your latest “16.8.26 C” version on two Macs, and I’ve had no  
“Segmentation fault: 11”. Seems you’ve fixed it. Thanks.

Do you still want more info re. what caused the problem in the previous version?

/Jon

> On 27. aug. 2016, at 22.13, Alexander Burger  wrote:
> 
> On Sat, Aug 27, 2016 at 10:56:55PM +0300, Mike Pechkin wrote:
>>> 
>>> crashes? What is in the temp stack? Perhaps it is the fixed prin/prinl
>>> issue of anonymous symbols.
>>> 
>>> 
>> ​tempStack is list, look how it prints when not crashed​
>> 
>> http://pastebin.com/mTj51y4B
> 
> Yes, anonymous symbols. That explains all.
> 
> ♪♫ Alex
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: toy-forth-in-picolisp, and a 32-bit problem

2016-08-27 Thread Jon Kleiser
Thanks, Alex! I’ll give it a try a little later, but I’m sure it works.

/Jon

> On 26. aug. 2016, at 18.23, Alexander Burger  wrote:
> 
> On Fri, Aug 26, 2016 at 06:04:22PM +0200, Alexander Burger wrote:
>> Must be my fault. I never had the idea to 'prinl' an anonymous symbol
>> ('prinl' just low-level-outputs the names of symbols, but anonymous
>> symbols don't have a name ;)
>> 
>> Perhaps it works in pil64 just by chance. I'll check (and fix) both
>> versions).
> 
> OK, fixed it in pil32.
> 
> pil64 is all right, it did a proper check. And Ersatz and miniPicoLisp
> are also not affected :)
> 
> ♪♫ Alex
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



toy-forth-in-picolisp, and a 32-bit problem

2016-08-26 Thread Jon Kleiser
Hi,

This summer I have had some fun trying to figure out how to implement a super 
simple toy Forth. For a start, I chose PicoLisp as an implementation language. 
You may find it here:

https://github.com/jkleiser/toy-forth-in-picolisp

There is one problem, however, occurring quite regularly when I run this 
forth.l using 32-bit PicoLisp on Mac. As the README.md suggests, I start it by 
doing this

pil path/to/forth.l +

If I then enter “: ff 0 if 77 else 88 then ;” (without the quotes), which 
defines a new word “ff” (which when used always pushes 88 on the stack), and 
then enter “t”, which is a (non-standard) word just for checking the state of 
the “tempStack” field (probably empty), then I usually get a “Segmentation 
fault: 11”.

I have not seen that problem when using 64-bit PicoLisp (in Docker).

Is this Segmentation fault caused by a bug in 32-bit PicoLisp, or is it me 
doing something stupid?

Have a nice weekend!

/Jon

Re: Announcement: PicoLisp in a docker container

2016-08-22 Thread Jon Kleiser
Thanks again, David!

When I run this and do “(version)”, I get 16.5.30, while your docs says “This 
is version 16.2”. I guess one gets the current stable release version when one 
does the “docker pull”. Is that right?

/Jon

> On 22. Aug, 2016, at 02:00, David Bloom <ipro...@gmail.com> wrote:
> 
> Docs updated.  Sorry it took me so long.  I'll be quicker to respond in the 
> future.  Added a --rm to automatically remove the container upon exit.  That 
> way you don't have to manually remove any cruft left over in docker ps -a.  
> Optionally you can decide not to use the --rm switch and be able to inspect 
> the container after exit.
> 
> https://hub.docker.com/r/progit/docker-tinycore-picolisp/
> 
> Enjoy!
> 
> On Mon, Aug 15, 2016 at 9:31 AM, Jon Kleiser <jon.klei...@fsat.no> wrote:
> Thanks a lot, David!
> 
> /Jon
> 
> > On 15. Aug, 2016, at 13:57, David Bloom <ipro...@gmail.com> wrote:
> >
> > Pardon the delay Jon,  I've been under extreme amounts of stress but not
> > for much longer.  I'll update the docs to reflect getting a Tinycore prompt
> > rather than just a REPL.
> >
> > On Aug 15, 2016 6:08 AM, "Jon Kleiser" <jon.klei...@fsat.no> wrote:
> >
> >> I just want to report that my use of “docker run -v” was not correct. This
> >> works much better:
> >>
> >> docker run -v /Users/jkleiser/script:/opt/script -it
> >> progit/docker-tinycore-picolisp
> >>
> >> I can then do things like (dir "/opt/script") or (in "/opt/script/foo.sh"
> >> (echo)) from inside PicoLisp.
> >>
> >> /Jon
> >>
> >>> On 12. Aug, 2016, at 16:40, Jon Kleiser <jon.klei...@fsat.no> wrote:
> >>>
> >>> Hi David,
> >>>
> >>> I have now tried your container as described at
> >> https://hub.docker.com/r/progit/docker-tinycore-picolisp/, and I got
> >> PicoLisp version 16.5.30 running. Does your container allow me to get
> >> access to the Tinycore Linux command line?
> >>>
> >>> I need to load a PicoLisp file I have on my Mac. I have tried starting
> >> your container like this:
> >>> docker run -v /Users/jkleiser/script -it progit/docker-tinycore-picolisp
> >>> but when I from inside PicoLisp do (dir "/Users/jkleiser/script”), I
> >> just get NIL, so for some reason sharing the OS X file system with your
> >> container doesn’t work at the moment. Maybe the container has to be set up
> >> for the new ‘osxfs’ shared file system solution? I don’t know.
> >>>
> >>> If I could get at the Tinycore Linux CLI, then I could maybe get my
> >> PicoLisp file by use of wget or curl (if I put the file on the net first)
> 
> 



Re: Announcement: PicoLisp in a docker container

2016-08-15 Thread Jon Kleiser
Thanks a lot, David!

/Jon

> On 15. Aug, 2016, at 13:57, David Bloom <ipro...@gmail.com> wrote:
> 
> Pardon the delay Jon,  I've been under extreme amounts of stress but not
> for much longer.  I'll update the docs to reflect getting a Tinycore prompt
> rather than just a REPL.
> 
> On Aug 15, 2016 6:08 AM, "Jon Kleiser" <jon.klei...@fsat.no> wrote:
> 
>> I just want to report that my use of “docker run -v” was not correct. This
>> works much better:
>> 
>> docker run -v /Users/jkleiser/script:/opt/script -it
>> progit/docker-tinycore-picolisp
>> 
>> I can then do things like (dir "/opt/script") or (in "/opt/script/foo.sh"
>> (echo)) from inside PicoLisp.
>> 
>> /Jon
>> 
>>> On 12. Aug, 2016, at 16:40, Jon Kleiser <jon.klei...@fsat.no> wrote:
>>> 
>>> Hi David,
>>> 
>>> I have now tried your container as described at
>> https://hub.docker.com/r/progit/docker-tinycore-picolisp/, and I got
>> PicoLisp version 16.5.30 running. Does your container allow me to get
>> access to the Tinycore Linux command line?
>>> 
>>> I need to load a PicoLisp file I have on my Mac. I have tried starting
>> your container like this:
>>> docker run -v /Users/jkleiser/script -it progit/docker-tinycore-picolisp
>>> but when I from inside PicoLisp do (dir "/Users/jkleiser/script”), I
>> just get NIL, so for some reason sharing the OS X file system with your
>> container doesn’t work at the moment. Maybe the container has to be set up
>> for the new ‘osxfs’ shared file system solution? I don’t know.
>>> 
>>> If I could get at the Tinycore Linux CLI, then I could maybe get my
>> PicoLisp file by use of wget or curl (if I put the file on the net first)



Re: Announcement: PicoLisp in a docker container

2016-08-15 Thread Jon Kleiser
I just want to report that my use of “docker run -v” was not correct. This 
works much better:

docker run -v /Users/jkleiser/script:/opt/script -it 
progit/docker-tinycore-picolisp

I can then do things like (dir "/opt/script") or (in "/opt/script/foo.sh" 
(echo)) from inside PicoLisp.

/Jon

> On 12. Aug, 2016, at 16:40, Jon Kleiser <jon.klei...@fsat.no> wrote:
> 
> Hi David,
> 
> I have now tried your container as described at 
> https://hub.docker.com/r/progit/docker-tinycore-picolisp/, and I got PicoLisp 
> version 16.5.30 running. Does your container allow me to get access to the 
> Tinycore Linux command line?
> 
> I need to load a PicoLisp file I have on my Mac. I have tried starting your 
> container like this:
> docker run -v /Users/jkleiser/script -it progit/docker-tinycore-picolisp
> but when I from inside PicoLisp do (dir "/Users/jkleiser/script”), I just get 
> NIL, so for some reason sharing the OS X file system with your container 
> doesn’t work at the moment. Maybe the container has to be set up for the new 
> ‘osxfs’ shared file system solution? I don’t know.
> 
> If I could get at the Tinycore Linux CLI, then I could maybe get my PicoLisp 
> file by use of wget or curl (if I put the file on the net first).
> 
> /Jon
> 
> 
>> On 6. Jun, 2016, at 23:32, David Bloom <ipro...@gmail.com> wrote:
>> 
>> Hi Alex,
>> 
>> There are several reasons why I've created PicoLisp in a container.
>> 
>> 1) The image has recently been trimmed down to 14MB.  The large image was 
>> just to get something out there and refine it shortly afterwards.
>> 2) I didn't know that there was an existing extension.  Is it the latest 
>> version?  All existing apt-get/tce-load solutions were off older versions.
>> 3) PicoLisp on windows isn't very straightforward to set up but Docker seems 
>> easier.  Perhaps it can help garner more windows attention?
>> 4) And the main reason why is to run PicoLisp apps against a distributed 
>> storage on Triton container infrastructure.  Ultimately because I think 
>> people are doing it wrong, using Python mainly for data science 
>> applications.  My friend said to show people what's the right way then.  I'd 
>> much rather use PicoLisp rather than Python for data science applications.  
>> Yes I understand that it lowers the barrier of entry for non-programmers but 
>> then companies wind up hiring programmers anyway so I'm reaching for my 
>> favorite language
>> 
>> I hope that explains things more.
>> 
>> Why download a 187MB file to "try" PicoLisp in Tinycore when you can just 
>> type: "tce-load -il picolisp" to download/install the 88KB extension ?
>> 
>> I'm sorry, I don't understand the purpose of this.
>> 
>> 
>> Alex
>> 
>> On Wed, Jun 1, 2016 at 2:46 PM, David Bloom <ipro...@gmail.com> wrote:
>> Thanks to your collective help I'm pleased to announce the availability of 
>> PicoLisp in a docker container!  Now anyone with docker installed can try 
>> out 64-bit PicoLisp v16.2 running on Tinycore Linux by running:
>> 
>> docker pull progit/picolisp
>> 
>> The image is 187MB which I hope to trim further but this is already hundreds 
>> of MB less than most popular images.  I'll maintain the latest version in 
>> the container.
>> 
>> Please do offer up helpful suggestions if you have any and enjoy!
>> 
>> -David Bloom
>> 
>> 
> 
> PԔ � )mX�����zV�u�.n7��I칻�&



Re: Announcement: PicoLisp in a docker container

2016-08-12 Thread Jon Kleiser
Hi David,

I have now tried your container as described at 
https://hub.docker.com/r/progit/docker-tinycore-picolisp/, and I got PicoLisp 
version 16.5.30 running. Does your container allow me to get access to the 
Tinycore Linux command line?

I need to load a PicoLisp file I have on my Mac. I have tried starting your 
container like this:
docker run -v /Users/jkleiser/script -it progit/docker-tinycore-picolisp
but when I from inside PicoLisp do (dir "/Users/jkleiser/script”), I just get 
NIL, so for some reason sharing the OS X file system with your container 
doesn’t work at the moment. Maybe the container has to be set up for the new 
‘osxfs’ shared file system solution? I don’t know.

If I could get at the Tinycore Linux CLI, then I could maybe get my PicoLisp 
file by use of wget or curl (if I put the file on the net first).

/Jon


> On 6. Jun, 2016, at 23:32, David Bloom  wrote:
> 
> Hi Alex,
> 
> There are several reasons why I've created PicoLisp in a container.
> 
> 1) The image has recently been trimmed down to 14MB.  The large image was 
> just to get something out there and refine it shortly afterwards.
> 2) I didn't know that there was an existing extension.  Is it the latest 
> version?  All existing apt-get/tce-load solutions were off older versions.
> 3) PicoLisp on windows isn't very straightforward to set up but Docker seems 
> easier.  Perhaps it can help garner more windows attention?
> 4) And the main reason why is to run PicoLisp apps against a distributed 
> storage on Triton container infrastructure.  Ultimately because I think 
> people are doing it wrong, using Python mainly for data science applications. 
>  My friend said to show people what's the right way then.  I'd much rather 
> use PicoLisp rather than Python for data science applications.  Yes I 
> understand that it lowers the barrier of entry for non-programmers but then 
> companies wind up hiring programmers anyway so I'm reaching for my favorite 
> language
> 
> I hope that explains things more.
> 
> Why download a 187MB file to "try" PicoLisp in Tinycore when you can just 
> type: "tce-load -il picolisp" to download/install the 88KB extension ?
> 
> I'm sorry, I don't understand the purpose of this.
> 
> 
> Alex
> 
> On Wed, Jun 1, 2016 at 2:46 PM, David Bloom  wrote:
> Thanks to your collective help I'm pleased to announce the availability of 
> PicoLisp in a docker container!  Now anyone with docker installed can try out 
> 64-bit PicoLisp v16.2 running on Tinycore Linux by running:
> 
> docker pull progit/picolisp
> 
> The image is 187MB which I hope to trim further but this is already hundreds 
> of MB less than most popular images.  I'll maintain the latest version in the 
> container.
> 
> Please do offer up helpful suggestions if you have any and enjoy!
> 
> -David Bloom
> 
> 

PԔ � )mX�����zV�u�.n7�

Re: Add method to one object only?

2016-06-10 Thread Jon Kleiser
Thanks. In my case I wanted the object itself to create the new method, so I 
did like this:

(push This '(newMsg> () (prinl "Yes!")))

/Jon

> On 10. Jun, 2016, at 13:07, Alexander Burger  wrote:
> 
> On Fri, Jun 10, 2016 at 11:50:07AM +0200, Alexander Burger wrote:
>>   (push Obj (cons 'msg> '((X) (bar
>> 
>> or
>> 
>>   (push Obj '(msg> (X) (bar)))
> 
> Two notes:
> 
> 1. If the symbol 'msg>' is not yet defined as a message in another
>   context (e.g. with (dm msg> ...)), then you can do that on the fly
>   with:
> 
>  (setq msg> meth)
> 
> 2. Instead of 'push'ing the method into the value as above, you may
>   sometimes pass it already when creating the object:
> 
>  (setq Obj
> (new '((msg> (N) (+ (: a) N)) +Cls)
>'a 7
>'s "abc" ) )
> 
>  (msg> Obj 1)
>  -> 8
> 
> ♪♫ Alex



Re: Add method to one object only?

2016-06-10 Thread Jon Kleiser
Thanks, Alex! That was nice and easy.

/Jon

> On 10. Jun, 2016, at 11:50, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> If one has a few objects of the same class +C, would it be possible to
>> add a new method to just one of these objects, without all the others
>> also getting that new method?
> 
> You can add a method to an object (or also a class) by adding a cons
> pair (msg> . fun) to its value.
> 
>   (push Obj (cons 'msg> '((X) (bar
> 
> or
> 
>   (push Obj '(msg> (X) (bar)))
> 
> Internally, there is no formal difference between classes and objects.
> 
> ♪♫ Alex
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Add method to one object only?

2016-06-10 Thread Jon Kleiser
Hi,

If one has a few objects of the same class +C, would it be possible to add a 
new method to just one of these objects, without all the others also getting 
that new method?

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


Re: Best way to learn picolisp

2016-06-08 Thread Jon Kleiser
If you have no Lisp background, and what you want to learn is PicoLisp, then I 
don’t think learning Common Lisp first will be any advantage. I believe Common 
Lisp differs quite a bit from PicoLisp.
If you have experience with some other popular language X, then you can compare 
the Rosetta Code solutions for X and PicoLisp, 
http://rosettacode.org/wiki/Category:PicoLisp.
You should also study this tutorial http://software-lab.de/doc/tut.html, and 
when you have questions, use this mail list, or the IRC channel, 
irc://irc.freenode.net/picolisp.
To keep yourself motivated, I think it’s smart to pick a nice little task (not 
too complicated) that you want to solve, using PicoLisp. Go for it!

/Jon

> On 8. Jun, 2016, at 14:18, Jakob Eriksson  wrote:
> 
> It's more like Common Lisp is a derivative of PicoLisp, seriously. :-) So I'd 
> go for pico first, it's easier to understand. 
> 
>> 8 juni 2016 kl. 14:08 skrev Lawrence Bottorff :
>> 
>> So, what would the best way to learn picolisp be for a total beginner? It 
>> might seem like you should just bite the bullet and learn regular Common 
>> Lisp first, then start learning picolisp. That is, you should know all the 
>> capabilities of Lisp before you try to learn a derivative Lisp. Is this true?
>> 
>> LB



Re: Sending arbitrary messages to object

2016-06-08 Thread Jon Kleiser
Thanks, Alex.

/Jon

> On 7. Jun, 2016, at 17:43, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> I want to send arbitrary messages to an object MyObj. If I have a word
>> "msg", then I want to send the message 'msg> to MyObj. I do it like
>> this:
>> 
>> (setq Word "msg")
>> (setq MsgSym (car (str (pack Word ">"
>> (try MsgSym MyObj)
> 
> Yes, you must make an internal symbol, as the message lookup uses
> pointer-equality during lookup. But 'str' is a bit too heavy ;)
> 
> This should work:
> 
>   (dm msg ()
>  ... )
> 
>   (try (intern Word) MyObj)
> 
> The ">" is just a naming convention and not absolutely needed here, but
> of course you can do (with a little overhead)
> 
>   (dm msg> ()
>  ... )
> 
>   (try (intern (pack Word ">")) MyObj)
> 
> 
>> If MsgSym is not a message that can be located in MyObj, then the
>> “try” function will return NIL. However, depending on the message, the
>> “try” function may also return NIL for valid messages. What’s the best
>> way to find out if MsgSym is/was a valid message symbol for MyObj?
> 
> You can test the lookup with
> 
>   (method 'msg 'obj)
> 
> ♪♫ Alex
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: Redesigned Wiki is Live

2016-03-25 Thread Jon Kleiser
Hi Erik,

Great job! There is one feature I miss, however, and that’s the old “section 
links” that used to be on the left hand side. I can now use the search function 
to find the “sections”, but that is too cumbersome. I think there should be 
quick links for at least these two:

Articles & Essays http://picolisp.com/wiki/?articles
Examples http://picolisp.com/wiki/?examples

When I search for “examples”, the long list of Search results makes the page 
header very high, high enough to contain all the search results. That’s not 
very elegant. I think the “searchGrp” div should be “floating” above the “menu” 
div, like a drop-down. It could also have a clickable X in the upper right 
corner so one could make it go away.

I also think the main text color (#666) is somewhat too light. For me, #333 
looks better.

/Jon

On 24. mar. 2016, at 16.34, Erik Gustafson 
> wrote:

Hi List,

I'm very excited to announce that the redesigned PicoLisp
wiki is now running on the server! Have a look:

   http://picolisp.com

In my (slightly biased) opinion, PicoLisp has one of the
coolest programming language websites out there now. It's
sleek and modern and should be very accessible from any
device. Changes to the code base were minimal (mostly
CSS), so it still works great with text-based browsers
as well.

But don't let the new paint job fool you. The wiki has
much more to offer! I spent a lot of time going through
the mail archives, finding the most helpful threads and
turning them into new articles. I've tried to organize
the documentation to be most helpful to newcomers, to
set them on a clear path from beginner to lisp wizard.

I'd love any feedback. How's the design feel? The copy?
I tried my best to incorporate all the feedback I got
from the initial homepage mockup I posted a few months
ago.

Note that there are still some rough spots in some of
the articles/pages. I plan to fill that out in the
coming weeks and continue to refine the content,
hopefully with your help! As such, please hold off on
posting to Reddit, HN, etc. for a bit. And if there is
anything that seems to be missing, or you'd like to find
a spot for something you've been working, let me know.

So thanks to all of you for the great discussion over
the years! It's been a lot fun and I've learned a ton.
Finally, many thanks to Alex, not only for helping me
better understand the wiki and put it back together,
but for PicoLisp in general.

Cheers y'all,
Erik



Re: Tractatus Pico-Blaesicus, Accept-Language

2016-03-19 Thread Jon Kleiser
Hi Alex,

A very nice piece of lisp code! The only part I didn’t like very much, was the 
yellow color. As usual, I had to tweek the CSS. Here is my variant:

# CSS
(de tractatus.css ()
   (prinl "html {background-color: #eee;}")
   (prinl "body {margin: auto; max-width: 96ex; border: 1px solid #bbb; font: 
20px serif; background-color: #ffd; padding: 2em 5% 4em 5%;}")
   (prinl "ul {padding-left: 3ex; list-style: none;}")
   (prinl "li {padding: 0.3ex 0;}")
   (prinl "a {text-decoration: none}") )

As I noticed that the clickable lines in the  had tooltips (title), I got 
tempted to check if they were depending on the Accept-Language value 
(no,en-US;q=0.7,en;q=0.3) in my (Firefox) requests, but I didn’t see any 
Norwegian tooltips. Are there other PicoLisp demo apps where the displayed 
texts (or tooltips) are according to the Accept-Language value in the request 
header? I’m just curious. ;-)

/Jon

> On 7. Mar, 2016, at 19:25, Alexander Burger  wrote:
> 
> Dear PicoLisp List,
> 
> let me announce a strange little piece of [code?, documentation?,
> pamphlet?] which I wrote up to summarize some of the positions and
> philosophy of PicoLisp.
> 
> In the spirit of Ludwig Wittgenstein I called it
> 
>   Tractatus Pico-Blaesicus
> 
> and it can be accessed at
> 
>   http://picolisp.com/tractatus
> 
> 
> On the top-right of the page is a "Source" link.
> 
> The code is an interesting exercise in itself:
> 
> The HTML entry function 'tractatus' consists mainly of a read-macro
> which parses the embedded plaintext block into a '' structure,
> with the hierarchy based on the individual indentation levels.
> 
> To have it all together in a single source, the CSS "file" is in fact
> the function 'tractatus.css', as well as the source download link
> 'tractatus.l' (despite their names).
> 
> 
> I suspect that the text is not complete yet, and probably neither
> error-free nor particularly consistent. Let me know what you think
> should be added or changed.
> 
> ♪♫ Alex
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: PicoLisp on Ubuntu

2016-01-21 Thread Jon Kleiser
Hi,


Others also mentioned Xubuntu, but my old Mac mini cannot handle all DVD and CD 
formats very well. Fortunately Lubuntu had a 64-bit 14.04 .iso DVD that my Mac 
did accept. Now I have 64-bit PicoLisp running ...



: (cons *CPU (version T))
-> ("x86-64" 16 1 16)


The future is bright. The only thing I have not got, for some reason, is 
Norwegian keyboard layout. It was available during installation, but now I 
cannot find it. I guess I will fix that in a couple of days.


/Jon



From: picolisp@software-lab.de <picolisp@software-lab.de> on behalf of O.Hamann 
<o.ham...@gmx.net>
Sent: 19 January 2016 12:09
To: picolisp@software-lab.de
Subject: Re: PicoLisp on Ubuntu

Xubuntu could work too.
And it's possible to switch window systems later, too.


On 18.01.2016 09:22, Jon Kleiser wrote:

Hi Rick,

Lubuntu looks very promising. I think I have to give it a try. Thanks!

/Jon



On 17. Jan, 2016, at 22:10, Rick Hanson 
<cryptor...@gmail.com><mailto:cryptor...@gmail.com> wrote:

Hi Jon!

On Sun, Jan 17, 2016 at 2:30 PM, Jon Kleiser 
<jon.klei...@fsat.no><mailto:jon.klei...@fsat.no> wrote:


There is a chance I could have managed to run some 64-bit Linux on
this old Mac if I went for a non-GUI version, or a version that was
happy with only 1GB RAM, [...]


If you like Ubuntu-ish and want to see about 64-bit, maybe try
http://lubuntu.net/ on your 1GB RAM machine.  More fun for the
weekend! :)




Fw: PicoLisp on Ubuntu

2016-01-21 Thread Jon Kleiser
Thanks, Chri.

/Jon

From: Jon Kleiser
Sent: 21 January 2016 21:11
To: Christophe Gragnic
Subject: Re: PicoLisp on Ubuntu

Hi Chri,

Wow, great! Thanks.

/Jon

From: Christophe Gragnic <christophegrag...@gmail.com>
Sent: 21 January 2016 21:08
To: Jon Kleiser
Subject: Re: PicoLisp on Ubuntu

Off list:
Did you try `setxkbmap no` ?

chri

On Thu, Jan 21, 2016 at 8:49 PM, Jon Kleiser <jon.klei...@fsat.no> wrote:
> Hi,
>
>
> Others also mentioned Xubuntu, but my old Mac mini cannot handle all DVD and
> CD formats very well. Fortunately Lubuntu had a 64-bit 14.04 .iso DVD that
> my Mac did accept. Now I have 64-bit PicoLisp running ..
>
>
>
> : (cons *CPU (version T))
> -> ("x86-64" 16 1 16)
>
>
> The future is bright. The only thing I have not got, for some reason, is
> Norwegian keyboard layout. It was available during installation, but now I
> cannot find it. I guess I will fix that in a couple of days.
>
>
> /Jon
>
>
> 
> From: picolisp@software-lab.de <picolisp@software-lab.de> on behalf of
> O.Hamann <o.ham...@gmx.net>
> Sent: 19 January 2016 12:09
> To: picolisp@software-lab.de
> Subject: Re: PicoLisp on Ubuntu
>
> Xubuntu could work too.
> And it's possible to switch window systems later, too.
>
>
> On 18.01.2016 09:22, Jon Kleiser wrote:
>
> Hi Rick,
>
> Lubuntu looks very promising. I think I have to give it a try. Thanks!
>
> /Jon
>
> On 17. Jan, 2016, at 22:10, Rick Hanson <cryptor...@gmail.com> wrote:
>
> Hi Jon!
>
> On Sun, Jan 17, 2016 at 2:30 PM, Jon Kleiser <jon.klei...@fsat.no> wrote:
>
> There is a chance I could have managed to run some 64-bit Linux on
> this old Mac if I went for a non-GUI version, or a version that was
> happy with only 1GB RAM, [...]
>
> If you like Ubuntu-ish and want to see about 64-bit, maybe try
> http://lubuntu.net/ on your 1GB RAM machine.  More fun for the
> weekend! :)
>
>



--

http://profgra.org/lycee/ (site pro)
http://delicious.com/profgraorg (liens, favoris)
https://twitter.com/profgraorg
http://microalg.info (langage de programmation pédagogique)
http://expressions.club/ (structure des expressions mathématiques)
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: PicoLisp on Ubuntu

2016-01-18 Thread Jon Kleiser
Hi Rick,

Lubuntu looks very promising. I think I have to give it a try. Thanks!

/Jon

> On 17. Jan, 2016, at 22:10, Rick Hanson <cryptor...@gmail.com> wrote:
> 
> Hi Jon!
> 
> On Sun, Jan 17, 2016 at 2:30 PM, Jon Kleiser <jon.klei...@fsat.no> wrote:
>> There is a chance I could have managed to run some 64-bit Linux on
>> this old Mac if I went for a non-GUI version, or a version that was
>> happy with only 1GB RAM, [...]
> 
> If you like Ubuntu-ish and want to see about 64-bit, maybe try
> http://lubuntu.net/ on your 1GB RAM machine.  More fun for the
> weekend! :)

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


Re: PicoLisp on Ubuntu

2016-01-17 Thread Jon Kleiser
Hi Tomas,

Thanks for your hints. This is part of the info I got:
jkleiser@oldmini:~/picoLisp$ uname -a
Linux oldmini 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:18:00 UTC 
2015 i686 i686 i686 GNU/Linux
jkleiser@oldmini:~/picoLisp$ cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model   : 15
model name  : Intel(R) Core(TM)2 CPU T7200  @ 2.00GHz
stepping: 6
microcode   : 0xc7
cpu MHz : 2000.000
 . . and a lot more.

/Jon

From: picolisp@software-lab.de  on behalf of Tomas 
Hlavaty 
Sent: 17 January 2016 21:20
To: picolisp@software-lab.de
Subject: Re: PicoLisp on Ubuntu

Hi Jon,

> My old Mac mini has an Intel Core 2 Duo, and that is supposed to be a
> 64-bit machine. However, when I should pick the Ubuntu version for
> this Mac from this page http://www.ubuntu.com/download/desktop both
> the drop-down menus says "32-bit — for machines with less than 2GB
> RAM". That is what I picked, and I am afraid that prevents me from

you can try "uname -a" or "cat /proc/cpuinfo" to find out more about the
machine architecture.

Cheers,

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


Re: PicoLisp on Ubuntu

2016-01-17 Thread Jon Kleiser
Hi Alex,

My old Mac mini has an Intel Core 2 Duo, and that is supposed to be a 64-bit 
machine. However, when I should pick the Ubuntu version for this Mac from this 
page
http://www.ubuntu.com/download/desktop
both the drop-down menus says "32-bit — for machines with less than 2GB RAM". 
That is what I picked, and I am afraid that prevents me from running 64-bit 
software.
You are right, when I do (cons *CPU (version T)), then I get
("emu" 16 1 16).
There is a chance I could have managed to run some 64-bit Linux on this old Mac 
if I went for a non-GUI version, or a version that was happy with only 1GB RAM, 
but as it is, I am quite satisfied that I managed to get Linux running at all 
on this Mac.

/Jon


From: picolisp@software-lab.de  on behalf of 
Alexander Burger 
Sent: 17 January 2016 08:08
To: picolisp@software-lab.de
Subject: Re: PicoLisp on Ubuntu

Hi Jon,

> I had an old Mac mini that I had given up as an OSX machine, as it had
> only 1 GB RAM, and it was too difficult (or impossible?) to install more
> ...
>
> One of the first things I installed was PicoLisp, of course. I simply did the
>
> sudo apt-get install picolisp
>
> What I got was 3.1.5.2 C, 32-bit PicoLisp. I was slightly
> disappointed.

Hmm, I don't know, but isn't the Mac mini hardware 32-bits?


> Then today I downloaded the current .tgz from
> software-lab.de. I tried the
> (cd src64; make), and to my delight, I now got 64-bit 16.1.16 working!

If so, perhaps it compiled the emulator, which is the fallback
architecture if the machine is neither arm64, x86_64 or ppc64le?

What does *CPU say? I suspect

   : (cons *CPU (version T))
   -> ("emu" 16 1 16)

♪♫ Alex
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
PԔ � )mX�����zV�u�.n7�

PicoLisp on Ubuntu

2016-01-16 Thread Jon Kleiser
Hi,


I had an old Mac mini that I had given up as an OSX machine, as it had only 1 
GB RAM, and it was too difficult (or impossible?) to install more RAM on it. 
Then I got the idea that maybe that Mac could be made into a Linux machine. I 
had to try several DVDs and CDs, and a USB stick, before I finally had a DVD 
that worked on this old Mac. So here I am, running 32-bit Ubuntu 14.04. It 
works really fine. ;-)

One of the first things I installed was PicoLisp, of course. I simply did the

sudo apt-get install picolisp

What I got was 3.1.5.2 C, 32-bit PicoLisp. I was slightly disappointed. Then 
today I downloaded the current .tgz from 
software-lab.de. I tried the

(cd src64; make), and to my delight, I now got 64-bit 16.1.16 working! That old 
Mac now has a great future.


/Jon


Re: Translation Request

2016-01-05 Thread Jon Kleiser
Hi Alex,

Sorry for being late. The Norwegian “no” translation of “Insert empty row” 
should be “Sett inn tom rad”.

/Jon

> On 5. jan. 2016, at 08.03, Alexander Burger  wrote:
> 
> Hello translators!
> 
> This is to all who helped with the localization of PicoLisp, by
> providing translation strings for the @loc/?? files.
> 
> The new '+InsRowButton' GUI prefix class - a button which inserts an
> empty row into a chart - has a tooltip string
> 
>   ,"Insert empty row"
> 
> I made the German (@loc/de) and Japanese translations (@loc/jp),
> and included all into the rolling release at
> 
>   http://software-lab.de/picoLisp.tgz
> 
> 
> Can someone post translations of the above string for "es", "no", "ru"
> and "se"?
> 
> Thanks!
> ♪♫ Alex
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: Tiny typo in ref

2016-01-05 Thread Jon Kleiser
Hi Alex,

As you can see here 

there are three more places in that ref.html where a “;” is missing (error #51, 
#58, #68).

/Jon

> On 26. Dec, 2015, at 07:27, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> I just noticed that in /doc/ref.html#fun, under Predicates, the name
>> of the “<>” function is coded as “<”. I think it should have been
>> “”.
> 
> Fixed!
> 
> 
>> Merry > 
> Many thanks, and a Merry Christmas and a Happy New Year to all!
> ♪♫ Alex
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

PԔ � )mX�����zV�u�.n7�

Re: Trying to build pil64 on Raspberry Pi

2016-01-05 Thread Jon Kleiser
Hi AW,

Thanks for the patch info! I’ll try it.

/Jon

> On 5. Jan, 2016, at 11:02, Alexander Williams <a...@unscramble.co.jp> wrote:
> 
> Hi Jon,
> 
> The RPi zero has armv6 architecture, which is 32-bit - so there's no way to 
> run the 64-bit PicoLisp.
> 
> Here's a patch and instructions to compile the 32-bit picolisp on ARM:
> 
>   https://gist.github.com/aw/714d1840bbabb782ecb2
> 
> 
> AW
> 
> On Tue, Jan 5, 2016 at 8:20 AM, Jon Kleiser <jon.klei...@fsat.no> wrote:
> Hi,
> 
> Just before Xmas I got the brand new Raspberry Pi Zero, a tiny computer on a 
> tiny card, costing $5. It has got a Broadcom BCM2835 processor (1GHz ARM11 
> core), 512MB of LPDDR2 SDRAM, and is capable of running a lot of useful 
> software (browser, mail, Python, Java).
> 
> <https://www.raspberrypi.org/blog/raspberry-pi-zero/>
> <http://www.arm.com/products/processors/classic/arm11/arm1176.php>
> 
> As I don’t know much about the different kinds of ARM processors, I just 
> wanted to try if 64-bit PicoLisp could run on this Pi Zero, but I may have 
> been a little too optimistic. This is what I got:
> 
> pi@raspberrypi:~/PicoLisp/picoLisp $ (cd src64; make)
> cc -o sysdefs -D_FILE_OFFSET_BITS=64 sysdefs.c
> strip sysdefs
> /mkAsm emu "" .c Linux base "" ../lib/map  version.l glob.l main.l gc.l 
> apply.l flow.l sym.l subr.l big.l io.l db.l net.l err.l sys/emu.code.l
> cc -c -O -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 emu.base.c
> cc -o ../bin/picolisp emu.base.o -Wl,--no-as-needed -rdynamic -lc -lm -ldl
> strip ../bin/picolisp
> /mkAsm emu "" .c Linux ext T ""  ext.l
> ^CMakefile:145: recipe for target 'emu.ext.c' failed
> make: *** [emu.ext.c] Interrupt
> 
> I had to Ctrl-C after it had been “busy” (100% CPU) for a few hours.
> 
> Building 32-bit PicoLisp wasn’t any more successful, but Ersatz ran fine 
> without complains. ;-)
> 
> /Jon
> 



Tiny typo in ref

2015-12-25 Thread Jon Kleiser
Hi,

I just noticed that in /doc/ref.html#fun, under Predicates, the name of the 
“<>” function is coded as “<”. I think it should have been “”.

Merry >

Re: PicoLisp Website

2015-12-14 Thread Jon Kleiser
Hi Vidyuth Kini,

Re. comparable sites: IMO the Ruby page is the best design of the ones you 
mention. To me, the Racket page seems cluttered.

/Jon

> On 14. Dec, 2015, at 09:31, Vidyuth Kini  wrote:
> 
> Hi Erik,
> 
> Great work on the site. I definitely like the new logo. here are my comments:
> 
> 1. Logo is nice, it could be spruced up, like the racket lang logo with 
> shadows etc
> 
> 2. Too much real estate is lost on the first half on the page, if you look at 
> a comparable site, 
> 
> http://racket-lang.org/
> 
> you can see that the logo, title, byline and navigation are all stuck at the 
> top, giving more room for explanatory wordings on the page. 
> 
> I am not sure what you think of that but it is an idea. 
> 
> I think ruby ( https://www.ruby-lang.org/en/ ) does a good job of this too. 
> so does rust ( https://www.rust-lang.org/ ) 
> & Elixir ( http://elixir-lang.org/ )
> 

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


Re: PicoLisp Website

2015-12-13 Thread Jon Kleiser
Hi Erik,


I like your design a lot, and I think your presentation of the PicoLisp 
language and VM is also well done. I suggest you drop the sentence about fresh 
air and stagnant, statically typed world. I think you/we should include a few 
words about which OS platform(s) that are supported, and which are not so much 
supported.

I like the font you've chosen, and I also think your new logo is very nice. (I 
made the old one.)

I think I would have made the black background and the black headings a little 
less black, but that's just my first impression.

I really think PicoLisp deserves a new website design like this. Well done!


/Jon


From: picolisp@software-lab.de  on behalf of Erik 
Gustafson 
Sent: 12 December 2015 19:18
To: picolisp@software-lab.de
Subject: PicoLisp Website

My dearest fellow PicoLispers,

I should have shared this two months ago! I don't know why I didn't. Anyway, I 
think PicoLisp is the coolest and wanted to give something back to the 
community.

I made a functional mock-up of a possible new homepage for PicoLisp, which can 
be found here:

https://github.com/erdg/picolisp-website

I set out to build something that reflected the awesomeness of the language as 
I see it, while respecting everything that came before me. The logo is just a 
different take on the existing logo.  And you'll recognize a lot of the writing 
from various PicoLisp sources and tutorials; I grabbed the bits that I thought 
most effectively described what PicoLisp is about, and weaved them together 
with some of my own prose. I think it's fun read (albeit a little verbose) that 
would inspire newcomers to give PicoLisp more of the attention it deserves.

It was built entirely with PicoLisp, love, and CSS. No frameworks, no extra JS 
(or BS, for that matter). I tried to keep the CSS as minimal and modular as 
possible - just a few tools and utils that I think fit very well into the 
PicoLisp philosophy.

Do try resizing your browser! It's pretty responsive. Not bad for my first 
foray into the world of frontend design :)

Now, I will admit that this falls more towards the designer side of the 
developer/designer spectrum of websites. It's basically a PicoLisp version of 
the Haskell website at this point. I'm not entirely sold on it myself and the 
'Try It' section is pretty corny, but I wanted something concrete to work 
towards and this is what came of that effort.

I'm more than happy to answer any questions about the code or design choices. 
Even more, I'd love to hear what you all think! What do you like? Anything that 
doesn't sit well?

Frankly, my end game is to inspire the community to begin work on a new 
PicoLisp website. PicoLisp has come so, so far in the last year! It's spreading 
to more architectures, embedded devices, more people are joining the mailing 
list than ever, writing and sharing software. I love every second of it! So I 
wanted to give you all something to react to, to start the conversation.

I had a blast creating this, and I hope that comes through!


Peace, love and PicoLisp,
Erik




Printing to file while reading from 'client'

2015-08-04 Thread Jon Kleiser
Hi,

I want to read some chunks from a HTTP connection, starting e.g. like this:

(client www.some.com 80 page.html

Depending on the chunks I read, I want to write some lines to a certain file on 
my disk, say diskfile.txt, and now and then I also want to write a little 
info to my console with (out NIL (prinl SomeInfo)).

Are there better/smarter ways to do this than to use (out +diskfile.txt . . 
.) each time new lines shall be written to the file?

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


Re: Printing to file while reading from 'client'

2015-08-04 Thread Jon Kleiser
Hi Alex,

Thanks a lot! I’ll make up my mind re. which one to use.

/Jon

On 4. Aug, 2015, at 15:42, Alexander Burger a...@software-lab.de wrote:

 Hi Jon,
 
 (client www.some.com 80 page.html
 
 Depending on the chunks I read, I want to write some lines to a
 certain file on my disk, say diskfile.txt, and now and then I also
 want to write a little info to my console with (out NIL (prinl
 SomeInfo)).
 
 Good.
 
 Are there better/smarter ways to do this than to use (out
 +diskfile.txt . . .) each time new lines shall be written to the
 file?
 
 I think that writing with (out +... ...) is perfectly all right. This
 is quite efficient, because the file is opened in append mode so that
 the file pointer is immediately at its end.
 
 If you feel that re-opening the file each time is too expensive, you
 could also open all output channels in the beginning, and close them
 later, e.g.
 
   (client www.some.com 80 page.html
  (out NIL  # Default to stdout
 (let (A (open file1)  B (open file2))
...
(prinl toStdout)
...
(out A (prinl to file1))
...
(out B (prinl to file2))
...
(close A)
(close B) ) ) )
 
 
 If there is a possibility that the body of client is aborted before
 the ending 'close's are reached (e.g. a 'throw' or and error exit), then
 better use 'finally':
 
   (client www.some.com 80 page.html
  (out NIL
 (let? A (open file1)
(finally (close A)
   (let? B (open file2)
  (finally (close B)
 ...
 (prinl toStdout)
 ...
 (out A (prinl to file1))
 ...
 (out B (prinl to file2)) ) ) ) ) ) )
 
 You could 'bench'mark both versions, but I think there'll be no
 significant difference.
 
 ♪♫ Alex

PԔ � j)mX�����zV�u�.n7�

Re: Open Sound Control

2015-07-26 Thread Jon Kleiser
Hi Erik,

Do you know if your library will work with 32-bit PicoLisp? I’m a Mac user, and 
32-bit (and Ersatz) is the only PicoLisp version that I can use.

I have no experience with OSC (Open Sound Control is a protocol for 
communication among computers, sound synthesizers, and other multimedia devices 
that is optimized for modern networking technology), but I have played a little 
with MIDI music. At the moment I’m trying out Web Audio.

/Jon

On 25. jul. 2015, at 23.13, Erik Gustafson 
erik.d.gustaf...@gmail.commailto:erik.d.gustaf...@gmail.com wrote:

Hi all,

I'm working on my first PicoLisp library, native C bindings for Liblo. What I 
have so far, which is enough for the most basic use case, can be found at:

  https://github.com/erdg/picolisp-osc

The file 'liblo.l' contains the direct ffi-bindings to the C library. I stole 
Alex Williams' idea of a rule-based solution from his 'picolisp-json' 
library; it's a great way to get up and running with C functions at the repl.

From there, I decided to scoop it all up into the PicoLisp DB. The files 
'server.l', 'address.l', and 'message.l' contain the code for this. They should 
probably be condensed into one file, 'osc.l', but that hasn't happened yet. You 
can follow along with a sample repl session in the README.

Now I'm wondering if this is a worthwhile path to pursue. I like the idea of 
using the PicoLisp DB, as one could be able to query a bunch of OSC servers and 
their methods, keep a log of messages sent/received, etc., all from PicoLisp. 
But the whole thing could be terribly redundant as far as memory use is 
concerned(?), and because a lot of that functionality exists in the C library 
already. I'm still learning how PicoLisp and C work together.

I'd love any feedback! Apologies in advance, it's all pretty rough right now... 
I've never written a library before, in any language, and this one is nowhere 
near complete. You'll need liblo installed prior, as I have no Makefile magic 
happening yet.

If interested, more info about OSC can be found here:

  
opensoundcontrol.org/introduction-oschttp://opensoundcontrol.org/introduction-osc
  opensoundcontrol.org/spec-1_0http://opensoundcontrol.org/spec-1_0

Many thanks!



Re: OpenGL text and Picolisp

2015-07-16 Thread Jon Kleiser
Hi Alex,

My work on OpenGL for 64-bit PicoLisp ended around 28-Dec-2011, when I sent you 
this email (not to the list):

 I am quite close to having my Chinese Checkers game ready for 64-bit. The 
 functions that I have not cracked yet, are glutBitmapCharacter and 
 glutStrokeCharacter. It is the Font parameter that is the problem. In the 
 attached alpha version of china-gl.l I do a prinl in my drawBitString, 
 instead of calling glutBitmapCharacter. My current openGl.l is also included 
 in the attached china64.tgz. Do you think you can fix the font handling in 
 those two glut functions? (I typically get freeglut stroke font 0x... not 
 found.)
 


You may have the china64.tgz that I mention, but if you need it, I can send it.

/Jon

On 14. Jul, 2015, at 18:05, Alexander Burger a...@software-lab.de wrote:

 Hi Oscar,
 
 On Tue, Jul 14, 2015 at 03:41:39PM +, Oscar wrote:
 Hi Alex, thanks for your answer its like you wrote and it does allocate
 normally now!
 
 Glad to hear!
 
 
 I  have another question, before I also tried to use the glutBitmapCharacter
 function in which one passes a void* with the font, so I did like in the
 opengl.l file and added a def with the font hex as listed in freeglut_std.h
 but when called it says that the font wasn't found.
 Maybe this is a problem in what am feeding to the function, 
 do void* have to be specified different?
 
 No, void* should also be just a number. The 'native' function doesn't
 care anyway to what kind of data a pointer points.
 
 The glutBitmapCharacter used I read was on china-gl.l by Jon Kleiser, 
 but that was for the 32bit version of pico and it used glue code
 to specify the void pointer.
 
 In Jon's china64/openGl.l I find
 
   (de glutBitmapCharacter (Font Character)
  (native `*GlutLib glutBitmapCharacter NIL Font Character) )
 
 
 BTW, Jon + Oscar:
 
 I've lost overview a little bit. But it seems that both of you added
 some useful functions to @lib/openGl.l
 
 Perhaps it makes sense if we add them to the PicoLisp release? If so,
 can one of you send me all relevant additions?
 
 ♪♫ Alex

PԔ � j)mX�����zV�u�.n7�

Re: Pseudo Random Number Generation across PicoLisp implementations

2015-04-23 Thread Jon Kleiser
Hi Chri,

On 22. Apr, 2015, at 22:50, Christophe Gragnic christophegrag...@gmail.com 
wrote:

 . .
 
 Now the question. I found discrepancies between PicoLisp:
 : (rand 1 1000)
 - 1
 : (rand 1 1000)
 - 934
 : (bye)
 
 And Ersatz
 : (rand 1 1000)
 - 1
 : (rand 1 1000)
 - 967
 : (bye)
 
 I tried to inspect the source for getting some explanation with no luck.
 PicoLisp
 https://code.google.com/p/picolisp/source/browse/src/big.c#1213
 Ersatz:
 https://code.google.com/p/picolisp/source/browse/ersatz/fun.src#3325
 Is there a reason for those different behaviours ?
 
 Last thing (mostly for Jon), I read that the PicoLisp generator is
 a 64-bit linear congruential random generator (both pil64 and pil32)
 with the multiplier 6364136223846793005.
 I'd like to implement this generator for EmuLisp. Any advice ?
 Any objection ?
 
 
 chri

Feel free to give it a try. As EmuLisp uses JavaScript numbers, 
6364136223846793005 is too many digits, but you may find a way around it.

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


(name '{abc}) no good in Ersatz

2015-04-13 Thread Jon Kleiser
Hi,

There is probably a simple answer to this (that I should know by now):
Why do I get this when using ersatz . . ?

: (name '{abc})
!? (name '\{abc \})
\{abc -- Can't rename

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


Re: A bcrypt library for PicoLisp

2015-03-17 Thread Jon Kleiser
Hi Alexander W.,

I’m just curious about what kind of development system you’re using. From the 
screen dump in the picolisp-bcrypt/README.md it seems that you are using some 
kind of Mac OSX, but at the same time the README.md says that “PicoLisp 64-bit 
v3.1.9+” is required. Are you using Docker?

/Jon

On 17. Mar, 2015, at 09:52, Alexander Williams a...@unscramble.co.jp wrote:

 Hi all,
 
 I've cooked up yet another library for everyone to enjoy. This time it's for 
 bcrypt hashing:
 
   https://github.com/aw/picolisp-bcrypt
 
 I haven't written an EXPLAIN.MD though, because the code is so brief and 
 doesn't really introduce anything new.
 
 This was written as per someone's request on IRC (beneroth?), and it turns 
 out I needed it as well.
 
 As usual, let me know your comments/suggestions.
 
 Thanks!

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


Google Code closing

2015-03-13 Thread Jon Kleiser
Hi,

It looks like PicoLisp will have to move from Google Code:
http://arstechnica.com/information-technology/2015/03/google-to-close-google-code-open-source-project-hosting/

Maybe GitHub could be a good alternative? I like being able to keep an eye on 
what Alex is working on. ;-)

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


Printing colored text in the console

2015-02-04 Thread Jon Kleiser
Hi,

I wanted to modify Alex' irc client so that I could have some text printed 
color. (I prefer the American spelling color, as that is what’s used in 
computer tech.)
I therefor wrote the following:

(setq *ColorTerm (car (member (sys TERM) '(linux xterm xterm-color 
xterm-256color rxvt

(de useColor (C . Prog)
(when *ColorTerm (call 'tput 'setaf C))
(run Prog)
(when *ColorTerm (call 'tput 'sgr0)) )

Here’s how you may use it to print two lines in green (2):

(useColor 2
(prinl On this system, *ColorTerm is  *ColorTerm)
(prinl That should be fine) )

You may find more info on ANSI colors here:
http://en.wikipedia.org/wiki/ANSI_escape_code#Colors

As I just got hold of Alex’ very latest version of the irc client, I see no 
point in making my old modified version available right now.

See his article here: http://picolisp.com/wiki/?ircClient

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


Wiki: Websockets with PicoLisp, 404

2015-02-02 Thread Jon Kleiser
Hi,

Just want to mention that the wiki page http://picolisp.com/wiki/?Websockets 
contains a link to web.l's websocket demo 
https://bitbucket.org/cyborgar/web.l/src/default/webtest.l?at=default that 
now gives a 404. Does anybody know if this demo code can be found elsewhere?

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


push1q vs. push1, I'm slightly confused

2015-01-27 Thread Jon Kleiser
Hi Alex,

I noticed the new 'push1q' function, and wanted to compare it to the old 
'push1', which I don’t know very well either. I compared your examples in 
doc/refP.html, and to me they looked very similar. I also noticed that you used 
(push1 'S 'b 'd), and not (push1q 'S 'b 'd) in the 'push1q' example, and 
wondered if that was a typo.

Then I re-ran your 'push1q' example (using 32-bit, 3.1.9.6 C), but consequently 
used 'push1' instead of 'push1q', and I got the very same results! I think you 
have to explain the difference between these two functions better. ;-)

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


Re: A Minimal PicoLisp DB/GUI Application, Importing

2015-01-15 Thread Jon Kleiser
Hi Alex,

Now I have got this import thing working. I added the following code at the end 
of the minDbGui.l file:

# To import from tab-separated file, use: (importAddr myAddrDB.csv)
(de importAddr (F)
   (let (Cnt 0  L NIL)
  (in F
 (while (setq L (split (line) ^I))
(dbSync)
(let Obj (request '(+Prs) 'nm (pack (car L)))
   (put Obj 'adr (pack (cadr L)))
   (put Obj 'em (pack (caddr L)))
   (put Obj 'tel (pack (cadddr L)))
   (put Obj 'dob (format (pack (get L 5 )
(commit 'upd)
(inc 'Cnt) ) )
(prinl Lines read:  Cnt) ) )

If I do the import twice from the same file, then I get duplicates of each 
address in the DB. That’s not a big problem, but if it is possible to prevent 
duplicated names by doing something simple, that could be something I’d like to 
do.

Another observation:
One of the addresses in my DB is Veien 1,  Byen”. If I search for 1 in 
Address, I get no match, but if I search for 9 in Address, I get a match. Why 
this difference?

If my DB containes very many addresses, say more than 1000, then a search could 
easily match lot more than the 12 that can be displayed at one time in this 
app. If the number of matches also was quite big, then I think it would have 
been nice to see this number down by the back- and forth-buttons at the bottom. 
Is it easy to get hold of this number?

How many addresses do you think this simple app can handle, without operations 
(search, update) getting very slow? More than 100.000? I’m just curious.

/Jon

On 15. Jan, 2015, at 07:57, Alexander Burger a...@software-lab.de wrote:

 On Wed, Jan 14, 2015 at 05:54:17PM +0100, Alexander Burger wrote:
 A simple example would be
 
   (in myAdrDB.csv
  (while (split (line) ^I)
 (dbSync)
 (let Obj (request '(+Prs) 'nm (pack (car L)))
(put Obj 'adr (pack (cadr L)))
(put Obj ...)
... )
 (commit 'upd) ) )
 
 Not correct of course. Better:
 
   (use L
  (in myAdrDB.csv
 (while (setq L (split (line) ^I))
(dbSync)
... L ...
 -- 

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


RE: A Minimal PicoLisp DB/GUI Application, Importing twice

2015-01-15 Thread Jon Kleiser
Hi Alex,

From: picolisp@software-lab.de picolisp@software-lab.de on behalf of 
Alexander Burger a...@software-lab.de
Sent: 15 January 2015 16:42
To: picolisp@software-lab.de
Subject: Re: A Minimal PicoLisp DB/GUI Application, Importing

Hi Jon,

 (de importAddr (F)
(let (Cnt 0  L NIL)
   (in F
  (while (setq L (split (line) ^I))
 (dbSync)
 (let Obj (request '(+Prs) 'nm (pack (car L)))
(put Obj 'adr (pack (cadr L)))
(put Obj 'em (pack (caddr L)))
(put Obj 'tel (pack (cadddr L)))
(put Obj 'dob (format (pack (get L 5 )
 (commit 'upd)
 (inc 'Cnt) ) )
 (prinl Lines read:  Cnt) ) )

OK, fine. Looks good :)


 If I do the import twice from the same file, then I get duplicates of
 each address in the DB.

This is strange, and should not be the case. Are you sure? The 'request'
prevents that, as long as the names 'nm' are different.

...
♪♫ Alex


Yes, I have now repeated my experiment from scratch, importing same file twice. 
I get duplicates. Here is my myAddrDB.csv file, just replace the vertical bars 
with tabs:

Per|Veien 1|p...@no.no|11223344|712582
Pål|Veien 2|p...@no.no|11223345|712583
Espen Askeladd|Veien 3|es...@no.no|11223346|712584
Ola Normann|Veien 4||11223347|712585

Here is the dumped results:

(obj (+Prs) (1 . 7)
   dob 712584
   tel 11223346
   em es...@no.no
   adr Veien 3
   nm Espen Askeladd )
(obj (+Prs) (1 . 19)
   dob 712584
   tel 11223346
   em es...@no.no
   adr Veien 3
   nm Espen Askeladd )
(obj (+Prs) (1 . 12)
   dob 712585
   tel 11223347
   adr Veien 4
   nm Ola Normann )
(obj (+Prs) (1 . 26)
   dob 712585
   tel 11223347
   adr Veien 4
   nm Ola Normann )
(obj (+Prs) (1 . 2)
   dob 712582
   tel 11223344
   em p...@no.no
   adr Veien 1
   nm Per )
(obj (+Prs) (1 . 13)
   dob 712582
   tel 11223344
   em p...@no.no
   adr Veien 1
   nm Per )
(obj (+Prs) (1 . 6)
   dob 712583
   tel 11223345
   em p...@no.no
   adr Veien 2
   nm Pål )
(obj (+Prs) (1 . 18)
   dob 712583
   tel 11223345
   em p...@no.no
   adr Veien 2
   nm Pål )
(commit)

/JonPԔ � j)mX�����zV�u�.n7�

Re: A Minimal PicoLisp DB/GUI Application, Importing

2015-01-14 Thread Jon Kleiser
Hi Alex,

On 13. Jan, 2015, at 15:37, Alexander Burger a...@software-lab.de wrote:

. . .
 How difficult would it be to create export and import functions, e.g.
 to and from tab-separated files? This could be separate utilities, i.e.
 not a part of the GUI.
 
 That's very easy. There is a report mechanism in PicoLisp. You find
 examples for that in the demo application in the app/ directory. The
 'csv' function is called there, e.g. in sales.l and inventory.l.
 
 Same with import. You can import CSV or XML (an example for the latter
 is in http://picolisp.com/wiki/?osmgeodata). But each case is different,
 depending on the specialities of the format at hand.
 
 
 If you just want an import/export, you could use 'dump'.
 
   (load @lib/too.l)
   (out adrDump.l
  (dump (db nm +Prs @@)) )
 
 You can then do (load adrDump.l) to read the data back.
. . .
 ♪♫ Alex

I’ve got the dump and load working, but I have not yet figured out how to use 
the 'csv’ function for import from a file (I took a look at sales.l and 
“inventory.l”). Maybe it would be just as easy to generate an adrDump.l file 
from a CSV file? The only thing that I don’t understand about the adrDump.l 
file, is the dotted pair after the (+Prs), as here: (obj (+Prs) (1 . 27)
Can that dotted pair be generated according to some simple rule?

/Jon

Re: A Minimal PicoLisp DB/GUI Application, Telephone field

2015-01-14 Thread Jon Kleiser
Hi Alex,

On 14. Jan, 2015, at 13:09, Alexander Burger a...@software-lab.de wrote:

 Hi Jon,
 
 I don’t quite get this. I have done as you suggested, (locale NO
 no) and leading 0, so I can now enter a phone number as 099887766. You
 say it will be stored internally with leading 47 instead of that 0, but
 
 Right. You see that if you look directly into the DB.
 
 
 when I put the mouse over that phone-pencil icon, it seems that
 tel:099887766 is what will be used (and that’s also the href I see in
 the inspector).
 ...
 If I try to dial 022852804 from my mobile, I get number not in use.
 
 I see. So Norway has different systematics with telephone numbers.
 
 I don't understand them, though. In Germany we have the rule that both
 0049 123 456 and +49 123 456 are the same as 0123 456.
 
 A number without a leading zero is a local number (within the same city,
 but that's almost obsolete these days as you can take your number with
 you when you move or change your provider, so you can't rely on that).
 
 The '+TelField' (based on the functions 'telStr' and 'expTel') handles
 this. What are the exact rules for Norway? And how can we handle this
 flexibly?
 
 ♪♫ Alex
 — 

I think this page describes Norwegian telephone numbers quite well:
http://en.wikipedia.org/wiki/Telephone_numbers_in_Norway

It also seems that the Danish numbers are somewhat similar:
http://en.wikipedia.org/wiki/Telephone_numbers_in_Denmark

I may not be the right person to say how we can handle this flexibly. ;-)
I don’t know if it can be of any help, but here is Google’s common Java, C++ 
and JavaScript library for parsing, formatting, storing and validating 
international phone numbers:
https://github.com/googlei18n/libphonenumber

/Jon

Re: A Minimal PicoLisp DB/GUI Application, Search popup puzzle

2015-01-13 Thread Jon Kleiser
Hi Alex,

Thanks. A few more questions:

I would like the Telephone field to accept 8-digit numbers, which is common in 
Norway. At the moment I have to prefix with +47, otherwise I get Bad phone 
number format.

How difficult would it be to create export and import functions, e.g. to and 
from tab-separated files? This could be separate utilities, i.e. not a part of 
the GUI.

How about sorting the names case-insensitive? Now Willy comes before von. 
For a Norwegian, it would also be nice if Å came after Ø, at least in a more 
serious application than this. I’m just curious. ;-)

/Jon

On 13. Jan, 2015, at 13:42, Alexander Burger a...@software-lab.de wrote:

 Hi Jon,
 
 When I’m typing in one of the search fields (Name or Address), a box
 with possible matches pops up, but quite often there are names/addresses
 missing in this box, and I haven’t been able to find a pattern in this.
 If I type a (single) j, k, l, e, i or s, then my name comes up, but not
 if I type just o, n or r. Do you know why?
 
 Yes. The 'nm' relation in the DB model
 
   (rel nm (+Sn +IdxFold +String))
 
 uses two index prefixes:
 
   1. +Sn for the soundex algorithm. It stores a condensed and unified
  pattern in the DB index tree. In case of e.g. Jon Kleiser this
  is JNSLSR. This pattern is used for tolerant searches.
 
   2. +IdxFold applies the 'fold' function the whole name, and stores it
  (i.e. jonkleiser) in the index. Then it splits the name on
  blanks, 'fold's the fragments, and stores substrings of these
  fragments.
 
 But: The substrings are generated only up to a maximal length of three.
 This is to avoid storing lots of single- or double-letter tokens - which
 are not meaningful to search - in the index.
 
 Thus, jon is stored, but not on or n.
 
 If you dump the index, you'll see what's there:
 
   : (scan '(nm . +Prs))
   (JNSLSR {2} . T) {2}
   (eiser {2}) {2}
   (iser {2}) {2}
   (jonkleiser . {2}) {2}
   (kleiser {2}) {2}
   (leiser {2}) {2}
   (ser {2}) {2}
 
 Thus, when you type in the search field, this index is accessed. Typing
 iser or only ser will find something, but o, n or r won't.
 
 ♪♫ Alex


PԔ � j)mX�����zV�u�.n7�

Minor diff between 32-bit and Ersatz re. redefined

2014-12-11 Thread Jon Kleiser
Hi,

If you do

(class +Shape)
(dm T (X Y) (=: x X) (=: y Y))

and then repeat the last line, then Ersatz will say # T +Shape redefined, but 
32-bit PicoLisp will give no such redefined warning. It may not matter very 
much, I just wanted to mention it. (I haven’t tried 64-bit.)

Ersatz does not give such warning if I e.g. repeat (de foo () 'bar).

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


wipe T and meth

2014-11-16 Thread Jon Kleiser
Hi,

I just noticed that it is possible to do (wipe 'T) and (wipe 'meth) and thereby 
setting the values of T and meth to NIL, even though they are protected 
symbols. (I haven’t tested this in 64-bit yet.)

/JonPԔ � j)mX�����zV�u�.n7�

Re: How to match when pattern contains @

2014-11-15 Thread Jon Kleiser
Hi Alex,

Thanks for your reply.

 On 14. nov. 2014, at 17.37, Alexander Burger a...@software-lab.de wrote:
 
 Hi Jon,
 
 Is it possible to write a 'match' expression that will recognize
 (Java) strings like these two?
 
 @foo(bar)
 whitespace@someother(text)
 
 Usually 'match' is not the optimal way to operate on strings. What is
 the situation where you need this?
 

I’m just scanning .java files in a big project, trying to spot text literals 
that should have been coded for localization, and the literals in Java 
annotations of the form @foo(bar) are ones that I just want to skip. 
Efficiency is not a big thing here. I will probably do as you suggest below, 
checking for the @ manually.

/Jon

 If you parse this from a file or stream, it is usually easier and more
 efficient to use 'from', 'till' and/or 'echo', because it works directly
 on the input data without building s-expressions first.
 
 
 I don’t know how to escape the @ so that it will not be handled as a
 wildcard symbol.
 
 'match' doesn't support an escape mechanism. You can check for the @
 manually:
 
   (let Str @foo(\bar\)
  (use (@A @X @Z)
 (and
(match '(@A ( @X ) @Z) (chop Str))
(member @ @A)
... do something ...
 
 The whitespace in the second line doesn’t necessarily have to be
 whitespace. The important thing is that the @ isn’t always in pos. 1.
 
 So this can be handled with the 'member' call above.
 
 
 Operating on the characters is also possible in many ways, e.g. with
 'split':
 
   (let L (split (chop whitespace@someother(\text\)) @ ( ))
  ... operate on the fragments with list functions ...
  (w h i t e s p a c e) 
  (s o m e o t h e r)
  (\ t e x t \)
 
 ♪♫ Alex
 -- 
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

PԔ � j)mX�����zV�u�.n7�

How to match when pattern contains @

2014-11-14 Thread Jon Kleiser
Hi,

Is it possible to write a 'match' expression that will recognize (Java) strings 
like these two?

@foo(bar)
whitespace@someother(text)

I don’t know how to escape the @ so that it will not be handled as a wildcard 
symbol.
The whitespace in the second line doesn’t necessarily have to be whitespace. 
The important thing is that the @ isn’t always in pos. 1.

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


Re: Possible sub? ref. improvements

2014-11-13 Thread Jon Kleiser
Hi Alex,

I added the 'g' to make it clear that 'sub?' doesn’t only check the tail, like 
offset does. If you insist on leaving the 'g' out, you must at least adjust the 
results accordingly. ;-)

/Jon

On 14. Nov, 2014, at 07:42, Alexander Burger a...@software-lab.de wrote:

 Hi Jon,
 
 From what I can see at code.google.com, you missed the last 'g' in
 both of my expressions.
 
 Why is the 'g' important? I omitted it on purpose, to keep the new
 examples ananlog to the old ones above them.
 
 And also I think you forgot the additions
 ('sub?') I suggested to the See also on 'offset' and 'index'.
 
 Right. Thanks! I've added them. Also to 'head'.
 
 ♪♫ Alex



Re: (doc 'caar), (doc 'cadr), (doc 'NIL)

2014-10-07 Thread Jon Kleiser
Hi Alex,

I think all you have to do is to close the tags with /a like this:

a name=caar/a
a name=cadr/a
a name=cdar/a

This seems to validate.

/Jon

On 7. Oct, 2014, at 12:18, Alexander Burger a...@software-lab.de wrote:

 Hi Jon,
 
 On Mon, Oct 06, 2014 at 07:03:41PM +, Jon Kleiser wrote:
 After a little discussion on IRC, Alex decided to change the
 doc/refC.html so that the two lines (43, 44) in doc/rlook.html were no
 longer needed.
 
 Oh, sorry! I just notice that the current solution (i.e. using multiple
 a name=xxx tags) is not valid HTML.
 
 How can this be fixed? Is it not possible to give multiple names?
 
 ♪♫ Alex




Re: (doc 'caar), (doc 'cadr), (doc 'NIL)

2014-10-06 Thread Jon Kleiser
Hi,

After a little discussion on IRC, Alex decided to change the doc/refC.html so 
that the two lines (43, 44) in doc/rlook.html were no longer needed. Now (doc 
'caar), (doc 'cadr) and friends will also work. (doc 'NIL), however, was 
considered not interesting enough to bother with. I can agree.

/Jon

On 3. okt. 2014, at 13:35, Jon Kleiser jon.klei...@fsat.no wrote:

 Hi,
 
 In August, Christophe pointed at some problems with looking up functions like 
 'caar' and 'cadr' in the docs.
 http://www.mail-archive.com/picolisp@software-lab.de/msg04739.html
 
 I fixed the problem in doc/rlook.html by adding a couple of lines (43, 44).
 Now I see there are similar problems when doing (doc 'caar) and (doc 'cadr), 
 and also (doc 'NIL).
 In rlook.html, lookup on variants of 'caar' points you to doc/refC.html#cXr, 
 and lookup on NIL points to doc/ref.html#nilSym. It shouldn’t be too hard to 
 achieve the same for the (doc 'sym) function.
 
 I also had to try (doc 'sym), e.g. (doc 'doc), in ersatz, but there I got
 0:38: execution error: Bad name for file. some object (-37)
 I’m not sure what it takes to fix that.
 
 The reason why (doc 'sym) works at all on my Mac (I was surprised it still 
 did), is that an environment variable BROWSER is set to openurl.sh (without 
 the quotes), and I have a file ~/script/openurl.sh containing this:
 
 #!/bin/sh
 osascript -e open location \$1\
 
 /Jon



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


Big speed diff. 32/64-bit when doing /

2014-09-30 Thread Jon Kleiser
Hi,

I just noticed a surprisingly big difference in execution speed between 32- and 
64-bit PicoLisp when doing divisions. Here is my code:

(setq R (reverse (range 2 18)) P (cons (apply * R) R))
(bench (do 120 (apply / P)))

The first line sets P to (6402373705728000 18 17 16 15 14 13 12 11 10 9 8 7 6 5 
4 3 2).

On my Mac, 32-bit PicoLisp takes some 6.760 sec to do the divisions, while 
64-bit (I’m using my Docker image) takes only 0.308 sec.

32-bit PicoLisp is actually slower at this task than my JavaScript based 
EmuLisp. In Chrome it takes roughly 5.350 sec, but when you think of the 
difference between JavaScript arithmetic and PicoLisp arithmetic, it’s not that 
strange.

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


Re: REPL script and @

2014-09-29 Thread Jon Kleiser
Hi Alex,

On 18. Dec, 2013, at 21:19, Alexander Burger a...@software-lab.de wrote:

 Hi Jon,
 
 I just wrote a little PicoLisp script (for pil32) that simulates
 the REPL, quite similar to the one I did for Ersatz a while ago,
 http://picolisp.com/5000/!wiki?SwingRepl. The new REPL script
 looks like this:
 
 (in NIL
   (until (eof)
   (let (ProgText (pack (line))
   Prog (str ProgText)
   Result (run Prog) )
   (prinl -  (sym Result))
   (flush) ) ) )
 
 It works quite fine, but one minor flaw is that, when you're running
 this REPL, '@' always returns NIL. Is there some simple way to fix
 that?
 
 Yes, you could bind the symbol '@', like in
 
  (in NIL
 (use (Exe Res)
(while (setq Exe (read))
   (prin - )
   (println
  (setq Res
 (let @ Res
(eval Exe) ) ) ) ) ) )
 
 Note that I here use 'read', 'eval' and 'print' directly, so there is no
 need to operate on the string level with 'pack', 'line', 'str' and
 'sym'.
 
 Note also that this REPL exits when NIL is read (while .. (read)), as
 this is also the behavior of the built-in REPL. If you don't want this,
 then your way of (until (eof) ..) is better.
 
 ♪♫ Alex

I just noticed that doing the (prin - ) before the (eval Exe) causes the 
arrow to be printed before the first printed line, e.g. when entering an 
expression like (for N 3 (prinl N)). Instead, the arrow should appear just 
before the final result.
I have now ended up with this:

(in NIL
 (use Res
   (until (eof)
 (setq Res
   (let @ Res
 (eval (read)) ) )
 (prin - )
 (println Res)
 (flush) ) ) )
(bye)

/Jon



Re: REPL script and @

2014-09-29 Thread Jon Kleiser
Hi Alex,

On 29. Sep, 2014, at 15:40, Alexander Burger a...@software-lab.de wrote:

 Hi Jon,
 
 I just noticed that doing the (prin - ) before the (eval Exe)
 causes the arrow to be printed before the first printed line, e.g. when
 entering an expression like (for N 3 (prinl N)). Instead, the arrow
 should appear just before the final result.
 I have now ended up with this:
 
 (in NIL
 (use Res
   (until (eof)
 (setq Res
   (let @ Res
 (eval (read)) ) )
 (prin - )
 (println Res)
 (flush) ) ) )
 
 Yes, right. That's better.
 
 The (flush) at the end is actually not needed, because the end-of-line
 in 'println' flushes the output automatically. However 'prin' does not,
 so I would move the (flush) up:
 
   (prin - )
   (flush)
   (println Res) ) ) )
 
 This is critical only when printing the result takes a long time. You
 see that, for example, if you calculate a big number which takes time to
 convert upon output.
 
   : (** 1 1)
 
 The -  appears immediately due to the (flush), but the digits 1000...
 only after a second or so.
 
 ♪♫ Alex


Thanks. I tried moving (flush) up, but it didn’t work well in my websocketd 
setup. The effect was that the arrow and result didn’t appear until I entered a 
new command, so it seemed as if ‘println’ didn’t flush. I’ll keep my (flush) at 
the end. ;-)
I’m using 32-bit PicoLisp.

/Jon

My first Docker project, picolisp64

2014-09-19 Thread Jon Kleiser
Hi,

Here it is: https://registry.hub.docker.com/u/jkleiser/picolisp64/

I had some problems getting the system date right, but now it seems to work 
Let’s hope it will continue that way. If it is not working like it should, 
maybe you’ll have to tweak the /etc/ntp.conf file. You may use nano 
/etc/ntp.conf.

Enjoy!

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


Re: Missing function for locating string fragment?

2014-09-15 Thread Jon Kleiser
Hi Alex,

On 12. Sep, 2014, at 16:06, Alexander Burger a...@software-lab.de wrote:

 It is not a good idea to build a list only to count its length. Better
 count in a loop directly, e.g.:
 
   (de sindex (Frag Src)
  (for ((I . L) (chop Src) L (cdr L))
 (T (pre? Frag L) I) ) )

For this 'sindex' I think it would be good to first test if Frag is NIL, since 
with your version above (sindex NIL foo) would give 1. Therefor I would do 
this:

(de sindex (Frag Src)
  (if Frag
(for ((I . L) (chop Src) L (cdr L))
  (T (pre? Frag L) I) ) ) )

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


pre?, minor difference between 32-bit and ersatz

2014-09-13 Thread Jon Kleiser
Hi,

I just noticed that in 32-bit PicoLisp (pre? 12 1234) returns the symbol 
1234, while in ersatz the same (pre? 12 1234) returns the number 1234. The 
latter is what the docs describes.
I have not tested this in 64-bit PicoLisp.

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


Functions 'any' and 'str'

2014-09-12 Thread Jon Kleiser
Hi,

Is (any S) equivalent to (car (str S)), as long as S is a symbol?

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


Missing function for locating string fragment?

2014-09-12 Thread Jon Kleiser
Hi,

The other day I noticed that I hadn't seen a PicoLisp function for locating a 
string fragment within a longer string. Is there one that I just have failed to 
notice? It is quite common for programming languages to have an index 
function that does this. PicoLisp has an 'index' function, but that one cannot 
be used like this: (index Li PicoLisp)

One way to make up the function I'm missing, could be like this:

(de sindex (Frag Src)
   (if (match (make (link '@A) (mapcar link (chop Frag)) (link '@B)) (chop Src))
  (length @A) ) )

Then (sindex Li PicoLisp) would give 4. Maybe it would be preferable for it 
to give 5.
As it is quite common for PicoLisp functions to have different behaviours 
depending on the type of input, the behaviour of my 'sindex' could also be made 
a part of the standard PicoLisp 'index' function.

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


  1   2   3   >