Re: PicoLisp as first language

2017-07-31 Thread Lindsay John Lawrence
Thanks for writing this. I think it is a great start and will help a lot of other newcomers as well /Lindsay On Mon, Jul 31, 2017 at 7:07 AM, Nehal wrote: > Dear PicoLisp programmers, > > Hi! I am Nehal, a new PicoLisp learner and programmer from India. > > I am

Re: Fixed-point scaling and lookup tables

2017-05-27 Thread Lindsay John Lawrence
Hi Enrique, > I like a lot what you are doing with fixed point scaling and lookup tables. Thank you. PicoLisp has been a great tool for me to explore algorithms and data with the past few months. > The formal name of the algorithm coded in the fastNth primitive is Digital > Tree Searching, a

Re: Fixed-point scaling and lookup tables

2017-05-26 Thread Lindsay John Lawrence
> > For a much faster solution than the idx mechanism, look at this: > http://www.mail-archive.com/picolisp@software-lab.de/msg05199.html > > This is a very interesting idea. Thanks for pointing it out. Is there a formal name for the algorithm? For some more general purpose data structures I am

Re: Fixed-point scaling and lookup tables

2017-05-25 Thread Lindsay John Lawrence
507 sec -> 2249 : (= (* 13 41) (MLup 13 41)) -> T 2017-04-01 22:45 GMT+02:00 Lindsay John Lawrence < >> lawrence.lindsayj...@gmail.com>: >> >>> My next little picolisp project.. >>> >>> Picolisp's built-in functions for scaled arithmetic are brillia

Re: (rank)

2017-05-24 Thread Lindsay John Lawrence
Hi Alex, Ah. That's what I missed the sort direction of the second argument.. Thank you Lindsay On Tue, May 23, 2017 at 10:47 PM, Alexander Burger wrote: > Hi Lindsay, > > > My sample code ("ABRA..) is wrong. Sorry about that. > > Ah, I see. No problem. > > > > :

Re: (rank)

2017-05-23 Thread Lindsay John Lawrence
Thanks Alex, My sample code ("ABRA..) is wrong. Sorry about that. I simplified too much from some other code I have written that has a lot of unrelated stuff in it. However, what about these examples? Similar to those of the documentation: : (rank 'c '((a . a) (b . b) (d . d)) T) # ??? ->

(rank)

2017-05-23 Thread Lindsay John Lawrence
Hi, PicoLisp makes it very easy to build and work with suffix arrays. Yesterday I realized there is a built-in '*rank* function which I thought would neatly replace some custom code I had written to do the same thing. However, passing non-nil in the third-param does not return the expected

Arrays

2017-04-13 Thread Lindsay John Lawrence
The 'lack' of arrays has been a non-issue in picolisp for me so far. I've been generating and manipulating some pretty substantial bitmaps using notation like this. 2-D Array: (setq *Img (make (do Size (link (need Size 0) Write: (let (Bit (rand 0 1)) (for Pt *Plot (set (nth *Img

Fixed-point scaling and lookup tables

2017-04-01 Thread Lindsay John Lawrence
My next little picolisp project... Picolisp's built-in functions for scaled arithmetic are brilliant once you understand how they work. Still, it would be great to get more scientific functions without have to link an external math lib, and get 'real-time' performance when needed as well.

Re: How to pass arguments to a script from the terminal?

2017-03-21 Thread Lindsay John Lawrence
http://software-lab.de/doc/refA.html#argv /Lindsay On Tue, Mar 21, 2017 at 10:01 AM, Bruno Franco wrote: > I want to write a simple script that would accept names from the command > line and print then, like this: > > $ ./script alice bob > Hello alice and bob >

Naming conventions...

2017-03-11 Thread Lindsay John Lawrence
'F'->'f' =) Trying to get in the habit to be disciplined with this. It certainly helps as I write larger and more complex bits of code. /Lindsay (de fibonacci (N) (let (F (list 2 1 1)) (cond ((= N 0) 0) ((= N 1) (caddr F)) ((= N 2) (cadr F)) (T

Re: Unexpected behavior

2017-03-11 Thread Lindsay John Lawrence
))) ) (car F) ) ) ) ) /Lindsay On Sat, Mar 11, 2017 at 11:35 AM, Alexander Burger <a...@software-lab.de> wrote: > On Sat, Mar 11, 2017 at 11:20:21AM -0800, Lindsay John Lawrence wrote: > > Nm... After tinkering in the debugger.. using 'pp etc.. > > I get it. I am still gett

Re: Unexpected behavior

2017-03-11 Thread Lindsay John Lawrence
Fib) (caddr Fib))) ) (car Fib)) ) ) ) /Lindsay On Sat, Mar 11, 2017 at 11:20 AM, Lindsay John Lawrence < lawrence.lindsayj...@gmail.com> wrote: > Nm... After tinkering in the debugger.. using 'pp etc.. > I get it. I am still getting the (= code data)

Re: Unexpected behavior

2017-03-11 Thread Lindsay John Lawrence
11, 2017 at 10:49 AM, Lindsay John Lawrence < lawrence.lindsayj...@gmail.com> wrote: > Hi > > I am having difficulty understanding the following.. > > This works as expected... > > : (setq Sum '(1 1 0)) > -> (1 1 0) > : (set Sum (+ (cadr Sum) (caddr Sum))) &

Unexpected behavior

2017-03-11 Thread Lindsay John Lawrence
Hi I am having difficulty understanding the following.. This works as expected... : (setq Sum '(1 1 0)) -> (1 1 0) : (set Sum (+ (cadr Sum) (caddr Sum))) -> 1 : (rot Sum) -> (0 1 1) : (set Sum (+ (cadr Sum) (caddr Sum))) -> 2 : (rot Sum) -> (1 2 1) : (set Sum (+ (cadr Sum) (caddr Sum))) -> 3 :

Re: TC -> Loop Transformation?

2017-03-10 Thread Lindsay John Lawrence
Hi Christopher, Congratulations on the new baby. You'll have lots of late nights to code now...or maybe not. This may give some added insight into what you are trying to accomplish... https://rosettacode.org/wiki/Jump_anywhere#PicoLisp The code example there was worth some time to study for me,

Re: Arithmetic Coding

2017-03-09 Thread Lindsay John Lawrence
Hi Alex, Thank you. The (profile) tool is exactly what was needed here In the scaling loops, it made more of a difference than I thought to copy object properties into local variables. However, the idx tree change you pointed out is what helped most. : (prog (setq Msg (make (do (** 2 16)

Arithmetic Coding

2017-03-08 Thread Lindsay John Lawrence
As part of getting a handle on OO in picolisp I implemented a basic arithmetic coder. This is just the Coder and a simple adaptive model. https://github.com/thinknlive/picolisp-acdc It is slower than I expected it to be, but I was focused more on getting the implementation correct in this pass.

Gosper-curve from 'co routine

2017-03-05 Thread Lindsay John Lawrence
Using Picolisp 'co routine to... Generate Gosper-curve states from L-System rules : (GosperGen T) # Reset -> T : (do 64 (prin (GosperGen))) A-B--B+A++AA+B--+A-BB--B-A++A+B--+A-BB--B-A++A+B+A-B--B+A++AA+B--> "-" : (GosperGen) -> "+" : (GosperGen) -> "+" : (GosperGen) -> "A" .. A depth of 12

Re: L-system rules with PicoLisp

2017-03-04 Thread Lindsay John Lawrence
Thanks Alex, I appreciate the suggestions. As ever, I learn something from them ;) /Lindsay On Fri, Mar 3, 2017 at 10:10 PM, Alexander Burger wrote: > Hi Lindsay, > > > The code below is the recursive Gosper implementation I came up with that > > uses very little stack.

Re: L-system rules with PicoLisp

2017-03-03 Thread Lindsay John Lawrence
Thanks Alex, Your explanation was the motivation I needed to attempt the recursive version... /Lindsay > Yes and no. It is correct that the garbage collector does not run at each > release. Instead, it runs when a new cell is needed and the current heap is > found to be full. > > So garbage

Re: L-system rules with PicoLisp

2017-03-03 Thread Lindsay John Lawrence
Hi Alex, Joh-Tob, A 'co may be exactly what I am looking for in this case. Thanks! Generating all the states at once was nice in one sense as I could immediately scale the view when rendering the results. Picolisp easily supported lists of ~2M elements on the 4GB, single-core virtual box I am

Re: Self-similar fractal curves on canvas

2017-03-02 Thread Lindsay John Lawrence
Thanks for the reminder. I'll add it in. MIT Lic. No restriction. As-is, no warranty, no liability. Enjoy. /Lindsay Gratitude makes any experience more enjoyable. It doesn't make the journey any less new, the effort any less real. On Thu, Mar 2, 2017 at 9:13 AM, Christopher Howard <

Self-similar fractal curves on canvas

2017-03-02 Thread Lindsay John Lawrence
I developed this a bit more. https://github.com/thinknlive/picolisp-gosper I think now it may be a nice little tool to explore these kinds of functions. You can step draw the results, or draw all at once. You can also modify the lisp function code and then reload the module to try the changes

Re: Scaled division and sqrt

2017-03-01 Thread Lindsay John Lawrence
Thanks Eric. This was also an opportunity to start dabbling a bit with the app ui framework. Very interesting. At least initially, it reminds me a bit of the way you could write PHP... but this feels more elegant. Even lisp looks less like line noise than php ;) The javascript canvas pipeline I

Re: Scaled division and sqrt

2017-02-28 Thread Lindsay John Lawrence
allbase --> tankfeeder / exercism-io / a-f.l /Lindsay On Tue, Feb 28, 2017 at 3:41 AM, Danilo Kordic wrote: >> If you are going to use a list, could also just put the 'scale' in a property >> of the list? > > I wouldn't call it a propert to avoid confusion with

Re: Scaled division and sqrt

2017-02-28 Thread Lindsay John Lawrence
Hi, I practiced a bit more with the built-in functions... https://github.com/thinknlive/picolisp-gosper.git /Lindsay -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: Scaled division and sqrt

2017-02-27 Thread Lindsay John Lawrence
Hi Danilo, Ah. I get it. Interesting idea. If you are going to use a list, could also just put the 'scale' in a property of the list? When I came across the 'allbase function in Mike Penchkin's code... I thought of the following... It would be a bit wasteful of storage, but could represent

Re: Scaled division and sqrt

2017-02-27 Thread Lindsay John Lawrence
Hi Alex, Erik, I definitely took the 'long way around' on this one... and got some good exercise along the way! =) Thank you for the detailed explanation. I get it now... although I need a bit more practice and care in using the functions comfortably. My initial impetus was to be able to

Re: Scaled division and sqrt

2017-02-27 Thread Lindsay John Lawrence
Thanks Eric, I am going to have to play with those two particular built-in functions a bit more. Their use, especially '*/ was not intuitive to me. At first, or second, reading. Having just tried it... I am surprised that the 'sqrt* I implemented is quite a bit faster! than the built-in 'sqrt.

Re: Scaled division and sqrt

2017-02-27 Thread Lindsay John Lawrence
Hi Danilo, Sorry, I do not follow this. Can you explain a bit more? Thanks! /Lindsay On Mon, Feb 27, 2017 at 3:32 AM, Danilo Kordic wrote: > It seems You reimplemented `*/'. > > How about something like: > # [name 'sqrt "isqrt"] # Somthing like that. > [scl [if

Re: Scaled division and sqrt

2017-02-27 Thread Lindsay John Lawrence
Hi Alex, I am missing something basic here that article is how I ended up writing the functions. With the functions I implemented I can write something like... : (scl 64) (format (sqrt* 2.0) *Scl) -> "1.4142135623730950488016887242096980785696718753769480731766797379" : (scl 64) (format

Scaled division and sqrt

2017-02-27 Thread Lindsay John Lawrence
Hi, Are there scaled (fixed point) versions of division and sqrt in picolisp? I may have missed them... In any event I wrote a couple of functions to provide that functionality that may be useful to others as well. Performance is reasonable. It is quite nice to be able to be able to do

Re: Copy/Clone a 'job

2017-02-26 Thread Lindsay John Lawrence
Thanks for the suggestion Joe. Other than copy-paste examples, I haven't played much with either #oop and #dbase in picolisp. It is definitely on my list ;) I've been trying to get a good understanding of variable scope, state and lifetime. Especially with functions that have the side-effect of

Re: Copy/Clone a 'job

2017-02-26 Thread Lindsay John Lawrence
Thanks Alex, I'll have to play with your solution a bit. I don't quite follow how the global is working there in conjunction with 'job and 'off. However, after banging around on this for a couple of hours, trying 'copy', various auxillary functions to return the quoted 'job, etc I was at my wits

Copy/Clone a 'job

2017-02-26 Thread Lindsay John Lawrence
Hi, How would I copy|clone, reinitialize or dispose of a 'job' function? For example, given (de hexSpigot NIL (job '((N)) (ifn N (setq N '(0))) (prog1 (hex (% (car N) 16)) (setq N (cons (+ 1 (car N)) N)) ) ) ) I can then do.. : (do 32 (prin (hexSpigot)))

Re: exercism.io

2017-02-25 Thread Lindsay John Lawrence
There is some very nice code in here. For me, the 'allbase' function is a particularly nice gem. /Lindsay On Fri, Feb 24, 2017 at 8:44 PM, Mike Pechkin wrote: > hi all, > > I've implemented tasks from A to F: > https://bitbucket.org/mihailp/tankfeeder/src/ >

Re: later and output

2017-02-25 Thread Lindsay John Lawrence
My earlier function 'primeFactorz' had a bug! returning the wrong results for actual prime numbers :( : (primeFactorz 17) -> (3 5) # WRONG! I have to be more careful with integer arithmetic. The corrected function is: (de primeFactorz (N) (use Result (recur (N) (let (Root

Re: BBWT

2017-02-25 Thread Lindsay John Lawrence
Thanks Alex, The feedback is appreciated. This is a good clarification of how namespaces work in the 64bit version. Also, somehow, it had not 'clicked' with me that transient symbols could be used in this regard. Re-read that section of the documentation again... =) "With that mechanism,

Re: P35 Prime Factors

2017-02-25 Thread Lindsay John Lawrence
. where we alternately add 2 and >> 4 after >>the first three terms. >>... >>A further savings of 20 percent ... removing the numbers 30m +/- 5 .. >> >> I believe the term (let (D 2 L (1 2 2 . (4 2 4 2 4 6 2 6 .)) generates >> that >> sequence. >&

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))

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

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

Re: Future of PicoLisp?

2017-02-20 Thread Lindsay John Lawrence
Picolisp has a release archive readily downloadable here... http://software-lab.de/down.html. In my limited experience with picolisp, it actually reminds me of sqlite ( http://sqlite.org) in its approach... "Small, Fast, Reliable. Chose any three" Sqlite seems to have a particularly effective

Lots of pun

2017-02-19 Thread Lindsay John Lawrence
My first non-trivial bits of picolisp... https://github.com/thinknlive/picolisp-maze /Lindsay

Re: clip and chop down consecutive "internal" white spaces to one

2017-02-18 Thread Lindsay John Lawrence
Thanks Alex, In the context of : (glue " " (filter prog (split (chop " s pac e s") " "))) -> "s pac e s" where : (split (chop " s pac e s") " ") -> (NIL NIL ("s") NIL ("p" "a" "c") ("e") ("s")) it is not immediately obvious to me that the arguments passed to the (filter prog ..) are

Re: clip and chop down consecutive "internal" white spaces to one

2017-02-18 Thread Lindsay John Lawrence
Thanks Alex. I was sure there was something like 'bool' to replace '((E) E)... I just could not find it at the time. =) I am surprised that 'prog works. Why, in this context, does it treat it's argument as 'data'? Given (NIL NIL NIL ("s" "p" "a" "a" "a" "c" "e" "s" ",") : (prog NIL) ->

Re: clip and chop down consecutive "internal" white spaces to one space??

2017-02-17 Thread Lindsay John Lawrence
(de trimmr (S C) (default C " ") (glue C (filter '((E) E) (split (chop S) C : (setq Str " spaaaces, spaaaces everywhere spaaaces spaaaces r so squuare ") -> " spaaaces, spaaaces everywhere spaaaces spaaaces r so squuare " : (trimmr (trimmr Str) "a") -> "spaces, spaces

Re: trouble reading non blocking space etc

2017-02-14 Thread Lindsay John Lawrence
If you are just working with bytes, maybe you do not need to 'print' or 'symbolize'... : (in "test.txt" (while (rd 1) (wr @))) hi�theRE:�how are you -> 10 ..or filtering for graphic ascii and everything else to space... : (setq E '(let (C NIL) (in "test.txt" (while (rd 1) (setq C @) (if

Re: trouble reading non blocking space etc

2017-02-14 Thread Lindsay John Lawrence
Not sure about file charset encoding (a0?)... But perhaps something like this...? $ xxd test.txt 000: 6869 a074 6865 6972 3aa0 686f 7720 6172 hi.their:.how ar 010: 6520 796f 750a e you. : (pack (make (in "test.txt" (while (rd 1) (link (char @

Re: Recursion-Loop Macro?

2017-02-13 Thread Lindsay John Lawrence
There is lots of discussion on the mail archive on this topic over the years. http://www.mail-archive.com/picolisp@software-lab.de/msg03860.html There are others. Try searching tail recursion, macros, fexpr. The mail archive has been an excellent source of information on picolisp. I haven't

Re: Segfault with huge list...?

2017-02-10 Thread Lindsay John Lawrence
I think I'll start keeping a list =) of picolisp's pleasant surprises. /Lindsay On Fri, Feb 10, 2017 at 11:06 AM, Joh-Tob Schäg wrote: > Linsday when you want to prevent values from neing printed take a look at > the 'nil function. > >

Re: conc: unexpected results

2017-02-10 Thread Lindsay John Lawrence
Hi Danilo, Your example helped. I can reason with (conc equences) now =) /Lindsay > AFAIK there is only one empty `list' in PL, and that is `NIL'. So > after `conc'atenating to it's end it would no longer be empty. > > [de ex2 [] > [let [R [list]] > [do 10 > [conc R [list 'A]] ] >

Re: conc: unexpected results

2017-02-10 Thread Lindsay John Lawrence
Thank you Alex. Your explanation of atomic arguments is particularly enlightening. /Lindsay > So as a result atomic arguments are simply lost. This happens also if the > atom > is the first argument > >: (conc 'a (1 2)) >-> (1 2) > >

Re: Segfault with huge list...?

2017-02-10 Thread Lindsay John Lawrence
If it even matters, the overhead of recurse is slowest here. So impressive that picolisp can iterate/recurse over a 10M element list in these times. (VirtualBox VM, 4GB, 1Core, with 64bit Debian). .. and 'make' is a lot more useful that I first realized. /Lindsay # Iterative (de sumi (L)

Re: conc: unexpected results

2017-02-09 Thread Lindsay John Lawrence
e use of NCONC, RPLACA, RPLACD, and DELETE to risk-loving programmers. Unless desperate for time or space saving, using them just leads to unnecessary bugs. "--Lisp (Winston, Horn) P. 117 /Lindsay On Thu, Feb 9, 2017 at 5:21 PM, Lindsay John Lawrence < lawrence.lindsayj...@gmail.com> wrote:

Re: conc: unexpected results

2017-02-09 Thread Lindsay John Lawrence
I tried conc to an empty list on both 32 and 64 bit versions of picolisp I even installed SBCL just to try the similar 'nconc' on that platform. The results are consistent for all of them. I just don't understand why Is it simply 'standard', historical reasons? because of the way evaluation

conc: unexpected results

2017-02-09 Thread Lindsay John Lawrence
conc does not rewrite N if N is an empty list. # 1. : (let (N '()) (conc N '(A))) -> (A) # 2 : (let (N '()) (conc N '(A)) N) -> NIL # 3. : (let (N '(NIL)) (conc N '(A)) N) -> (NIL A) # 4. : (let (N '()) (setq N (conc N '(A))) N) -> (A) In #2 above, I was expecting N to be (A) If N is not empty,

Re: binding free symbols in a lambda definition

2017-02-09 Thread Lindsay John Lawrence
Hi Alex, > However, a function call is about the most expensive thing in PicoLisp. It > interprets the parameter list (X), saves the old value of X, evaluates (not X) > and restores the value of X. (de null..) was really unnecessary here :) I just wrote it for completeness as part of the book

Re: binding free symbols in a lambda definition

2017-02-09 Thread Lindsay John Lawrence
Hi Alex, I missed to include it... (de null (X) (not X)) Thanks! for the suggestions. I tried the pairlis alternatives. Much better. 'extract' will be very useful. I'll have to work with nond a bit more to get how/when use that. /Lindsay On Thu, Feb 9, 2017 at 3:17 AM, Alexander Burger

Re: binding free symbols in a lambda definition

2017-02-09 Thread Lindsay John Lawrence
Picolisp continues to astonish me with its 'Principle of Least Astonishment'... using @ variable arguments is much nicer. /Lindsay # using pairlis2 and sublis from prior email... (de curri2 @ (let (Fun (next) Args (rest) Par (pairlis2 (car Fun) Args) dropP

Re: binding free symbols in a lambda definition

2017-02-09 Thread Lindsay John Lawrence
I've enjoyed the discussion. Curry is a common idiom in the javascript world (my current day job) so it was very interesting to explore it here. Being relatively new to picolisp I have a lot to learn about built-in functionality so exploring these ideas, with feedback from Alex and others more

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: 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: binding free symbols in a lambda definition

2017-02-07 Thread Lindsay John Lawrence
'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 : (adder 1) -> ((x) (+ x 1)) : (adder 2) -> ((x) (+ x 2)) : ((adder 1) 99) -> 100 /Lindsay

Re: binding free symbols in a lambda definition

2017-02-07 Thread Lindsay John Lawrence
You can also do this... : (de adder (N) (list '(x) (list '+ 'x (eval 'N -> adder : (adder 1) -> ((x) (+ x 1)) : (adder 2) -> ((x) (+ x 2)) : ((adder 99) 1) -> 100 Small examples like this one are great learning devices :) As Erik pointed out though, 'curry' is probably more general purpose

Re: binding free symbols in a lambda definition

2017-02-07 Thread Lindsay John Lawrence
This works: :(de myf (F L) (F L)) -> myf : (let (L 99) (myf '((x) (+ (car x) `L)) (1 2))) -> 100 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 /Lindsay On Tue, Feb 7, 2017 at 7:55 PM, pd

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

2017-02-07 Thread Lindsay John Lawrence
I just noticed... my original source for the selectN function is this... (de selectN (Lst P) .. ((= '() Lst) '() ) .. However when I (pp 'selectN) it wrote the line where I am trying to test for an empty list as (de selectN (Lst P) .. ((= 'NIL Lst) 'NIL) .. Is that correct? Shouldn't

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

2017-02-07 Thread Lindsay John Lawrence
Thanks! I still trip over those nuances if I don't pay attention testing for NIL or '(), or not, in lists and symbols. /Lindsay On Mon, Feb 6, 2017 at 11:13 PM, Alexander Burger wrote: > On Tue, Feb 07, 2017 at 07:41:45AM +0100, Alexander Burger wrote: > >

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

2017-02-07 Thread Lindsay John Lawrence
Thanks Alex! recur/recurse... I hadn't noticed those functions in the picolisp function library until now. Very useful. /Lindsay On Mon, Feb 6, 2017 at 10:41 PM, Alexander Burger wrote: > Hi Lindsay, > > > I couldn't resist tinkering with this a bit more. > > Many

Re: (= code data)

2017-02-06 Thread Lindsay John Lawrence
Very interesting! It will take me a while to digest all of that though =) /Lindsay Side note: I had to look up the square bracket use. I did not realize you could do that in picolisp. The semantics are different but it reminded me of the code in the "Lisp 1.5 Programmer's Manual" (

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

2017-02-06 Thread Lindsay John Lawrence
2 3 4 5 6 7 8 9 10) : (selectN '(a 0 b 1 c 2 d 3 e 4 f 5 g 6 h 7 i 8 j 9 k 10) '((V I) (sym? V))) -> (a b c d e f g h i j k) : (selectN '(a 0 b 1 c 2 d 3 e 4 f 5 g 6 h 7 i 8 j 9 k 10) '((V I) (num? V))) -> (0 1 2 3 4 5 6 7 8 9 10) /Lindsay On Mon, Feb 6, 2017 at 5:04 PM, Lindsay J

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

2017-02-06 Thread Lindsay John Lawrence
:) /Lindsay On Mon, Feb 6, 2017 at 4:18 PM, Lindsay John Lawrence < lawrence.lindsayj...@gmail.com> wrote: > All of those problems are fun to explore... try writing different versions > of the selected solutions, iterative vs recursive, using just basic list > building block f

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

2017-02-06 Thread Lindsay John Lawrence
gosh...I missed that completely...Thanks Lindsay..That explains > everything! > I'm really pleased you told me that because drop looks like a really > useful function. > Best Regards > Dean > > On 6 February 2017 at 22:27, Lindsay John Lawrence < > lawrence.lindsayj...@gmail

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

2017-02-06 Thread Lindsay John Lawrence
P16 (**) Drop every N’th element from a list. (de drop (Lst N) (make (for (I . X) Lst (unless (=0 (% I N)) (link X) ) ) ) ) : (drop ’(a b c d e f g h i k) 3) -> (a b d e g h k) 'drop' is the function given as a solution to the problem. /Lindsay On Mon, Feb 6, 2017 at 1:24

Re: Future of PicoLisp?

2017-02-04 Thread Lindsay John Lawrence
I also run PicoLisp out of a TinyCore Linux 'VirtualBox' image... This turned out to be the best route for me to get the performance and features of picolisp I wanted on microsoft windows hosts. TinyCore64 + vboxsf (to access host drives) + picolisp is a great combo in < 50Mb Exporting that as an

Re: Future of PicoLisp?

2017-02-03 Thread Lindsay John Lawrence
I hope it is not dark. I am just starting on my adventure using PicoLisp and having a wonderful time of it. Having said that, I have never used any of the distribution packages. Picolisp is simple to compile with minimal dependencies. Thank you for that as well Alex. On my laptop machine I have

Re: Matching and Hashes

2017-01-25 Thread Lindsay John Lawrence
> I could do this in perl, but I wouldn't be building character ;-) .. 20+yrs ago, I used to say that when using perl instead of some other language :) /Lindsay On Wed, Jan 25, 2017 at 8:47 AM, Alexander Burger wrote: > Hi Joe, > > > The T appears to act as a function in

Re: I/O buffering.

2017-01-18 Thread Lindsay John Lawrence
Hi Alex, Thank you. That is a nice example. The ability to explicitly flush buffered data on the output channel was what I was looking for. Of course, there is a existing function to do just that... that I should of thought to look for... (flush) I am still trying to get a handle on using io

I/O buffering.

2017-01-17 Thread Lindsay John Lawrence
Is is possible to turn off I/O buffering in a PicoLisp program? e.g In Perl one can do something like this... #!/usr/bin/perl $| = 1; # Turn off I/O buffering while () { s/-/_/g; # Replace dashes with underscores print $_; } I'd like to do something similar with a PicoLisp program. Best

(= code data)

2016-12-27 Thread Lindsay John Lawrence
I've been working my way through the Rosetta code examples as a way to build fluency in picolisp. This little gem was an epiphany in my understanding of the equivalence of code and data in lisp. https://rosettacode.org/wiki/Jump_anywhere#PicoLisp (de foo (N) (prinl "This is 'foo'")

Subscribe

2016-08-27 Thread Lindsay John Lawrence