[plt-scheme] help: Proplist

From: Jeanette A Auer (auerja at cs.latrobe.edu.au)
Date: Sat Oct 5 21:40:33 EDT 2002

Included the compat.ss library, so I can use get and put prop, but I can't 
get a list of properties associated with a symbol.

Unfortunately it makes this weeks lab class rather undoable.

Used to use this code fragment:

(define (all-properties-of node)
  (let ((plist (proplist node)))
    (collect-odd-members plist)))

to support the following function

(define (other-nodes relation)
  (cond ((not (equal? '() (proplist (cadr relation))))
	 (append (cadr (member (car relation) 
   (proplist (cadr relation))))
		 	   (cddr relation)))
	(else (cddr relation))))

For extracting a list of properties from symbols added using;

(define (store relation)
  (let (
	(node* (node relation))  ;; need to write the node function
	(link* (link relation))  ;; need to write the link function
	(other-nodes* (other-nodes relation))) ;; need to write the 
   ;; other-node function
    ;the following line is the right way in TI-PCS
    (putprop node* other-nodes* link*)
    ;(putprop node* link* other-nodes*)	;this is the newer standard 
;way
    (display "Relation stored in the semantic network")))


Thanks for any help in advance.

Jeanette


On Sat, 5 Oct 2002, Jens Axel Søgaard wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> Jeanette A Auer wrote:
> >   For list-related administrative tasks:
> >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> >
> > Help please from anyone who can.  I am doing some work with semantic
> > and need proplist; given I have been happily using getprop, putprop
> > etc until now I'm kind of stuck as to what happened.  Have just
> > upgraded to version 2.  Might this be the problem.
> 
> Have you included the compat-module?
> 
>     (require (lib "compat.ss" "mzlib"))
> 
> --
> Jens Axel Søgaard
> 
> 



Posted on the users mailing list.