Skip to content
Browse files

Simplifies loading/requiring rules

  • Loading branch information...
1 parent d52bd29 commit a5f845765b22ab358e05aa9e3718698eec85d42b Yurii Rashkovskii committed Apr 25, 2012
Showing with 20 additions and 20 deletions.
  1. +20 −20 src/main.clp
View
40 src/main.clp
@@ -1,27 +1,27 @@
(defmodule Hypnotoad)
-(defrule load-constructs ?fact <- (require ?filename)
- =>
- (remote-retrieve-file ?filename)
- (assert (require-ready ?filename))
- (retract ?fact))
+(defrule load-constructs
+ (require ?filename)
+ (not (remote-file ?filename ?))
+ =>
+ (remote-retrieve-file ?filename))
-(defrule load-facts ?fact <- (include ?filename)
- =>
- (remote-retrieve-file ?filename)
- (assert (include-ready ?filename))
- (retract ?fact))
+(defrule load-facts
+ (include ?filename)
+ (not (remote-file ?filename ?))
+ =>
+ (remote-retrieve-file ?filename))
(defrule load-contructs-ready
- ?fact <- (require-ready ?filename)
- (remote-file ?filename ?local-filename)
- =>
- (load ?local-filename)
- (retract ?fact))
+ ?fact <- (require ?filename)
+ (remote-file ?filename ?local-filename)
+ =>
+ (load ?local-filename)
+ (retract ?fact))
(defrule load-facts-ready
- ?fact <- (include-ready ?filename)
- (remote-file ?filename ?local-filename)
- =>
- (load-facts ?local-filename)
- (retract ?fact))
+ ?fact <- (include ?filename)
+ (remote-file ?filename ?local-filename)
+ =>
+ (load-facts ?local-filename)
+ (retract ?fact))

0 comments on commit a5f8457

Please sign in to comment.
Something went wrong with that request. Please try again.