Re: Stuck at PLEAC example

2018-06-10 Thread Arie van Wingerden
So I guess that the possibility of using This as a formal parameter is a goodie associated with dynamic scoping, which I am not (yet) really used to .. It opens a few doors. Nice! Op zo 10 jun. 2018 18:20 schreef Arie van Wingerden : > ​Hi Alex, > ​ > ​ > > I would do it this way: > > > >(se

Re: Stuck at PLEAC example

2018-06-10 Thread Arie van Wingerden
??? I can do: : (get (car Employees) 'category) -> engineer : (show (car Employees)) emp1 NIL category engineer name "Abel" -> emp1 which just works fine for me! 2018-06-10 17:43 GMT+02:00 Johann-Tobias Schäg : > > : (put emp1 'category 'engineer) > -> engineer > : (setq Employees '(emp

Re: Stuck at PLEAC example

2018-06-10 Thread Arie van Wingerden
Pls see previous reply. I don't see the need for eval here ... 2018-06-10 18:05 GMT+02:00 Johann-Tobias Schäg : > The solution to the puzzle: > (get (eval (car Employees)) 'category) > -> engineer > > Your list contain named symbols called emp1, ... , emp5 > You associate the properties with emp1

Re: Stuck at PLEAC example

2018-06-10 Thread Arie van Wingerden
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 : > 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 d

Re: Stuck at PLEAC example

2018-06-10 Thread Arie van Wingerden
Hi again, well, the master himself created the original example, so ... Also, I assume that this comparisopn might be a little bit faster, because more specific? Thx, Arie 2018-06-10 17:33 GMT+02:00 Johann-Tobias Schäg : > Also while pointer equality '== might be fine in this case '= makes m

Re: Stuck at PLEAC example

2018-06-10 Thread Arie van Wingerden
​Hi Alex, ​ ​ > I would do it this way: > >(setq Employees '(emp1 emp2 emp3 emp4 emp5)) OK. You don't use the values as names, but the properties, because you'd like to refer to (: name) in the 'prinl'. Got it. >(mapc put > Employees > '(name .) > '("Abel" "Jones" "Milln

Re: Stuck at PLEAC example

2018-06-10 Thread Johann-Tobias Schäg
The solution to the puzzle:(get (eval (car Employees)) 'category)-> engineerYour list contain named symbols called emp1, ... , emp5You associate the properties with emp1 in the global binding.But find looks for a symbol which contains the attribute 'category. But none of the symbols in the list d

Re: Stuck at PLEAC example

2018-06-10 Thread Johann-Tobias Schäg
: (put emp1 'category 'engineer)-> engineer: (setq Employees '(emp1 emp2 emp3 emp4 emp5))-> (emp1 emp2 emp3 emp4 emp5): (get emp1 'category)-> engineer: (car Empl

Re: Stuck at PLEAC example

2018-06-10 Thread Johann-Tobias Schäg
Also while pointer equality '== might be fine in this case '= makes more sense to me

Re: Stuck at PLEAC example

2018-06-10 Thread Johann-Tobias Schäg
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.

Re: Stuck at PLEAC example

2018-06-10 Thread Arie van Wingerden
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 'ca

Re: Stuck at PLEAC example

2018-06-10 Thread Alexander Burger
On Sun, Jun 10, 2018 at 02:13:10PM +0200, Arie van Wingerden wrote: > Please give a complete example! I would do it this way: (setq Employees '(emp1 emp2 emp3 emp4 emp5)) (mapc put Employees '(name .) '("Abel" "Jones" "Millner" "Noles" "Zaphod") ) (mapc put Empl

Re: Stuck at PLEAC example

2018-06-10 Thread Johann-Tobias Schäg
The first problem is that all your employees have no 'name property. ( get 'name emp1) -> NILBut emp1 -> "Abel"But there is something else rotten. I can not spot. But try to get (with 'emp1 (prinl (: name))) running firstRegarding your 'This question:  https://software-lab.de/doc/refT.html#This

Stuck at PLEAC example

2018-06-10 Thread Arie van Wingerden
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 fe

Re: Wiki progress

2018-06-10 Thread Arie van Wingerden
Hi, I'll have a look first and will let know! Thx, Arie 2018-06-10 7:15 GMT+02:00 Alexander Burger : > On Sun, Jun 10, 2018 at 07:04:44AM +0200, Alexander Burger wrote: > > In the DB GUI of the wiki (you get there after logging in, and going to > "My > > account"), there is a menu entry "Upl