logs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Logs-devel] RDL unstable


From: Vijay Lakshminarayanan
Subject: [Logs-devel] RDL unstable
Date: Sat, 5 Aug 2006 12:23:34 -0500

Hi all,

logs/Language/rdl.lisp will be very unstable over the next few days.
I'm making a series of changes to it both bug fixes and feature
additions.

I don't know exactly where I'm going but here is an outline.

* bug: in the matching function,

 (rule matching "x" and "y") produces

 (MAKE-INSTANCE
  'ORG.PREWETT.LOGS:RULE
  :MATCH
  (LAMBDA (#:MESSAGE1389)
    (MULTIPLE-VALUE-BIND
          (#:MATCHES1390 #:SUB-MATCHES1391)
        (LET ((#:MSGMSG1392
               (ORG.PREWETT.LOGS::MESSAGE #:MESSAGE1389)))
          (AND (CL-PPCRE:SCAN-TO-STRINGS "abc" #:MSGMSG1392)
               (CL-PPCRE:SCAN-TO-STRINGS "x" #:MSGMSG1392)))
      (WHEN #:MATCHES1390
        (VALUES T (LIST (LIST 'SUB-MATCHES #:SUB-MATCHES1391)))))))

 which is fine, but if we use a keyword (from the keyword package)
 for AND or OR we get poor results:

 (rule matching regexp "abvc" :or "ef" :and "xy") produces

 (MAKE-INSTANCE
  'ORG.PREWETT.LOGS:RULE
  :MATCH
  (LAMBDA (#:MESSAGE1393)
    (MULTIPLE-VALUE-BIND
        (#:MATCHES1394 #:SUB-MATCHES1395)
        (LET ((#:MSGMSG1396
               (ORG.PREWETT.LOGS::MESSAGE #:MESSAGE1393)))
          (:OR (CL-PPCRE:SCAN-TO-STRINGS "abvc" #:MSGMSG1396)
               (:AND (CL-PPCRE:SCAN-TO-STRINGS "ef" #:MSGMSG1396)
                     (CL-PPCRE:SCAN-TO-STRINGS "xy" #:MSGMSG1396))))
      (WHEN #:MATCHES1394
        (VALUES T (LIST (LIST 'SUB-MATCHES #:SUB-MATCHES1395)))))))

 which is WRONG.

 I have fixed this but not checked it in.  OR and AND are filled in
 as CL:OR CL:AND respectively.

* bug: setenv does not take its values from the environment

 (let* ((value 10)
        (rule (rule with x = value)))
   (logs::environment rule)) ==> ((x value))

 And since the environment is quote'd, it means that X takes 'VALUE
 as its value.

 This also has been fixed but not checked in.  The environment alist
 is not quote'd, rather generated as a list of lists.

* feature: make precedence optional in matches.

 (rule matching "string literal"
                or regexp (format () "generated string")
                and ("precedence" and (concatenate 'string "enforced")))

* feature: remove the FILTER rdl keyword and include it in match using
 NOT as in

 (rule matching "some? regexp*" and not "some (other)? regexps")

 would give

 (lambda (message)
   (multiple-value-bind
         (matches sub-matches)
       (let ((msgmsg (logs::message message)))
         (and (cl-ppcre:scan-to-strings "some? regexp*" msgmsg)
              (not
               (cl-ppcre:scan-to-strings "some (other)? regexps"))))
     (when matches
       (values t (list (list 'sub-matches sub-matches))))))

This is what I have planned so far.  Also, I will probably stop all
development where it is so i can add unit tests.

More suggestions welcome.  I hope to pick the bones out of your
current rLoGS.lisp and abstract it into a good RDL syntax for
contexts, adding dynamic rules into contexts, rulesets and with
relation to other rules.

Thanks
Vijay




reply via email to

[Prev in Thread] Current Thread [Next in Thread]