Re: binding free symbols in a lambda definition

2017-02-08 Thread Alexander Burger
On Wed, Feb 08, 2017 at 01:57:22PM +0100, pd wrote: > *I feel* curry to be a unfortunate name for that function because I expect > curry to be a function that once applied to another function with n > parameters it returns a chain of applying functions with exactly one > argument, that is having:

Re: unit testing?

2017-02-08 Thread Christophe Gragnic
On Wed, Feb 8, 2017 at 12:13 PM, Alexander Burger wrote: >> I'm thinking of Python's `if __name__ == '__main__' and Perl's unless >> (caller) {...} > > I don't know Python and Perl well enough. But perhaps 'once' is what you think > of? > >(once (load "xxx.l")) No, it's

Re: binding free symbols in a lambda definition

2017-02-08 Thread Erik Gustafson
But picolisp curry function doesn't do that, it simply returns a lambda with 1 parameter having the other one properly substituted with its value thus making impossible to partially apply the returned function I still think 'curry' is what you want. Note that 'curry' works with an arbitrary

Re: unit testing?

2017-02-08 Thread dean
Hi Alex and Christophe In Python that __name__ variable stops things like a local main proc from executing altogether...when Python detects that the module in which it exists no longer needs it because it is being loaded by a bigger program, which accesses the module's code like the local main

Re: binding free symbols in a lambda definition

2017-02-08 Thread pd
Thanks for your replies, I think your "subst" is exactly the same to newlisp "expand" But picolisp curry function doesn't do that, it simply returns a lambda > with 1 parameter having the other one properly substituted with its value > thus making impossible to partially apply the returned

Re: binding free symbols in a lambda definition

2017-02-08 Thread Alexander Burger
On Wed, Feb 08, 2017 at 06:37:17PM +0100, pd wrote: > Picolisp curry function does not follow the pattern, its domain is > completely different and also its image. In other words, you call classical > curry passing it a function argument but you call picolisp curry passing it > several arguments

Re: Modularization / Shared Libraries

2017-02-08 Thread Alexander Burger
Hi Christopher, > Thank you. Could you explain this code: > > (load >"@test/src/main.l" >"@test/src/apply.l" >... > > How is the "@" character being used here? The reference documentation > mentions the wildcard character in conjunction with match and fill, but > I'm not clear on

Re: binding free symbols in a lambda definition

2017-02-08 Thread Erik Gustafson
Ahh, I see what you mean. I was not as familiar with the classical curry, as I was first introduced to the concept through PL. Thanks for clarifying with the great write-up! On Feb 8, 2017 11:45 AM, "pd" wrote: > Thanks for your replies, I think your "subst" is exactly the

Re: Modularization / Shared Libraries

2017-02-08 Thread Christopher Howard
Thank you. Could you explain this code: (load "@test/src/main.l" "@test/src/apply.l" "@test/src/flow.l" "@test/src/sym.l" "@test/src/subr.l" "@test/src/big.l" "@test/src/io.l" "@test/src/db.l" "@test/src/net.l" "@test/src/ext.l" "@test/src/ht.l" ) How is the "@"

Re: Modularization / Shared Libraries

2017-02-08 Thread Erik Gustafson
Thank you. Could you explain this code: (load "@test/src/main.l" "@test/src/apply.l" "@test/src/flow.l" "@test/src/sym.l" "@test/src/subr.l" "@test/src/big.l" "@test/src/io.l" "@test/src/db.l" "@test/src/net.l" "@test/src/ext.l" "@test/src/ht.l" ) How is the "@"

Re: binding free symbols in a lambda definition

2017-02-08 Thread pd
Hi Alex > The classical curry in picolisp is what Alex has defined a few emails > > before ;-) > > I never saw a use for the classical curry, so I (ab)used this catchy name > :) > > Can you give an example where it is useful in PicoLisp? > I'm a newbie to picolisp I don't know enough picolisp to

Re: Future of PicoLisp?

2017-02-08 Thread Henrik Sarvell
How convenient then that compiling PL is trivial, it's probably the easiest and most hassle free thing I've ever had to compile from source. On Fri, Feb 3, 2017 at 8:47 AM, Alexander Burger wrote: > Hi all, > > the future of PicoLisp is dark. I'm not sure if it can survive

Appimage.org

2017-02-08 Thread Jakob Eriksson
Could someone check out http://appimage.org ? It seems to gain momentum now and PicoLisp in that format would make it really easy to use. Best regards, Jakob -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

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.

unit testing?

2017-02-08 Thread dean
When developing non-trivial functions in isolationyou need to copy some of the supporting scaffolding over from your main program to support it. When you subsequently come to "load" the module into your main program...there's a danger of duplicate scaffolding. Is there some way to hide the

Re: unit testing?

2017-02-08 Thread Alexander Burger
On Wed, Feb 08, 2017 at 09:52:58AM +, dean wrote: > When developing non-trivial functions in isolationyou need to copy some > of the supporting scaffolding over from your main program to support it. > When you subsequently come to "load" the module into your main > program...there's a

Re: binding free symbols in a lambda definition

2017-02-08 Thread pd
On Wed, Feb 8, 2017 at 7:15 AM, Lindsay John Lawrence < lawrence.lindsayj...@gmail.com> wrote: > 'fill' (http://software-lab.de/doc/refF.html#fill) does the job in some > cases as well and is a bit easier to read... > > : (de adder (N) (let @X N (fill '((x) (+ x @X) > -> adder > > this is a

Re: binding free symbols in a lambda definition

2017-02-08 Thread Lindsay John Lawrence
Alex, My mistake! In playing with that code, I had defined (setq L 99) shortly before that and forgotten I had done so. Without that, as you pointed out : (de myf (F L) (F L)) -> myf : (let (L 99) (myf '((x) (+ (car x) `L)) (1 2))) -> NIL A good lesson in taking care with scope and current

Re: Modularization / Shared Libraries

2017-02-08 Thread Mike Pechkin
On Wed, Feb 8, 2017 at 3:20 PM, Christopher Howard < christopher.how...@qlfiles.net> wrote: > Hi all, picolisp newbie here. I was trying to figure out how to > "modularize" my code; there doesn't seem to be a module system built in, > but the reference doc did mention support for shared

Mips / LibreCMC build

2017-02-08 Thread Christopher Howard
Hi all, I was able to compile picolisp for mips32r2 to run on librecmc-1.3.4, which I did for the purpose of having a lisp interpreter on my TPE-R1100. I would like to share the build with the world. Did you guys want to host the build somehow, or did you want me to host elsewhere and then link to

Re: binding free symbols in a lambda definition

2017-02-08 Thread Lindsay John Lawrence
And then there's this... (From "Lisp 1.5 Programmer's Manual".. McCarthy... )... # This function gives the result of substituting the S-expression # x for all occurrences of the atomic symbol y in the S-expression z. (de subst (X Y Z) (cond ((= Y Z) X) ((atom Z) Z) (T (cons

Re: Mips / LibreCMC build

2017-02-08 Thread Mike Pechkin
On Wed, Feb 8, 2017 at 3:45 PM, Christopher Howard < christopher.how...@qlfiles.net> wrote: > I would like to share the build with the world. Did you > guys want to host the build somehow, or did you want me to host > elsewhere and then link to my repo? ​You could​ ​ create page on

Re: binding free symbols in a lambda definition

2017-02-08 Thread pd
On Wed, Feb 8, 2017 at 5:37 AM, Erik Gustafson wrote: > I think 'curry' is what you're looking for. Your 'adder' example could be > written as: > >: (de adder (@N) (curry (@N) (X) (+ X @N))) >-> adder >: (adder 3) >-> ((X) (+ X 3)) >: (doc 'curry)

Modularization / Shared Libraries

2017-02-08 Thread Christopher Howard
Hi all, picolisp newbie here. I was trying to figure out how to "modularize" my code; there doesn't seem to be a module system built in, but the reference doc did mention support for shared libraries. A few questions: 1) On Gnu/Linux, how do you put code into a shared library? 2) Where on the

Re: binding free symbols in a lambda definition

2017-02-08 Thread pd
Hi Alex > The key there is the back-quote (`) before the L to force evaluation > > See the doc section on 'Read-Macros' > > http://software-lab.de/doc/ref.html#macro-io > > Exactly. So the whole 'let' expression is read, *then* evaluated. 'L' is > what it > was globally at the time this

Re: binding free symbols in a lambda definition

2017-02-08 Thread Erik Gustafson
Hi, If I understand correctly what you said the reason for (let K 3 '(print `K)) returning (print NIL) rather than (print 3) [being K not previously defined] is that the sequence of steps is: Almost, there is a slight confusion in step 2. I would revise it like so: 1- read the whole let

Re: Mips / LibreCMC build

2017-02-08 Thread Christopher Howard
I added a wiki page here: http://picolisp.com/wiki/?picolisponmips On 02/08/2017 04:57 AM, Mike Pechkin wrote: > > > On Wed, Feb 8, 2017 at 3:45 PM, Christopher Howard > > > wrote: > > I would like to share the build