Re: What parts of picolisp did you have the most trouble understanding?
Hi Alex, Op di 31 jul. 2018 om 17:34 schreef Alexander Burger : > > But 'cut' is *not* a destructive function. It does not modify the list in > any > way. Only the variable which points to the list is modified. > OK. That isn't totally obvious, but of course you are right as shown per this example: : (setq X '(1 2 3 4 5 6 7 8)) > -> (1 2 3 4 5 6 7 8) > : (setq S X) > -> (1 2 3 4 5 6 7 8) ; Now S points to same memory location as X > : (cut 3 'S) > -> (1 2 3) > : S > -> (4 5 6 7 8) ; Now S points to the 4th element of that same memory > location > : X > -> (1 2 3 4 5 6 7 8) ; X still points to the same memory location Ergo: Alex is totally right :) > In general, all destructive functions are marked as such in the reference. > Good to get some feedback and find out how it *really* works :) Thx very much! Arie
Re: What parts of picolisp did you have the most trouble understanding?
Hi Arie, I agree with everything you wrote, except: > 1. mutability. Operations like 'cut' alter the contents of their > argument(s). So, it is very important to understand that in PicoLisp > 'functions' often are not functions in the mathematical sense, because > there arguments would never be changed by a function. There are destructive and non-destructive functions in PicoLisp, yes. But 'cut' is *not* a destructive function. It does not modify the list in any way. Only the variable which points to the list is modified. In general, all destructive functions are marked as such in the reference. ♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Unsubscribe
Re: What parts of picolisp did you have the most trouble understanding?
On 31.07.2018 07:41, Bruno Franco wrote: three questions: 1) Which clashed with your previous experience as a programmer? The pilog part, I stopped thinking about transferring Prolog LPN examples when it came to Prolog list handling ([head | tail]) or Context Free Grammars /Definite Clause Grammar, 2) What features of picolisp are you using right now? picolisp as tiny local application server as clickable frontend for local shell scripts. 3) is there a part that you don't understand yet, but would like to master? The database index topic. I'm sure it's obvious if one has knowledge of data indexing in general, but I always failed to set up quickly an indexable set of data records. The use of Third Party libraries. It's often mentioned, that (at least 64bit-) picolisp makes it easy to use available libs written in C, but there are few examples I think. Even don't know, which Libs could be of benefit while using picolisp. To make the learning curve a little easier ;) Combining picolisp with a Frontend Framework like bootstrap, AngularJS or similar might attract new users - especially for promoting PilBox on tablet or smartphone. -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe