Hi Johann, you are right! In my reply to Alex I explicitly tell about that :)
Thx, Arie 2018-06-10 17:31 GMT+02:00 Johann-Tobias Schäg <johtob...@gmail.com>: > You are right. But that does not change the fact that your code will > misbehave if you do not define a name. > 2. You did not mentioned mention how it does misbehavior so i assumed. > > *Von:* xapw...@gmail.com > *Gesendet:* 10. Juni 2018 5:25 nachm. > *An:* picolisp@software-lab.de > *Antworten:* picolisp@software-lab.de > *Betreff:* Re: Stuck at PLEAC example > > Hi Johann, > > I think that is not correct. > > In the first place I think I don't need a name property. Only the > 'category! > > In the second place: (get 'name emp1) will ALWAYS return NIL, because the > function call is incorrect. > It should be: (get emp1 'name) > > In my examples this works ok: > : (put emp1 'category 'engineer) > -> engineer > : (get emp1 'category) > -> engineer > > Also this works: > : (with emp1 > (prinl (: category))) > engineer > -> engineer > > Best, > Arie > > 2018-06-10 16:14 GMT+02:00 Johann-Tobias Schäg <johtob...@gmail.com>: > >> >> >> The first problem is that all your employees have no 'name property. ( >> get 'name emp1) -> NIL >> But emp1 -> "Abel" >> >> But there is something else rotten. I can not spot. But try to get (with >> 'emp1 (prinl (: name))) running first >> >> Regarding your 'This question: >> https://software-lab.de/doc/refT.html#This >> >> >> *Von:* xapw...@gmail.com >> *Gesendet:* 10. Juni 2018 2:20 nachm. >> *An:* picolisp@software-lab.de >> *Antworten:* picolisp@software-lab.de >> *Betreff:* Stuck at PLEAC example >> >> Hi Alex, >> >> I am now working on the "Arrays" section at "Find First Element that >> passes a Test". >> >> Your example: >> (with >> (find >> '((This) (== 'engineer (: category))) >> Employees ) >> (prinl "Highest paid engineer is: " (: name)) ) >> >> This won't work of course, so I created a few things: >> : (setq emp1 "Abel" emp2 "Jones" emp3 "Millner" emp4 "Noles" emp5 >> "Zaphod") >> -> "Zaphod" >> >> : (put emp1 'category 'engineer) >> -> engineer >> >> : (put emp2 'category 'cook) >> -> cook >> >> : (put emp3 'category 'teacher) >> -> teacher >> >> : (put emp4 'category 'engineer) >> -> engineer >> >> : (put emp5 'category 'vicar) >> -> vicar >> >> : (setq Employees '(emp1 emp2 emp3 emp4 emp5)) >> -> (emp1 emp2 emp3 emp4 emp5) >> >> I guessed that this list Employees would be OK to feed 'find'; >> however, from the ref docs of 'with' I do not grasp how I should get this >> to work. >> >> Also, the function used by 'find' has a formal parameter named This. Is >> this the PicoLisp special variable, or just a name for a formal parameter? >> >> Please give a complete example! >> >> What I experience now is exactly why I think that there should be more >> and better approachable docs. >> >> I think the reference should either be expanded by more comprehensive >> examples + explanations, or otherwise I'll try and do that later in the >> Wiki where I started the new section (with now only the 'de' example). >> >> I feel you, because it is all "in your head", but B2B a.k.a. >> brain-2-brain is not yet possible, regrettably :) >> >> Seeing all this stuff i am convinced that PicoLisp also could have been >> named YottaLisp, because of the sheer amount of possibilities hidden below >> the surface :) >> >> Best, >> Arie >> > >