(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP")
(FILECREATED "11-Feb-88 11:42:02" {QV}<NOTECARDS>1.3LNEXT>PMIPATCH088.;2 4112   

      changes to%:  (VARS PMIPATCH088COMS)

      previous date%: "11-Feb-88 11:39:32" {QV}<NOTECARDS>1.3LNEXT>PMIPATCH088.;1)


(* "
Copyright (c) 1988 by Xerox Corporation.  All rights reserved.
")

(PRETTYCOMPRINT PMIPATCH088COMS)

(RPAQQ PMIPATCH088COMS (
          
          (* ;; 
    " pmi 2/11/88: NCP.CollectCards no longer occasionally passes NIL for Cards to NCP.CardNeighbors")

                        (DECLARE%: DONTCOPY (PROPS (PMIPATCH088 MAKEFILE-ENVIRONMENT)
                                                   (PMIPATCH088 FILETYPE)))
                        
          
          (* ;; "Changed in NCPROGINT")

                        (FNS NCP.CollectCards)))



(* ;; 
" pmi 2/11/88: NCP.CollectCards no longer occasionally passes NIL for Cards to NCP.CardNeighbors")

(DECLARE%: DONTCOPY 

(PUTPROPS PMIPATCH088 MAKEFILE-ENVIRONMENT (:PACKAGE "INTERLISP" :READTABLE "INTERLISP"))

(PUTPROPS PMIPATCH088 FILETYPE :BCOMPL)
)



(* ;; "Changed in NCPROGINT")

(DEFINEQ

(NCP.CollectCards
  [LAMBDA (RootCards LinkTypes MaxDepth FollowCrossFileLinksFlg)
                                                             (* ; "Edited 11-Feb-88 11:31 by pmi")
          
          (* ;; "Starting from RootCards and following link of types in LinkTypes to a max depth of MaxDepth, collect and return all cards encountered.  LinkTypes can contain backward links.")
          
          (* ;; "rht 8/29/86: Now handles case of NULL MaxDepth.  Also handles case when RootCards is single card instead of list.")
          
          (* ;; "rht 6/6/87: Added FollowCrossFileLinksFlg;  if non-nil, then try to follow cross-file links into remote notefiles, else ignore them.")
          
          (* ;; "pmi 12/4/87: Now returns list of cards collected with NO duplicates.")
          
          (* ;; 
       "rar 2/10/88: Added check for NIL RealFringe when searching for neighbors down the structure.")
          
          (* ;; "pmi 2/11/87: Added change in previous comment (courtesy of IDE folks).")

    (OR MaxDepth (SETQ MaxDepth 65535))
    (if (LEQ MaxDepth 0)
        then RootCards
      else (LET (RealFringe Collection)
                (RESETLST [RESETSAVE NIL '(PROGN (for Card in Collection
                                                    do (NC.SetUserDataProp Card 'SeenBefore NIL]
                       (SETQ RealFringe (MKLIST RootCards))
                       (SETQ Collection (APPEND (MKLIST RootCards)))
                       (for Card in Collection do (NC.SetUserDataProp Card 'SeenBefore T))
                       (for Depth from 1 to MaxDepth eachtime (BLOCK) bind Fringe
                          do (SETQ Fringe (if RealFringe
                                              then (NCP.CardNeighbors RealFringe LinkTypes 
                                                          FollowCrossFileLinksFlg)
                                            else NIL))
                             (if (NULL Fringe)
                                 then (RETURN Collection)
                               else (SETQ RealFringe (for Card in Fringe
                                                        when (NOT (NC.FetchUserDataProp Card
                                                                         'SeenBefore))
                                                        collect (NC.SetUserDataProp Card 'SeenBefore 
                                                                       T)
                                                              (SETQ Collection (CONS Card Collection)
                                                               )
                                                              Card))) finally (RETURN Collection])
)
(PUTPROPS PMIPATCH088 COPYRIGHT ("Xerox Corporation" 1988))
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (1162 4029 (NCP.CollectCards 1172 . 4027)))))
STOP