From: Ralph Ronnquist Date: Tue, 18 Apr 2023 01:50:23 +0000 (+1000) Subject: corrected foop model. removed debugging X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=daab5a6aed7f5823ad847b32e1f28caafa4a9685;p=rrq%2Flsp-utils.git corrected foop model. removed debugging --- diff --git a/lsp-dbus/lsp-dbus.lsp b/lsp-dbus/lsp-dbus.lsp index 895f53d..6b50235 100644 --- a/lsp-dbus/lsp-dbus.lsp +++ b/lsp-dbus/lsp-dbus.lsp @@ -18,15 +18,11 @@ (context 'MAIN:Dbus) ;; Declaring the FOOP object -(FOOP path bus) +(FOOP path name bus) ;; "The FOOP Constructor". Creates an object for a given path. -(define (Dbus:Dbus PATH (BUS 'SYSTEM-BUS)) - (list (context) PATH BUS)) - -;; Return the bus name -(define (bus-name) - (join (find-all "([^/]+)" (%path) $1 0) ".")) +(define (Dbus:Dbus PATH (NAME (replace "/" (1 PATH) ".")) (BUS 'SYSTEM-BUS)) + (list (context) PATH NAME BUS)) ;; Update the connection serial and return it (define (connection++) @@ -121,10 +117,10 @@ (define (invoke METHOD ARGS (FLAGS 0)) (when (regex "((.+):)?((.+)\\.)?([^(]+)\\((.*)\\)$" METHOD 0) (let ((PATH $2) (INTERFACE $4) (MEMBER $5) (SIGNATURE $6)) - ;;(println (list 'invoke (bus-name) INTERFACE MEMBER SIGNATURE)) + ;;(println (list 'invoke (%name) INTERFACE MEMBER SIGNATURE)) (if (message 'METHOD_CALL FLAGS (list nil ; (if SELF-NAME (list 'SENDER SELF-NAME)) - (list 'DESTINATION (bus-name)) + (list 'DESTINATION (%name)) (list 'PATH (if (empty? PATH) (%path) PATH)) (if (empty? INTERFACE) nil (list 'INTERFACE INTERFACE))