Re: The behaviour of arg

2016-11-11 Thread Alexander Burger
Hi Henrik, Andreas,

> I guess this is the unforgiving punishment for calling (arg) without
> calling (next) previously, consider the reference:
> "If cnt is not given, the value that was returned from the last call
> to next" -> no previous call to next -> invalid usage -> punishment

Exactly! In fact, 'arg' should check such illegal usage. It is a
secondary function, and not much used.


The main workhorse for variable arguments is 'next', and often
all that is needed:

   : (de f @
  (while (next)
 (println @) ) )

   -> f
   :  (f 1 2 3)
   1
   2
   3

The purpose of 'arg' is to avoid the overhead of a local variable if
the value is used more than once.

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


Unsubscribe

2016-11-11 Thread cat stevens



RE: The behaviour of arg

2016-11-11 Thread andreas
Hi Henrik

Nice to read something from you, also the other emails, I'm looking forward to 
check out your new code!

I immediately get SEGFAULT when calling your atst. Running pil64 on Linux 64bit 
(ubuntu).
On which OS are you?

I guess this is the unforgiving punishment for calling (arg) without calling 
(next) previously, consider the reference:
"If cnt is not given, the value that was returned from the last call to next" 
-> no previous call to next -> invalid usage -> punishment

The following works for me:

(de atst @
   (next)
   (println (arg)) )

arg seems to be a special purpose function.

if you just want to have the whole list of arguments, use (rest) instead:

: (de atst @
   (println (rest) ) )
-> atst
: (atst 1 2 3)
(1 2 3)
-> (1 2 3)

Greatings,
beneroth




- Original Message -
From: Henrik Sarvell [mailto:hsarv...@gmail.com]
To: picolisp@software-lab.de
Sent: Fri, 11 Nov 2016 23:08:04 +0100
Subject: The behaviour of arg

Hi Alex and list.

If I do like this:

(de atst @
   (println (arg)) )
(atst 1 2 3)
(bye)

I never reach (bye) and I can't even abort with ctrl-c or d (had to
kill -9), is there a reason for this unforgiving punishment of arg
abuse or did I find some minor bug?
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


The behaviour of arg

2016-11-11 Thread Henrik Sarvell
Hi Alex and list.

If I do like this:

(de atst @
   (println (arg)) )
(atst 1 2 3)
(bye)

I never reach (bye) and I can't even abort with ctrl-c or d (had to
kill -9), is there a reason for this unforgiving punishment of arg
abuse or did I find some minor bug?
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Date library

2016-11-11 Thread Henrik Sarvell
Hi everyone, I'm announcing the newest addition to the Ext library, a
date class, I couldn't find anything like it already.

It's not fully tested but I'm putting it out anyway to prevent someone
from wasting 4-5 hours of their life by writing duplicate code:
https://bitbucket.org/hsarvell/ext/src/b11c78ae998597e7964f3fa88f638c43d2a9584f/dt.l?at=default=file-view-default
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: password hashes

2016-11-11 Thread Henrik Sarvell
Great, will try to use this in Macropis instead of shell commands.

On Mon, Nov 7, 2016 at 4:07 PM, Mike Pechkin  wrote:
> hi,
>
> 1. Now I have a full collection of password hashes:
> bcrypt
> pbkdf2
> scrypt
> 2. yescrypt and Argon2 are candidates in the future.
> Every hash works slower and slower already.
> 3. I've implement local password hasher pilpwd as (pbkdf2+sha256)
> 4 Ideas for future online minimalism version: https+native+Argon2 as mimic
> of
> https://getvau.lt/
> https://www.pwdhash.com/
> https://lesspass.com/#/
>
> All code are here:
> https://bitbucket.org/mihailp/tankfeeder/src/aea7dd71f485f5b6631f1d00afa04ce9f0b35948/crypto/?at=default
>
> Mike
>
>
>
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Simple Routing for web apps

2016-11-11 Thread Henrik Sarvell
Hi Joe, you might want to take a look at Jose's stuff:
https://bitbucket.org/iromero91/web.l/src/718174234c82c0d5931754d6c172ef6799eed54d?at=default

I'm the author of pl-web ( https://bitbucket.org/hsarvell/pl-web ),
it's a bit different than the pure blabla -> blabla mapping, it
doesn't provide that out of the box, just a few globals that you can
use to create something like Macropis for instance:
https://bitbucket.org/hsarvell/macropis

I just noted that the websocket docs on the pl-web page is very
outdated, will try to update it when time permits.



On Fri, Nov 11, 2016 at 6:31 PM, Alexander Burger  wrote:
> On Fri, Nov 11, 2016 at 10:50:00AM -0500, Joe Golden wrote:
>> " http[s]://server.org/12345/path/file
>>
>>   is forwarded to a server on localhost listening on port 12345, to ask for 
>> the resource "path/file". "
>>
>> How is this resource generated from the "path/file" request. Is
>> "path/file" a real pathname and file? I come from Drupal and PHP and the
>> URLs are all "virtual" or simply patterns and don't refer to a real
>> filesystem
>
> That's a valid question. In case of PicoLisp, all such pathnames in URLs
> are relative to the current working directory of the server process.
> This is normally the PWD the server was started in (in case of httpGate
> the 4th config parameter). No magic involved :)
>
> ♪♫ Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Simple Routing for web apps

2016-11-11 Thread Alexander Burger
On Fri, Nov 11, 2016 at 10:50:00AM -0500, Joe Golden wrote:
> " http[s]://server.org/12345/path/file
> 
>   is forwarded to a server on localhost listening on port 12345, to ask for 
> the resource "path/file". "
> 
> How is this resource generated from the "path/file" request. Is
> "path/file" a real pathname and file? I come from Drupal and PHP and the
> URLs are all "virtual" or simply patterns and don't refer to a real
> filesystem

That's a valid question. In case of PicoLisp, all such pathnames in URLs
are relative to the current working directory of the server process.
This is normally the PWD the server was started in (in case of httpGate
the 4th config parameter). No magic involved :)

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


Re: Subscribe

2016-11-11 Thread Joe Bogner
Hi dean,

Welcome!

I would probably do this:

: (in '(ls) (make (until (eof) (link (line T)
-> ("app" "bin" "CHANGES" "COPYING" "CREDITS" "cygwin" "db2" "dbg"
"dbg.l" "dev" "doc" "doc64" "ersatz" "ext.l" "games" "img" "INSTALL"
"lib" "lib.css" "lib.l" "loc" "man" "misc" "picoblogorg" "pil" "plmod"
"rcsim" "README" "simul" "src" "src64" "test")

Some comments:

pil makes it easy to experiment. I would first start with this experiment:

: (in '(ls) (line T))
-> "app"

We see that it returns a single item. So, we want to build a list of
multiple items. An efficient way to do this is with make/link. We can
loop until eof using (until (eof))

Hope this helps!
Joe



On Fri, Nov 11, 2016 at 8:07 AM, dean  wrote:
> I'm just wondering how you would capture the output from 'ls' to a list for
> further processing.
> I the first instance...I'd like to cd to a specified dir and caputure all
> subdir names so that I can
> cd to them in turn and process their pdf files, labelled 2005.pdf, 2006.pdf
> etc
>
> I've been playing around with the examples
>
>
> I tried to bend this
> https://rosettacode.org/wiki/Get_system_command_output#PicoLisp
>
> : (in '(uname "-om") (line T))
>
> to
>
> : (in (call 'ls) (line T))
>
> but no-go
>
> Thank you in anticipation for your consideration and for
>
> creating and supporting such an interesting little language.
>
> BTW This is my very first lisp program let alone picolisp program.
>
>
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


RE: Subscribe

2016-11-11 Thread andreas
Hi Dean

Welcome to the picolisp community.

When using (in (list)) you don't need to use (call), the content of the list 
argument to (in) get directly passed to the command line.

So try:  (in (list 'ls) (line T))
this is the same as: (in '(ls) (line T)

This way you only read the first line of stdout from the called program ls.
You can use (make) and (link) to build a list, e.g.

(setq FileList
   (make
  (in (list 'ls)
  (while (line T)
 (link @) ) ) ) )

(make) returns a list which is here saved in the variable FileList.

You can view FileList by just entering the name of the variable in the REPL

Subscribe

2016-11-11 Thread dean
I'm just wondering how you would capture the output from 'ls' to a list for
further processing.
I the first instance...I'd like to cd to a specified dir and caputure all
subdir names so that I can
cd to them in turn and process their pdf files, labelled 2005.pdf, 2006.pdf
etc

I've been playing around with the examples


I tried to bend this
https://rosettacode.org/wiki/Get_system_command_output#PicoLisp

: (in '(uname "-om") (line T))

to

: (in (call 'ls) (line T))

but no-go

Thank you in anticipation for your consideration and for

creating and supporting such an interesting little language.

BTW This is my very first lisp program let alone picolisp program.


Subscribe

2016-11-11 Thread CILz

Hello CILz  :-)
You are now subscribed


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