Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - hartrock

#136
Hello All,

hello Lutz,



The following shows something, which looks like a bug.



Code:

(new Tree 'Data)
(push '(1 (k_1 "v_1")) Data)
(push '(k_2 "v_2") (assoc 1 Data) -1)
;; -> OK
;;
(pop-assoc '(1 k_2) Data)
Data:Data
;; -> OK
;;
;;
(push '(k_2 "v_2") (assoc 1 Data) -1)
;; -> fails!
;;
;; repair
(push (pop (assoc 1 Data) -1) (assoc 1 Data) -1)
;;
(push '(k_2 "v_2") (assoc 1 Data) -1)
;; -> works again.

Session:

newLISP v.10.5.3 64-bit on Linux IPv4/6 UTF-8, options: newlisp -h

> (new Tree 'Data)
Data
> (push '(1 (k_1 "v_1")) Data)
((1 (k_1 "v_1")))
> (push '(k_2 "v_2") (assoc 1 Data) -1)
(1 (k_1 "v_1") (k_2 "v_2"))
> ;; -> OK
> ;;
> (pop-assoc '(1 k_2) Data)
(k_2 "v_2")
> Data:Data
((1 (k_1 "v_1")))
> ;; -> OK
> ;;
> ;;
> (push '(k_2 "v_2") (assoc 1 Data) -1)
(1 (k_1 "v_1"))
> ;; -> fails!
> ;;
> ;; repair
> (push (pop (assoc 1 Data) -1) (assoc 1 Data) -1)
(1 (k_1 "v_1"))
> ;;
> (push '(k_2 "v_2") (assoc 1 Data) -1)
(1 (k_1 "v_1") (k_2 "v_2"))
> ;; -> works again.

It would be nice, if someone could check this at his/her own host, for checking platform differences (I had to compile with a configure-alt step in advance, to get all tests running).



Best regards,

Stephan