Re: Vip and different file types

2017-02-24 Thread Alexander Burger
Hi Erik,

> Does Vip recognize different file types?

Not at the moment. It is totally focused on PicoLisp :)


> My end goal is for C/Javascript comments to be rendered properly when those
> files
> are being edited. I think this would only involve a substitute 'markup'
> function which
> swaps PL comment syntax for C comment syntax to be executed when Vip is
> called
> with a C/JS file?

Correct.


> Maybe the alternate 'markupC' could be called through 'load>'? Something
> like,
> 
>(dm load> ()
>   (if (is-c-or-js-file? (: file))
> ...
> I haven't made a serious attempt to get it working yet, would the above be
> headed in
> the right direction?

You could define a 'load>' method for the '+Buffer' class, or just a function as
it is now (as there is only one class).

A function would dispatch in the above way

   (de markup (Lst)
  (if (is-c-or-js-file? (: file))
  ...

A method would make sense if you defined various buffer classes, '+PilBuffer',
'+CBuffer', '+JsBuffer' each with its own 'load>' method (so the above 'if' is
not needed). A new file could be loaded in the default '+Buffer', and the class
changed dynamically if a certain file type is detected. The class could actually
change repeatedly, depending on what vip believes to recognize while you type in
the buffer :)

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


Re: Future of PicoLisp?

2017-02-24 Thread Alexander Burger
On Fri, Feb 24, 2017 at 08:25:21AM -0600, Erik Gustafson wrote:
> and also javascript (json, frameworks, ...)
> 
> Now we're talking! I think PicoLisp would pair nicely with some of the
> popular libraries and frameworks. Joe built
> https://github.com/joebo/pil-mithril-scaffold. A similar project for React

Interfacing with JavaScript is indeed quite simple.

In addition to the built-in stuff in @lib/form.js (including a JS lisp()
function which calls a Lisp function on the server!), or @lib/canvas.js for
canvas drawing, I interfaced to the TinyMCE editor (also in the distribution, in
@lib/tinymce.l) for some projects, e.g. https://BlitzMenu.7fach.de

Another example are the social privacy buttons (used in picolisp.com or
sushi.7fach.de), available in http://software-lab.de/socialshareprivacy.tgz.

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


Re: Future of PicoLisp?

2017-02-24 Thread Alexander Burger
On Fri, Feb 24, 2017 at 08:34:20AM -0600, Erik Gustafson wrote:
> > picolisp.com server is currently a mix of Wheezy, Jessie and Stretch, and
> > whatever I tried to get the certbot running resulted in a storm of Python
> > package mismatch error messages. No way .. I gave up, and decided to wait
> > until
> > Debian Stretch is stable and thus available from my provider.
> >
> 
> Sounds like a headache, I don't blame you. I'll be cheering for the Debian
> folks this
> year!

Thanks!

BTW, if need be, picolisp.com can be reached with HTTPS also under

   https://7fach.de/wiki

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


Re: Destructive element modification?

2017-02-24 Thread Mike Pechkin
ast start point:
http://ideone.com/zPndpA

On Sat, Feb 25, 2017 at 9:01 AM, Christopher Howard <
christopher.how...@qlfiles.net> wrote:

> Hi list. How do I *destructively* modify the value of one element in a
> list? E.g.
>
> (setq Lst (1 2 3 4))
>
> How do I set the second element to be 10, without creating a new list,
> and without using "con" to change a lot of the list?
>
> --
> https://qlfiles.net
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Destructive element modification?

2017-02-24 Thread Christopher Howard
Hi list. How do I *destructively* modify the value of one element in a
list? E.g.

(setq Lst (1 2 3 4))

How do I set the second element to be 10, without creating a new list,
and without using "con" to change a lot of the list?

-- 
https://qlfiles.net
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


P35 Prime Factors

2017-02-24 Thread Lindsay John Lawrence
Does anyone know the algorithm that is being expressed here?

I am trying to understand the code... http://picolisp.com/wiki/?99p35

de prime-factors (N)
   (make
  (let (D 2  L (1 2 2 . (4 2 4 2 4 6 2 6 .))  M (sqrt N))
 (while (>= M D)
(if (=0 (% N D))
   (setq M (sqrt (setq N (/ N (link D)
   (inc 'D (pop 'L)) ) )
 (link N) ) ) )

and  having difficulties understanding the purpose of the circular list.

/Lindsay


exercism.io

2017-02-24 Thread Mike Pechkin
hi all,

I've implemented tasks from A to F:
https://bitbucket.org/mihailp/tankfeeder/src/9de46f9e807786fdbf4a86604aca20dd25f0c19e/exercism-io/?at=default

o) dumbest and duplicates from rosettacode ignored
o) worth to check are Alphametrics and Change

If you want:
o) pick up one task
o) set reservation
o) implement and send your code
o) repeat

Mike


BBWT

2017-02-24 Thread Lindsay John Lawrence
Bijective Burrows Wheeler Transform

https://github.com/thinknlive/picolisp-bbwt

As I was working on this I realized I need to start thinking about how to
organize my code...

The two main functions, encodeBBWT and decodeBBWT feel larger than they
should be because I have defined smaller functions within them that use
variables in the same scope.

My question:  Is there an 'idiomatic' or recommended way to organize module
or project code in picolisp?

/Lindsay

P.S. I haven't paid much attention to namespaces or module management in
picolisp until now so I'll spend some time reading the docs with that in
mind.


Re: Future of PicoLisp?

2017-02-24 Thread Mansur Mamkin
Hi all!
About certbot:
See also other tools:
https://www.metachris.com/2015/12/comparison-of-10-acme-lets-encrypt-clients/
I've seen acmetool in action (written in Golang, so it requires no 
dependencies).
I see there is a tool, written even in Bash 

Best regards, 
Mansur

--skipped--
>> And let's make sure said landing page is served over HTTPS. It's 2017.
>
>Yes, yes, I know ;) In fact, it is on my todo list since half a year.
>
>I want to use Let's Encrypt, as I already do on another server. However, the
>picolisp.com server is currently a mix of Wheezy, Jessie and Stretch, and
>whatever I tried to get the certbot running resulted in a storm of Python
>package mismatch error messages. No way .. I gave up, and decided to wait until
>Debian Stretch is stable and thus available from my provider.
>
>♪♫ Alex
>-- 
>UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe





Re: Future of PicoLisp?

2017-02-24 Thread Lindsay John Lawrence
Hi Alex,

I've been using LetsEncrypt.

This page https://gethttpsforfree.com clearly documents the steps to get a
certificate manually.
I ended up writing an automated javascript (nodejs) version of the steps on
that page that works for my purposes but is essentially just 'get it done'
 code.

It should be straightforward to write a picolisp version of it...

/Lindsay



On Thu, Feb 23, 2017 at 11:45 PM, Alexander Burger 
wrote:

> Hi Erik,
>
> thanks for the long post!
>
> Just in short:
>
> > 'Learn PicoLisp the Hard Way'
>
> I totally agree. This would be a great project, I'm ready to join.
> Same for Stack Overflow support.
>
>
> > And let's make sure said landing page is served over HTTPS. It's 2017.
>
> Yes, yes, I know ;) In fact, it is on my todo list since half a year.
>
> I want to use Let's Encrypt, as I already do on another server. However,
> the
> picolisp.com server is currently a mix of Wheezy, Jessie and Stretch, and
> whatever I tried to get the certbot running resulted in a storm of Python
> package mismatch error messages. No way .. I gave up, and decided to wait
> until
> Debian Stretch is stable and thus available from my provider.
>
> ♪♫ Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Vip and different file types

2017-02-24 Thread Erik Gustafson
Hi Alex,

Does Vip recognize different file types?

My end goal is for C/Javascript comments to be rendered properly when those
files
are being edited. I think this would only involve a substitute 'markup'
function which
swaps PL comment syntax for C comment syntax to be executed when Vip is
called
with a C/JS file?

Maybe the alternate 'markupC' could be called through 'load>'? Something
like,

   (dm load> ()
  (if (is-c-or-js-file? (: file))
 (markupC
(=: text
   ... )
 (markup   # else markup as normal
... )
 ... )

I haven't made a serious attempt to get it working yet, would the above be
headed in
the right direction?

Thanks,
Erik


Re: Future of PicoLisp?

2017-02-24 Thread Erik Gustafson
Hi Alex,

> 'Learn PicoLisp the Hard Way'
>
> I totally agree. This would be a great project, I'm ready to join.
> Same for Stack Overflow support.
>

Great! I'll reach out to Zed and confirm that this is still kosher.


> Yes, yes, I know ;) In fact, it is on my todo list since half a year.
>
> I want to use Let's Encrypt, as I already do on another server. However,
> the
> picolisp.com server is currently a mix of Wheezy, Jessie and Stretch, and
> whatever I tried to get the certbot running resulted in a storm of Python
> package mismatch error messages. No way .. I gave up, and decided to wait
> until
> Debian Stretch is stable and thus available from my provider.
>

Sounds like a headache, I don't blame you. I'll be cheering for the Debian
folks this
year!

- Erik


Re: Future of PicoLisp?

2017-02-24 Thread Erik Gustafson
Hi Andrés,


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

Great, thanks!


> I also think it's a great idea since I think picolisp has a strong
> strength in web developing but just because it's 2017 I feel the effort
> must be put in integrating picolisp with web (W3C) technologies (css, html
> 5, xml, websockets...)
>

I think we're doing fairly well here. css is very easy to integrate, see
http://picolisp.com/wiki/?css

For html 5, I usually just define the tags I need on a per project basis,
like the other tag functions in the 'lib/xhtml.l', e.g.

   (load "@lib/xhtml.l")

   (de  (Attr . Prg)
  (tag 'section Attr 2 Prg)
  (prinl) )

Henrik and Jose have done work with websockets. See:
https://bitbucket.org/hsarvell/pl-web

But don't let that stop you from running with your own ideas!

and also javascript (json, frameworks, ...)
>

Now we're talking! I think PicoLisp would pair nicely with some of the
popular libraries and frameworks. Joe built
https://github.com/joebo/pil-mithril-scaffold. A similar project for React
or Vue with a PicoLisp DB would be cool! I
made an attempt with React last year, but did not progress beyond a couple
'Hello World' programs and a clone
of the React Comment Box Tutorial backed by a PicoLisp DB.
https://github.com/erdg/picolisp-react

Anything that could help introduce PicoLisp and its built-in DB to a wider
web-dev audience would be time well
spent, in my mind. I'm happy to collaborate on that front!

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

I know others have used similar setups in the past (Henrik, was it?). Is
there an existing write-up regarding this?

- Erik


Re: Future of PicoLisp?

2017-02-24 Thread Jakob Eriksson
And I would be interested in working on a package or module system similar to 
"pip" for Python.

I must confess that most discussions about namespaces etc on this list is way 
over my head... however could I be on the right track if I were to assume that 
using "local" in such modules would be a good start, so as to only export 
deliberately exposed symbols from a package?




> 24 feb. 2017 kl. 08:45 skrev Alexander Burger :
> 
> Hi Erik,
> 
> thanks for the long post!
> 
> Just in short:
> 
>> 'Learn PicoLisp the Hard Way'
> 
> I totally agree. This would be a great project, I'm ready to join.
> Same for Stack Overflow support.
> 
> 
>> And let's make sure said landing page is served over HTTPS. It's 2017.
> 
> Yes, yes, I know ;) In fact, it is on my todo list since half a year.
> 
> I want to use Let's Encrypt, as I already do on another server. However, the
> picolisp.com server is currently a mix of Wheezy, Jessie and Stretch, and
> whatever I tried to get the certbot running resulted in a storm of Python
> package mismatch error messages. No way .. I gave up, and decided to wait 
> until
> Debian Stretch is stable and thus available from my provider.
> 
> ♪♫ Alex
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

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