fork download
  1. #lang racket
  2.  
  3. (require "util/p-list.rkt")
  4.  
  5. (putprop! 'a '(b c) '#:subnodes)
  6. (putprop! 'b '(d e) '#:subnodes)
  7. (putprop! 'e '(i j) '#:subnodes)
  8. (putprop! 'c '(f g h) '#:subnodes)
  9. (putprop! 'g '(k) '#:subnodes)
  10.  
  11. ;;; 展開関数
  12. (define (expand node)
  13. (keyword-get node '#:subnodes '()))
  14.  
  15. ;;; 幅優先探索
  16. (define (breadth start)
  17. (let loop ((queue `(,start)))
  18. (if (null? queue)
  19. null
  20. (let ((node (car queue)))
  21. (if (keyword-get node '#:success)
  22. node
  23. (loop (append (cdr queue) (expand node))))))))
  24.  
Runtime error #stdin #stdout #stderr 0.55s 70844KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
open-input-file: cannot open module file
  module path: /home/KptDHr/util/p-list.rkt
  path: /home/KptDHr/util/p-list.rkt
  system error: no such file or directory; rktio_err=3
  context...:
   maybe-raise-missing-module
   default-load-handler
   standard-module-name-resolver
   perform-require!78
   for-loop
   finish
   [repeats 1 more time]
   pass-1-and-2-loop
   module-begin-k
   expand-module16
   expand-capturing-lifts
   expand-single
   temp74_0
   compile16
   temp68_2
   loop