id
int64 0
45.1k
| file_name
stringlengths 4
68
| file_path
stringlengths 14
193
| content
stringlengths 32
9.62M
| size
int64 32
9.62M
| language
stringclasses 1
value | extension
stringclasses 6
values | total_lines
int64 1
136k
| avg_line_length
float64 3
903k
| max_line_length
int64 3
4.51M
| alphanum_fraction
float64 0
1
| repo_name
stringclasses 779
values | repo_stars
int64 0
882
| repo_forks
int64 0
108
| repo_open_issues
int64 0
90
| repo_license
stringclasses 8
values | repo_extraction_date
stringclasses 146
values | sha
stringlengths 64
64
| __index_level_0__
int64 0
45.1k
| exdup_ids_cmlisp_stkv2
sequencelengths 1
47
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27,356 | military.db | Vortaro_Guild-Master/military.db | ;; Unit to modify
((:name "man" :range 0 :slash 0 :chop 0 :stab 0 :bash 2 :speed 4 :attack-speed 1 :mobility 10 :health 100))
;; Weapons
((:name "Bow" :range 170 :slash 0 :chop 0 :stab 6 :bash 1 :attack-speed 5)
(:name "Crossbow" :range 100 :slash 0 :chop 0 :stab 8 :bash 2 :attack-speed 8)
(:name "Javelin" :range 30 :slash 0 :chop 0 :stab 5 :bash 2 :attack-speed 4)
(:name "Sling" :range 50 :slash 0 :chop 0 :stab 0 :bash 5 :attack-speed 3)
(:name "Spear" :range 1 :slash 1 :chop 0 :stab 6 :bash 3 :attack-speed 4)
(:name "Halberd" :range 1 :slash 2 :chop 5 :stab 4 :bash 3 :attack-speed 3)
(:name "Sword" :range 0 :slash 8 :chop 0 :stab 4 :bash 2 :attack-speed 2)
(:name "Falchion" :range 0 :slash 3 :chop 7 :stab 1 :bash 2 :attack-speed 3)
(:name "Axe" :range 0 :slash 3 :chop 7 :stab 1 :bash 2 :attack-speed 5)
(:name "Mace" :range 0 :slash 0 :chop 0 :stab 0 :bash 7 :attack-speed 5))
;; Armor
((:name "Leather" :speed 3.8 :mobility 9 :health 50)
(:name "Chain mail" :speed 2.7 :mobility 6 :health 200)
(:name "Plate armor" :speed 1.6 :mobility 3 :health 450))
;;Heavy weapons
((:name "Trebuchet" :range 300 :stab 0 :bash 600 :health 700 :attack-speed 30)
(:name "Onager" :range 130 :stab 0 :bash 150 :health 400 :attack-speed 10)
(:name "Ballista" :range 250 :stab 130 :bash 50 :health 400 :attack-speed 15)
(:name "Siege Ram" :range 0 :stab 0 :bash 100 :health 3000 :attack-speed 20)
(:name "Grapple" :range 50 :health 200 :attack-speed 0)
(:name "Ladder" :range 0 :health 120 :attack-speed 0))
| 1,502 | Common Lisp | .l | 24 | 61.583333 | 107 | 0.677267 | Vortaro/Guild-Master | 1 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | 14953876e7ffd5f12d19595cf0c3357223529f0f6047b4f971b1a25814ed53ca | 27,356 | [
-1
] |
27,360 | title.cpp | Vortaro_Guild-Master/old/title.cpp | #include <iostream>
using namespace std;
int economy();
int city();
void tradeinterface();
int main()
{
int selection;
cout << "==============\n";
cout << "*Guild Master*\n";
cout << "==============\n";
cout << "1. Trade interface\n2. Demand curve test\n3. City navigation interface\n4. Exit\n";
cout << "Choose an option. ";
cin >> selection;
switch(selection)
{
case 1:
tradeinterface();
break;
case 2:
economy();
break;
case 3:
city();
break;
case 4:
cout << "Quitting...\n";
break;
default:
cout << "That's not an option.\n";
break;
}
return 0;
}
| 610 | Common Lisp | .l | 34 | 15.235294 | 93 | 0.597561 | Vortaro/Guild-Master | 1 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | 6cbd3b9e7abec580d44c40f17b8f40b9a54460c1b18e5d9821871479920f952b | 27,360 | [
-1
] |
27,375 | package.lisp | Shookakko_slynk-client/src/package.lisp | (in-package #:common-lisp-user)
(defpackage #:slynk-client
(:documentation "A client interface to Slynk servers.")
(:use #:common-lisp #:alexandria)
(:export #:slynk-connection
#:slime-connect
#:slime-close
#:slime-eval
#:slime-eval-async
#:slime-migrate-evals
#:slime-network-error
#:slime-pending-evals-p
#:with-slime-connection))
| 428 | Common Lisp | .lisp | 13 | 24.615385 | 57 | 0.596618 | Shookakko/slynk-client | 1 | 0 | 1 | GPL-2.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | cc6e49d956d662f875104b7039b7bb759fd8246b35a8f624d97dc17f40b8885f | 27,375 | [
-1
] |
27,376 | slynk-client.lisp | Shookakko_slynk-client/src/slynk-client.lisp | (in-package #:slynk-client)
(deftype port () "A non-privileged TCP/IP port number." '(integer 1024 65535))
(define-constant +abort+ (cons nil nil)
:documentation
"Unique object used to signal that a computation was aborted on the server."
:test #'equal)
(defvar *thread-offset* 0
"Counter used to assign each Slynk connection a unique range of thread IDs.")
(define-constant +maximum-thread-count+ 10000
:documentation
"Maximum number of threads per Slynk connection."
:test #'=)
(define-condition slime-network-error (error)
()
(:documentation "Network problem while evaluating a form."))
(defclass slynk-connection ()
((host-name :reader host-name
:type string
:initarg :host-name
:documentation "Name of the host where the Slynk server is running.")
(port :reader port
:type port
:initarg :port
:documentation "Port number used to make a Slynk server connection.")
(usocket :reader usocket
:type usocket:stream-usocket
:initarg :usocket
:documentation "USOCKET used to communicate with the Slynk server.")
(thread-offset :reader thread-offset
:initform (incf *thread-offset* +maximum-thread-count+)
:type (integer 0 *)
:documentation
"All threads for this connection are presented to Emacs with this value added to
their thread ID.")
(continuation-counter :accessor continuation-counter
:initform 0
:type (integer 0 *)
:documentation "Used to associate an ID with each evaluated form.")
(rex-continuations :accessor rex-continuations
:initform '()
:type list
:documentation
"List of (ID, continuation) pairs, one for each evaluation in progress. Used to
match each returned value with the continuation it should be passed to.")
(state :accessor state
:initform :alive
:type (member :alive :closing :dead)
:documentation "State of the connection, either :ALIVE, :CLOSING, or :DEAD.")
(connection-lock :reader connection-lock
:initform (bordeaux-threads:make-lock)
:documentation
"Lock protecting slots of this connection that are read and written by
concurrently running threads."))
(:documentation "A connection to a Slynk server."))
(defvar *open-connections* '()
"List of all open Slynk connections.")
(defvar *connections-lock* (bordeaux-threads:make-lock)
"Lock protecting *OPEN-CONNECTIONS*.")
(defgeneric add-open-connection (connection)
(:documentation
"Adds CONNECTION to the set of open Slynk connections."))
(defmethod add-open-connection ((connection slynk-connection))
(bordeaux-threads:with-lock-held (*connections-lock*)
(push connection *open-connections*)))
(defgeneric remove-open-connection (conection)
(:documentation
"Removes CONNECTION from the set of open Slynk connections."))
(defmethod remove-open-connection ((connection slynk-connection))
(bordeaux-threads:with-lock-held (*connections-lock*)
(setf *open-connections* (remove connection *open-connections*))))
(defun find-connection-for-thread-id (thread-id)
"Returns the open Slynk connection associated with THREAD-ID."
(bordeaux-threads:with-lock-held (*connections-lock*)
(let ((thread-offset (* (floor thread-id +maximum-thread-count+)
+maximum-thread-count+)))
(find thread-offset *open-connections* :key #'thread-offset))))
(defun server-thread-id (thread-id)
"Maps the THREAD-ID in an event that must be forwarded to the thread ID known
by the remote Lisp to which it will be sent."
(mod thread-id +maximum-thread-count+))
(defun forward-event-to-worker (form package thread-id id)
"Determines whether an :emacs-rex event is intended for a remote worker Lisp
and if so forwards it. When forwarding is successful, FORWARD-EVENT-TO-WORKER
returns T; otherwise, it returns NIL.
FORWARD-EVENT-TO-WORKER is called by code in Slynk Crew's patch to Slime's
slynk.lisp source file. The forwarding it performs is used by Slynk Crew
to handle debugging of conditions signalled on remote worker Lisps. See
slynk.lisp-patch in https://github.com/brown/slynk-crew."
(let ((connection (find-connection-for-thread-id thread-id)))
(when connection
(let ((remote-thread-id (server-thread-id thread-id)))
(slime-send `(:emacs-rex ,form ,package ,remote-thread-id ,id) connection))
t)))
(defvar *io-package*
(let ((package (make-package :slynk-client-io-package :use '())))
(import '(nil t quote) package)
package)
"A package used by the Slynk client code when printing s-expressions, so that
symbols in the printed output contain their package names.")
(defun slime-net-encode-length (n)
"Encodes an integer as a 6-character, 24-bit hex string."
(format nil "~6,'0,X" n))
(defun slime-net-send (sexp usocket)
"Sends SEXP to a Slynk server over USOCKET. The s-expression is read and
evaluated by the remote Lisp."
(let* ((payload (with-standard-io-syntax
(let ((*package* *io-package*))
(prin1-to-string sexp))))
(utf8-payload (string-to-utf8-octets payload))
;; The payload always includes one more octet, an encoded newline character at the end.
(payload-length (1+ (length utf8-payload)))
(utf8-length (string-to-utf8-octets (slime-net-encode-length payload-length)))
;; The encoded length always takes 6 octets.
(message (make-octet-vector (+ (length utf8-length) payload-length))))
(replace message utf8-length)
(replace message utf8-payload :start1 (length utf8-length))
(setf (aref message (1- (length message))) (char-code #\Newline))
;; We use IGNORE-ERRORS here to catch SB-INT:CLOSED-STREAM-ERROR on SBCL and any other
;; system-dependent network or stream errors.
(let ((success (ignore-errors
(write-sequence message (usocket:socket-stream usocket)))))
(unless success (error 'slime-network-error)))))
(defun slime-send (sexp connection)
"Sends SEXP to a Slynk server using CONNECTION. Signals SLIME-NETWORK-ERROR
if there are communications problems."
(let ((usocket (usocket connection)))
(slime-net-send sexp usocket)
;; We use IGNORE-ERRORS here to catch SB-INT:CLOSED-STREAM-ERROR on SBCL and any other
;; system-dependent network or stream errors.
(let ((success nil))
(ignore-errors
(progn (force-output (usocket:socket-stream usocket))
(setf success t)))
(unless success (error 'slime-network-error))))
(values))
(defun socket-keep-alive (socket)
"Configures TCP keep alive packets for SOCKET. The socket connection will be
considered dead if keep alive packets are lost."
(declare (ignorable socket))
#+allegro
(socket:set-socket-options socket :keepalive t)
#+ccl
(ccl::set-socket-options socket :keepalive t)
#+sbcl
(setf (sb-bsd-sockets:sockopt-keep-alive socket) t)
#+(and linux sbcl)
(setf (sb-bsd-sockets:sockopt-tcp-keepcnt socket) 1
(sb-bsd-sockets:sockopt-tcp-keepidle socket) 30
(sb-bsd-sockets:sockopt-tcp-keepintvl socket) 30))
(defun slime-net-connect (host-name port)
"Establishes a connection to the Slynk server listening on PORT of HOST-NAME.
Returns a SLYNK-CONNECTION when the connection attempt is successful.
Otherwise, returns NIL. May signal SLIME-NETWORK-ERROR if the user has a Slime
secret file and there are network problems sending its contents to the remote
Slynk server."
(let ((usocket (handler-case
(usocket:socket-connect host-name port :element-type 'octet)
(usocket:socket-error ()
(return-from slime-net-connect nil)))))
(socket-keep-alive (usocket:socket usocket))
(let ((connection
(make-instance
'slynk-connection :host-name host-name :port port :usocket usocket)))
connection)))
;;TODO: Evaluate the real value of this function
(defun send-to-emacs (event)
"Sends EVENT to Emacs."
(print event)
;;(slynk::send (slynk::mconn.control-thread (slynk::default-connection)) event)
)
;;;; Protocol event handler (the guts)
;;; This is the protocol in all its glory. The input to this function is a protocol event that
;;; either originates within Emacs or arrived over the network from Lisp.
;;;
;;; Each event is a list beginning with a keyword and followed by arguments. The keyword identifies
;;; the type of event. Events originating from Emacs have names starting with :emacs- and events
;;; from Lisp don't.
(defun slime-dispatch-event (event connection)
"Handles EVENT for a Slynk CONNECTION. Signals SLIME-NETWORK-ERROR if there
are communications problems."
(destructure-case event
((:emacs-rex form package-name thread continuation)
(let ((id nil))
(bordeaux-threads:with-lock-held ((connection-lock connection))
(setf id (incf (continuation-counter connection)))
(push (list id continuation form package-name thread) (rex-continuations connection))
(when (eq (state connection) :dead) (error 'slime-network-error)))
(let ((name (format nil "slynk sender for ~A/~D" (host-name connection) (port connection))))
(bordeaux-threads:make-thread
(lambda ()
;; Catch network errors so the Slynk sender thread exits gracefully if there are
;; communications problems with the remote Lisp.
(handler-case
(slime-send `(:emacs-rex ,form ,package-name ,thread ,id) connection)
(slime-network-error ())))
:name name))))
((:return value id)
(let ((send-to-emacs t))
(bordeaux-threads:with-lock-held ((connection-lock connection))
(let ((rec (assoc id (rex-continuations connection))))
(when rec
(setf send-to-emacs nil)
(setf (rex-continuations connection) (remove rec (rex-continuations connection)))
(funcall (second rec) value))))
;; The value returned is not for us. Forward it to Slime.
(when send-to-emacs
(force-output)
(send-to-emacs `(:return ,(slynk::current-thread) ,value ,id)))))
;; When a remote computation signals a condition and control ends up in the debugger, Slynk
;; sends these events back to pop up a Slime breakpoint window. Forward the events to Slime.
;; Modify the thread ID of each event to uniquely identify which remote Lisp generated it.
((:debug-activate thread level &optional select)
(incf thread (thread-offset connection))
(send-to-emacs `(:debug-activate ,thread ,level ,select)))
((:debug thread level condition restarts frames continuations)
(incf thread (thread-offset connection))
;;TODO: Change this there is no Emacs here
(send-to-emacs `(:debug ,thread ,level ,condition ,restarts ,frames ,continuations)))
((:debug-return thread level stepping)
(incf thread (thread-offset connection))
(send-to-emacs `(:debug-return ,thread ,level ,stepping)))
((:emacs-interrupt thread)
(slime-send `(:emacs-interrupt ,thread) connection))
((:channel-send id msg)
(print (list :channel-send id msg)))
((:emacs-channel-send id msg)
(slime-send `(:emacs-channel-send ,id ,msg) connection))
((:read-from-minibuffer thread tag prompt initial-value)
(print (list :read-from-minibuffer thread tag prompt initial-value)))
((:y-or-n-p thread tag question)
(print (list :y-or-n-p thread tag question)))
((:emacs-return-string thread tag string)
(slime-send `(:emacs-return-string ,thread ,tag ,string) connection))
;; Ignore remote Lisp feature changes.
((:new-features features)
(declare (ignore features)))
;; Ignore remote Lisp indentation updates.
((:indentation-update info)
(declare (ignore info)))
((:eval-no-wait form)
(print (list :eval-no-wait form)))
((:eval thread tag form-string)
(print (list :eval thread tag form-string)))
((:ed-rpc-no-wait function-name &rest args)
(print (list :ed-rpc-no-wait function-name '&rest args)))
((:ed-rpc thread tag function-name &rest args)
(print (list :ed-rpc thread tag function-name '&rest args)))
((:emacs-return thread tag value)
(slime-send `(:emacs-return ,thread ,tag ,value) connection))
((:ed what)
(print (list :ed what)))
((:inspect what wait-thread wait-tag)
(print (list :inspect what wait-thread wait-tag)))
((:background-message message)
(print (list :background-message message)))
((:debug-condition thread message)
(assert thread)
(print (list :debug-condition thread message)))
((:ping thread tag)
(slime-send `(:emacs-pong ,thread ,tag) connection))
((:reader-error packet condition)
(print (list :reader-error packet condition))
(error "Invalid protocol message"))
((:invalid-rpc id message)
(setf (rex-continuations connection) (remove id (rex-continuations connection) :key #'car))
(error "Invalid rpc: ~S" message))
((:emacs-skipped-packet packet)
(print (list :emacs-skipped-packet packet)))
(t
(error "Unknown event received: ~S" event))))
(defun slime-net-read (connection)
"Reads a Slynk message from a network CONNECTION to a Slynk server. Returns
the Slynk event or NIL, if there was a problem reading data."
(flet ((safe-read-sequence (buffer stream)
;; We use IGNORE-ERRORS here to catch SB-INT:CLOSED-STREAM-ERROR on SBCL and any other
;; system-dependent network or stream errors.
(let ((result (ignore-errors (read-sequence buffer stream))))
(unless result (return-from slime-net-read))
result)))
(let ((stream (usocket:socket-stream (usocket connection)))
(length-buffer (make-octet-vector 6)))
(if (/= (safe-read-sequence length-buffer stream) 6)
nil
(let* ((length-string (utf8-octets-to-string length-buffer))
(length (parse-integer length-string :radix 16))
(message-buffer (make-octet-vector length)))
(if (/= (safe-read-sequence message-buffer stream) length)
nil
(let ((message (utf8-octets-to-string message-buffer)))
(with-standard-io-syntax
(let ((*package* *io-package*))
(read-from-string message))))))))))
(defmacro slime-rex ((&rest saved-vars) (sexp connection) &body continuations)
"(slime-rex (VAR ...) (SEXP CONNECTION) CLAUSES ...)
Remote EXecute SEXP.
VARs are a list of saved variables visible in the other forms. Each VAR is
either a symbol or a list (VAR INIT-VALUE).
SEXP is evaluated and the PRINCed version is sent over CONNECTION to a remote
Lisp.
CLAUSES is a list of patterns with same syntax as `destructure-case'. The
result of the evaluation of SEXP is dispatched on CLAUSES. The result is either
a sexp of the form (:ok VALUE) or (:abort CONDITION). CLAUSES is executed
asynchronously.
Signals SLIME-NETWORK-ERROR when there are network problems sending SEXP."
(let ((result (gensym)))
`(let ,(loop for var in saved-vars
collect (etypecase var
(symbol (list var var))
(cons var)))
(slime-dispatch-event (list :emacs-rex
,sexp
"COMMON-LISP-USER"
t
(lambda (,result)
(destructure-case ,result ,@continuations)))
,connection))))
(defun slime-eval-async (sexp connection &optional continuation)
"Sends SEXP over CONNECTION to a Slynk server for evaluation, then immediately
returns. Some time later, after the evaluation is finished, CONTINUATION is
called with the result as argument. Signals SLIME-NETWORK-ERROR when there are
network problems sending SEXP."
(slime-rex (continuation)
(sexp connection)
((:ok result)
(when continuation
(funcall continuation result)))
((:abort condition)
(when continuation
(funcall continuation (cons +abort+ condition)))))
(values))
(defun slime-eval (sexp connection)
"Sends SEXP over CONNECTION to a Slynk server for evaluation and waits for the
result. When the result is received, it is returned. Signals
SLIME-NETWORK-ERROR when there are network problems sending SEXP."
(let* ((done-lock (bordeaux-threads:make-lock "slime eval"))
(done (bordeaux-threads:make-condition-variable))
(result-available nil)
(result nil))
;; See the Bordeaux Threads documentation for a description of the locking pattern used here.
(slime-eval-async sexp
connection
(lambda (x)
(bordeaux-threads:with-lock-held (done-lock)
(setf result x
result-available t)
(bordeaux-threads:condition-notify done))))
(bordeaux-threads:with-lock-held (done-lock)
;; Do not call CONDITION-WAIT if our result is already available, since we would wait forever
;; on the DONE condition variable, which has already been notified. Also, CONDITION-WAIT can
;; return spuriously before DONE has been notified, so wait again if our result is not yet
;; available.
(loop until result-available
do (bordeaux-threads:condition-wait done done-lock)))
(when (and (consp result) (eq (car result) +abort+))
(error "Evaluation aborted on ~s." (cdr result)))
result))
(defun slime-pending-evals-p (connection)
"Returns T if there are outstanding evaluations pending on CONNECTION;
otherwise, returns NIL."
(not (null (rex-continuations connection))))
(defun slime-migrate-evals (old-connection new-connection)
"Evaluates on NEW-CONNECTION all the work pending on a closed OLD-CONNECTION.
Signals SLIME-NETWORK-ERROR when there are network problems."
(dolist (rec (rex-continuations old-connection))
(destructuring-bind (id continuation form package-name thread)
rec
(declare (ignore id))
(slime-dispatch-event `(:emacs-rex ,form ,package-name ,thread ,continuation)
new-connection)))
(setf (rex-continuations old-connection) '()))
(defun slime-dispatch-events (connection connection-closed-hook)
"Reads and dispatches incoming events for a CONNECTION to a Slynk server. If
provided, function CONNECTION-CLOSED-HOOK is called when CONNECTION is closed."
(flet ((close-connection ()
(bordeaux-threads:with-lock-held ((connection-lock connection))
(usocket:socket-close (usocket connection))
(setf (state connection) :dead))
(remove-open-connection connection)
(when connection-closed-hook (funcall connection-closed-hook))))
(loop (let ((event (slime-net-read connection)))
(unless event
(close-connection)
(return-from slime-dispatch-events))
;; TODO(brown): Verify that this call to SLIME-DISPATCH-EVENTS will never signal
;; SLIME-NETWORK-ERROR.
(slime-dispatch-event event connection))
(let ((state nil))
(bordeaux-threads:with-lock-held ((connection-lock connection))
(setf state (state connection)))
(ecase state
(:alive)
(:closing
(close-connection)
(return-from slime-dispatch-events))
(:dead
(return-from slime-dispatch-events)))))))
(defun slime-connect (host-name port &optional connection-closed-hook)
"Connects to the Slynk server running on HOST-NAME that is listening on PORT.
Returns a SLYNK-CONNECTION if the connection attempt is successful. Otherwise,
returns NIL. May signal SLIME-NETWORK-ERROR if the user has a Slime secret file
and there are network problems sending its contents to the remote Slynk server.
If provided, function CONNECTION-CLOSED-HOOK is called when the connection is
closed."
(let ((connection (slime-net-connect host-name port)))
(when connection
(add-open-connection connection)
;; Create a thread to handle incoming events from the remote Lisp.
(let ((name (format nil "slynk dispatcher for ~A/~D" host-name port)))
(bordeaux-threads:make-thread (lambda ()
(slime-dispatch-events connection connection-closed-hook))
:name name)))
connection))
(defun slime-close (connection)
"Closes CONNECTION to a Slynk server."
(bordeaux-threads:with-lock-held ((connection-lock connection))
(setf (state connection) :closing))
(slime-eval-async nil connection)
(values))
(defmacro with-slime-connection ((variable host-name port &optional connection-closed-hook)
&body body)
"Wraps BODY in a LET form where VARIABLE is bound to the value returned by
(SLIME-CONNECT HOST-NAME PORT CONNECTION-CLOSED-HOOK). Arranges for the Slynk
connection to be closed when control exits BODY."
`(let ((,variable (slime-connect ,host-name ,port ,connection-closed-hook)))
(unless ,variable (error 'slime-network-error))
(unwind-protect
(progn ,@body)
(slime-close ,variable))))
| 21,017 | Common Lisp | .lisp | 428 | 43.060748 | 99 | 0.696063 | Shookakko/slynk-client | 1 | 0 | 1 | GPL-2.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | 6101a09e60188b6c59cb47ed8f9bd49090407107bb9b1b1187a3cf386e292e9a | 27,376 | [
-1
] |
27,377 | lib.lisp | Shookakko_slynk-client/src/lib.lisp | (in-package #:slynk-client)
(defmacro destructure-case (value &body patterns)
"Dispatches VALUE to one of PATTERNS. A cross between CASE and DESTRUCTURING-BIND.
The pattern syntax is: ((HEAD . ARGS) . BODY). The list of patterns is searched
for a HEAD that's EQ to the car of VALUE. If one is found, BODY is executed
with ARGS bound to the corresponding values in the CDR of VALUE."
(let ((operator (gensym "op-"))
(operands (gensym "rand-"))
(tmp (gensym "tmp-")))
`(let* ((,tmp ,value)
(,operator (car ,tmp))
(,operands (cdr ,tmp)))
(case ,operator
,@(mapcar (lambda (clause)
(if (eq (car clause) t)
`(t ,@(cdr clause))
(destructuring-bind ((op &rest rands) &rest body) clause
`(,op (destructuring-bind ,rands ,operands
. ,body)))))
patterns)
,@(if (eq (caar (last patterns)) t)
'()
`((t (error "destructure-case failed: ~S" ,tmp))))))))
(deftype octet () '(unsigned-byte 8))
(deftype octet-vector (&optional length) `(simple-array octet (,length)))
(define-constant +maximum-vector-index+ (1- array-dimension-limit)
:documentation "Largest valid vector index."
:test #'=)
(deftype vector-index ()
"Integer that can be used as a subscript for accessing an array or vector element."
'(integer 0 #.+maximum-vector-index+))
(defun octet-vector (&rest octets)
(coerce octets 'octet-vector))
(defun string-to-utf8-octets (string &key (start 0) (end (length string)))
"Convert STRING into an OCTET-VECTOR by UTF-8 encoding each character."
(declare (type string string)
(type vector-index start end))
#+allegro
(excl:string-to-octets string :start start :end end :null-terminate nil :external-format :utf8)
#+ccl
(ccl:encode-string-to-octets string :start start :end end :external-format :utf-8)
#+clisp
(ext:convert-string-to-bytes string charset:utf-8 :start start :end end)
#+sbcl
(sb-ext:string-to-octets string :start start :end end :external-format :utf-8)
#-(or allegro ccl clisp sbcl)
(trivial-utf-8:string-to-utf-8-bytes (subseq string start end)))
(defun utf8-octets-to-string (octets &key (start 0) (end (length octets)))
"Convert OCTETS, a vector of UTF-8 encoded octets, into a string."
(declare (type octet-vector octets)
(type vector-index start end))
#+allegro
(excl:octets-to-string octets :start start :end end :external-format :utf8)
#+ccl
(ccl:decode-string-from-octets octets :start start :end end :external-format :utf-8)
#+clisp
(ext:convert-string-from-bytes octets charset:utf-8 :start start :end end)
#+sbcl
(sb-ext:octets-to-string octets :start start :end end :external-format :utf8)
#-(or allegro ccl clisp sbcl)
(trivial-utf-8:utf-8-bytes-to-string (subseq octets start end)))
(defun make-octet-vector (octet-count &key initial-contents)
"Create an OCTET-VECTOR containing OCTET-COUNT octets. If INITIAL-CONTENTS
is not supplied, each element of the vector is initialized to zero. Otherwise,
the vector is initialized to the contents of list INITIAL-CONTENTS."
(declare (type vector-index octet-count)
(type list initial-contents))
(if initial-contents
(make-array octet-count :element-type 'octet :initial-contents initial-contents)
(make-array octet-count :element-type 'octet :initial-element 0)))
| 3,358 | Common Lisp | .lisp | 70 | 43.742857 | 97 | 0.700213 | Shookakko/slynk-client | 1 | 0 | 1 | GPL-2.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | d2b10069ea0f9c3264bd6ef8e46354fce1a346a89c94de7883700be6f4a519c8 | 27,377 | [
-1
] |
27,378 | slynk-client-test.lisp | Shookakko_slynk-client/tests/slynk-client-test.lisp | (in-package #:common-lisp-user)
(defpackage #:slynk-client-test
(:documentation "Test code in the SLYNK-CLIENT package.")
(:use #:common-lisp
#:slynk-client
#:fiveam)
(:export #:test-slynk-client))
(in-package #:slynk-client-test)
(def-suite test-slynk-client
:description "Main test suite for slynk tests")
(in-suite test-slynk-client)
(alexandria:define-constant +server-count+ 4
:documentation "Number of maximum servers to run"
:test #'=)
(defun create-slynk-server ()
(setf slynk:*configure-emacs-indentation* nil)
(slynk:create-server :port 0))
(test no-connection ()
(signals slynk-client:slime-network-error
(with-slime-connection (connection "localhost" 12345)
(slime-eval 42 connection))))
(test simple-eval ()
(with-slime-connection (connection "localhost" (create-slynk-server))
(is (= (slime-eval 123 connection) 123))))
(test simple-eval-async ()
(with-slime-connection (connection "localhost" (create-slynk-server))
(let ((result nil)
(result-lock (bordeaux-threads:make-lock "result lock")))
(slime-eval-async 123
connection
(lambda (x)
(bordeaux-threads:with-lock-held (result-lock)
(setf result x))))
(loop until (bordeaux-threads:with-lock-held (result-lock) result))
(is (= result 123)))))
(test several-connections ()
(let* ((server-ports (loop repeat +server-count+ collect (create-slynk-server)))
(connections (loop for port in server-ports collect (slime-connect "localhost" port)))
(work (make-array +server-count+
:initial-contents (loop repeat +server-count+ for i from 2 collect i)))
(golden (map 'vector (lambda (x) (* x 2)) work)))
(unwind-protect
(let ((results (make-array +server-count+ :initial-element nil))
(results-lock (bordeaux-threads:make-lock "results lock")))
;; Synchronous
(loop for i below (length work)
for connection in connections
do (setf (aref results i) (slime-eval `(* 2 ,(aref work i)) connection)))
(is (equalp results golden))
;; Reset results.
(loop for i below (length results) do (setf (aref results i) nil))
;; Asynchronous
(loop for i below (length work)
for connection in connections
do (let ((index i))
(slime-eval-async `(* 2 ,(aref work i))
connection
(lambda (result)
(bordeaux-threads:with-lock-held (results-lock)
(setf (aref results index) result))))))
(loop while (bordeaux-threads:with-lock-held (results-lock) (some #'null results)))
(is (equalp results golden)))
(dolist (connection connections)
(slime-close connection)))))
(test non-ascii-characters
(flet ((create-string (code)
(concatenate 'string "hello " (string (code-char code)) " world")))
(with-slime-connection (connection "localhost" (create-slynk-server))
(loop for code from 0 below 2000 by 100 do
(let ((string (create-string code)))
(is (string= (slime-eval string connection) string)))))))
| 3,401 | Common Lisp | .lisp | 71 | 37.450704 | 98 | 0.599578 | Shookakko/slynk-client | 1 | 0 | 1 | GPL-2.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | 1d837c992b75dee3d5f265c1a6d2e6993eb9ee4c62557457517b0e8aefebdd78 | 27,378 | [
-1
] |
27,379 | run-tests.lisp | Shookakko_slynk-client/scripts/run-tests.lisp | (require :asdf)
(asdf:clear-configuration)
(asdf:operate 'asdf:load-op ':slynk-client)
(asdf:operate 'asdf:load-op ':slynk-client/test)
;; Insert 5am project suite name
;; (5am:run! ...)
(in-package :slynk-client-test)
(5am:run! 'test-slynk-client)
(sb-ext::quit)
| 270 | Common Lisp | .lisp | 9 | 28.333333 | 48 | 0.729412 | Shookakko/slynk-client | 1 | 0 | 1 | GPL-2.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | e95715d85c236cc4dd8171e921c49fb453aa87b18b1e3aa0853b25ecc078b26c | 27,379 | [
-1
] |
27,380 | dep-install.lisp | Shookakko_slynk-client/scripts/dep-install.lisp | (require "asdf")
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
(asdf:load-system :quicklisp)
;; Insert the quicklisp external dependencies
(ql:quickload :slynk)
(ql:quickload :fiveam)
(ql:quickload :bordeaux-threads)
(ql:quickload :usocket)
| 391 | Common Lisp | .lisp | 11 | 30.090909 | 65 | 0.68883 | Shookakko/slynk-client | 1 | 0 | 1 | GPL-2.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | e8af65870d74fb7bf12372483b8d42a0cf19c68152dbcd3f57ac828f0647d72b | 27,380 | [
-1
] |
27,381 | install-clisp.sh | Shookakko_slynk-client/scripts/install-clisp.sh | ## Install Quicklisp
curl -O https://beta.quicklisp.org/quicklisp.lisp
clisp -x '(load "quicklisp.lisp") (quicklisp-quickstart:install)'
## Install dependencies
clisp -x '(load "scripts/dep-install.lisp")'
## Move the project to local-projects
mkdir -p $HOME/quicklisp/local-projects
cp scripts/lisp-init $HOME/.clisprc
cp -R ../slynk-client $HOME/quicklisp/local-projects/
| 384 | Common Lisp | .lisp | 9 | 40.555556 | 65 | 0.771117 | Shookakko/slynk-client | 1 | 0 | 1 | GPL-2.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | bf1fab31e1cc2fe8c16f00b56448e053c9c1bb0bded9e0f5999766d9bdbc5858 | 27,381 | [
-1
] |
27,382 | run-compile.lisp | Shookakko_slynk-client/scripts/run-compile.lisp | (require :asdf)
(asdf:load-system :slynk-client)
(asdf:load-system :slynk-client/test)
(asdf:make :slynk-client)
(asdf:make :slynk-client)
(quit)
| 149 | Common Lisp | .lisp | 6 | 23.333333 | 37 | 0.764286 | Shookakko/slynk-client | 1 | 0 | 1 | GPL-2.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | 18d684fb950b4ea15a27248ad3c5d38f3f58470e3dbe6e58d5f9d051b1b73c35 | 27,382 | [
-1
] |
27,383 | slynk-client.asd | Shookakko_slynk-client/slynk-client.asd | (eval-when (:compile-toplevel)
(error "This ASDF file should be run interpreted."))
(defsystem slynk-client
:name "Slynk Client"
:description "Client side of the Slynk protocol."
:long-description "An implementation of the client side of Sly's Slynk debugging protocol."
:version "1.6"
:author "Fermin MF"
:license "GPL version 2. See the copyright messages in individual files."
:depends-on (:bordeaux-threads :alexandria :slynk :usocket)
:components
((:module src
:components
((:file "package")
(:file "lib")
(:file "slynk-client" :depends-on ("lib" "package"))))))
(defsystem slynk-client/test
:name "Slynk Client test"
:description "Test code for package SLYNK-CLIENT."
:version "1.6"
:author "Fermin MF"
:license "GPL version 2. See the copyright messages in individual files."
:depends-on (:fiveam :slynk-client)
:components
((:module tests
:components
((:file "slynk-client-test")))))
| 959 | Common Lisp | .asd | 27 | 32.111111 | 93 | 0.708288 | Shookakko/slynk-client | 1 | 0 | 1 | GPL-2.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | 99c94ac18379e5edff5096ec702157eb52c9410e99e2c49a9ac0ce70504cd08f | 27,383 | [
-1
] |
27,387 | install-sbcl.sh | Shookakko_slynk-client/scripts/install-sbcl.sh | ## Install Quicklisp
curl -O https://beta.quicklisp.org/quicklisp.lisp
if [ ! -d "$HOME/quicklisp" ]; then
sbcl --load quicklisp.lisp --eval "(quicklisp-quickstart:install)" --eval "(quit)"
fi
## Install dependencies
sbcl --load scripts/dep-install.lisp --eval "(quit)"
## Move the project to local-projects
mkdir -p $HOME/quicklisp/local-projects
cp scripts/lisp-init $HOME/.sbclrc
cp -R ../slynk-client $HOME/quicklisp/local-projects/
| 451 | Common Lisp | .cl | 11 | 38.727273 | 86 | 0.740741 | Shookakko/slynk-client | 1 | 0 | 1 | GPL-2.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | 2757cadd2f6ab3791cd38ed32d4e326b0e808473cf2d4984d0bb7b43f4d86c10 | 27,387 | [
-1
] |
27,391 | Makefile | Shookakko_slynk-client/Makefile | int-compile-sbcl:
sbcl --load ./scripts/run-compile.lisp
int-compile-clisp:
clisp -x '(load "./scripts/run-compile.lisp")'
clean:
find -name "*.fasl" -exec rm {} \;
find -name "*.fas" -exec rm {} \;
int-test-sbcl:
sbcl --load ./scripts/run-tests.lisp
int-test-clisp:
clisp -x '(load "./scripts/run-tests.lisp")'
compile-sbcl: clean int-compile-sbcl
compile-clisp: clean int-compile-clisp
test-sbcl: clean int-test-sbcl
test-clisp: clean int-test-clisp
| 469 | Common Lisp | .l | 15 | 29.133333 | 47 | 0.717489 | Shookakko/slynk-client | 1 | 0 | 1 | GPL-2.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | 8c57db4b9be81b3d905700edd799bb30b66a6c06597dd42fecd8aea8774effbb | 27,391 | [
-1
] |
27,415 | tic-tac-toe-vs-comp-working-random.cl | renderedSafe_cl-tic-tac-toe/tic-tac-toe-vs-comp-working-random.cl | ;;;; tictactoe.lisp
;;;;
;;;; Andrew Levenson
;;;; 10/27/10
;;;;
;;;; Simple two player ASCII Tic Tac Toe Game
;;; First player is X, so initialize the marker to X
(setf *marker* :X)
(setf *player* "Player 1")
;;; Create the board in memory
(defun create-board ()
(setf *board* (make-array 9 :initial-contents
'(1 2 3 4 5 6 7 8 9))))
;;; Greet the player and display the board.
(defun welcome-player ()
(format t "Welcome to TicTacToe!~%~%")
(create-board)
(play nil))
;;; Draw the board
;;; If numbersp is t, draw the numbers on the board
;;; to represent which number to enter to select that space
(defun draw-board ()
(format t " | | ~%")
(format t " ~a | ~a | ~a ~%" (board-ref 1) (board-ref 2) (board-ref 3))
(format t " | | ~%")
(format t "_________________~%")
(format t " | | ~%")
(format t " ~a | ~a | ~a ~%" (board-ref 4) (board-ref 5) (board-ref 6))
(format t " | | ~%")
(format t "_________________~%")
(format t " | | ~%")
(format t " ~a | ~a | ~a ~%" (board-ref 7) (board-ref 8) (board-ref 9))
(format t " | | ~%~%"))
;;; Play the game
(defun play (&optional switch-p)
(when switch-p (switch-player))
(if (equal *marker* :X)
(check-choice (read-choice))
(computer-move))
(when (and
(not (check-for-win-p))
(not (stalemate)))
(play t))
(when (check-for-win-p)
(progn
(draw-board)
(format t "~a has won! " *player*)
(force-output nil)
(if (y-or-n-p "Play again? ")
(play-again)
(quit))))
(when (stalemate)
(if (y-or-n-p "~%~%Stalemate! Play again? ")
(play-again)
(quit))))
(defun play-again ()
(create-board)
(switch-player)
(format t "This game will be started by ~a.~%~%" *player*)
(play))
(defun switch-player ()
(if (equal *marker* :X)
(setf *marker* :O)
(setf *marker* :X))
(if (equal *player* "Player 1")
(setf *player* "Player 2")
(setf *player* "Player 1")))
;;; Allow the player to choose a square
;;; Or, if they wish, display the board with
;;; the numbers on it.
(defun read-choice ()
(draw-board)
(format t "~a, select a number to choose a square.~%" *player*)
(force-output nil)
(parse-integer (read-line *query-io*) :junk-allowed t))
(defun check-choice (choice)
(if (and
(numberp choice)
(> choice 0)
(< choice 10))
(select choice)
(progn
(format t "~%Invalid choice.~%")
(check-choice (read-choice)))))
(defun select (choice)
(if (numberp (aref *board* (- choice 1))) (setf (aref *board* (- choice 1)) *marker*)
(invalid-selection)))
(defun invalid-selection ()
(format t "That spot is taken. Please choose another spot.~%~%")
(draw-board)
(force-output nil)
(check-choice (read-choice)))
(defun check-for-win-p ()
(or (is-line-p 1 2 3)
(is-line-p 1 4 7)
(is-line-p 1 5 9)
(is-line-p 2 5 8)
(is-line-p 3 6 9)
(is-line-p 3 5 7)
(is-line-p 4 5 6)
(is-line-p 7 8 9)))
(defun is-line-p (a b c)
(and
(eql
(board-ref a)
(board-ref b))
(eql
(board-ref a)
(board-ref c))))
(defun board-ref (cell)
(aref *board* (- cell 1)))
(defun stalemate ()
(when
(and
(not (numberp (aref *board* 0)))
(not (numberp (aref *board* 1)))
(not (numberp (aref *board* 2)))
(not (numberp (aref *board* 3)))
(not (numberp (aref *board* 4)))
(not (numberp (aref *board* 5)))
(not (numberp (aref *board* 6)))
(not (numberp (aref *board* 7)))
(not (numberp (aref *board* 8))))
t))
;;;Hey look,style to match the code that was already in place. Referencing a global variable inside a function..
(defun get-legal-moves ()
(loop for x across (remove-if-not #'numberp *board*)
collect x))
(defun computer-move ()
(select (find-best-move)))
;;;checks he utility of every legal move and returns the cell with the highest utility
(defun find-best-move ()
(let
((best-move-cell (elt (get-legal-moves) 0))
(best-move-value 0)
(legal-moves (get-legal-moves)))
(loop for x in legal-moves
if (> (find-move-utility x) best-move-value)
do (progn (setf best-move-value (find-move-utility x))
(setf best-move-cell x)))
best-move-cell))
;;;TODO: make this take the reference piece as argument, that way we can check opponent's
;;; moves too and minimize their score
;;;quantifies the utility of a move in a given cell based on the current state of the *board*
(defun find-move-utility (cell)
(let
((member-lines-list (find-member-lines cell))
(utility-value 0))
(loop for x in member-lines-list
if (or (eql (count :X x) 2) (eql (count :O x) 2))
do (setf utility-value (+ utility-value 100))
if (and (eql (count :O x) 1) (eql (count :X x) 1))
do (setf utility-value (+ utility-value 0))
if (and (eql (count :O x) 1) (eql (count :X x) 0))
do (setf utility-value (+ utility-value 2))
if (and (eql (count :O x) 0) (eql (count :X x) 1))
do (setf utility-value (+ utility-value 1)))
utility-value))
;;;returns the lines on the board that cell is a member of
(defun find-member-lines (cell)
(let
((possible-line-list (list
'(1 2 3)
'(1 4 7)
'(1 5 9)
'(2 5 8)
'(3 6 9)
'(3 5 7)
'(4 5 6)
'(7 8 9))))
(loop for x in possible-line-list
if (contains cell x)
collect (board-line x))))
(defun contains (item sequence)
(if (member item sequence) T NIL))
;;;used for getting the actual moves in a line on the board from cell numbers
(defun board-line (line)
(list (board-ref (first line))
(board-ref (second line))
(board-ref (third line)))) | 6,249 | Common Lisp | .cl | 180 | 27.888889 | 113 | 0.548819 | renderedSafe/cl-tic-tac-toe | 1 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:28 AM (Europe/Amsterdam) | 305b4960efc900f03a5a2a825ccf420ac839a15850ec85fbc69543e4dc0c16a3 | 27,415 | [
-1
] |
27,432 | blog.lisp | tsmall_blog_lisp/blog.lisp | ;;; blog.lisp
;;;
;;; This is a simple blog I wrote in Common Lisp. It's friggin'
;;; awesome.
;;;
;;; Copyright (c) 2011 Tom Small
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(defpackage :blog
(:use :common-lisp :hunchentoot :cl-who :css-lite :split-sequence))
(in-package :blog)
;;;; Model
(defparameter *entries* '())
(defclass blog-entry ()
((slug :reader entry-slug
:initarg :slug)
(title :reader entry-title
:initarg :title)
(body :reader entry-body
:initarg :body)
(date-created :reader entry-date-created
:initform (get-universal-time)
:initarg :date-created)))
(defun entries ()
(sort (copy-list *entries*) #'> :key #'entry-date-created))
(defun entry-from-slug (slug)
(find slug (entries)
:test #'string-equal
:key #'entry-slug))
(defun slug-used? (slug)
(entry-from-slug slug))
(defun slug-from-url (url)
(nth 2 (split-sequence #\/ url)))
(defun entry-from-url (url)
(entry-from-slug (slug-from-url url)))
(defun add-entry (slug title body)
(unless (slug-used? slug)
(push (make-instance 'blog-entry :slug slug :title title :body body)
*entries*)))
(defun update-entry (entry slug title body)
(setf (slot-value entry 'slug) slug)
(setf (slot-value entry 'title) title)
(setf (slot-value entry 'body) body))
;;;; Persistence
(defmethod print-object ((entry blog-entry) stream)
(if *print-readably*
(with-slots (slug title body date-created)
entry
(format stream
(concatenate 'string
"#.(make-instance 'blog-entry "
":slug ~S :title ~S :date-created ~D "
":body ~S)")
slug title date-created body))
(call-next-method)))
(defun save-entries (entries pathname)
(with-open-file (stream pathname :direction :output :if-exists :supersede)
(with-standard-io-syntax
(let ((*print-readably* t)
(*package* (find-package :common-lisp)))
(print entries stream))))
pathname)
(defun load-entries (pathname)
(with-open-file (stream pathname :direction :input)
(with-standard-io-syntax
(let ((*package* (find-package :blog)))
(read stream)))))
;;;; Helpers
(defconstant day-names
'("Monday" "Tuesday" "Wednesday" "Thursday"
"Friday" "Saturday" "Sunday"))
(defconstant month-names
'("January" "February" "March" "April" "May" "June" "July"
"August" "September" "October" "November" "December"))
(defun humanize-date (universal-time)
(multiple-value-bind
(second minute hour date month year day-of-week dst-p tz)
(decode-universal-time universal-time)
(format nil "~a, ~a ~d, ~d"
(nth day-of-week day-names)
(nth (1- month) month-names)
date
year)))
(defun humanize-time (universal-time)
(multiple-value-bind
(second minute hour date month year day-of-week dst-p tz)
(decode-universal-time universal-time)
(format nil "~d:~2,'0d" hour minute)))
;;;; View
(defmacro standard-page ((&key title) &body body)
`(with-html-output-to-string (*standard-output* nil :prologue t)
(:html :xmlns "http://www.w3.org/1999/xhtml"
:xml\:lang "en"
:lang "en"
(:head
(:meta :http-equiv "Content-Type"
:content "text/html;charset=utf-8")
(:link :rel "stylesheet"
:href "/style")
(:link :rel "icon"
:href "/favicon"
:type "image/png")
(:title ,title))
(:body
(:h1
(:a :href "/index" "The Little Blogger"))
,@body))))
(defmacro make-handler ((name) &body body)
`(push (create-prefix-dispatcher
,(format nil "/~(~a~)" name)
(lambda () ,@body))
*dispatch-table*))
(defun entry-html (entry &key (link-header 't))
(with-html-output-to-string (*standard-output* nil)
(:h2
(if link-header
(htm
(:a :href (format nil "/entries/~a" (entry-slug entry))
(fmt (entry-title entry))))
(fmt (entry-title entry))))
(:h3 :class "entry-info"
(fmt (format nil "Posted on ~a at ~a"
(humanize-date (entry-date-created entry))
(humanize-time (entry-date-created entry)))))
(:div (fmt (entry-body entry)))))
(make-handler (index)
(standard-page (:title "The Little Blogger")
(:p (:a :href "/entry" "Write a New Entry"))
(:div :id "content"
(dolist (entry (entries))
(htm
(:div (fmt (entry-html entry))))))))
(make-handler (entries)
(let ((entry (entry-from-url (script-name *request*))))
(standard-page (:title (fmt (entry-title entry)))
(:div :id "content"
(fmt (entry-html entry :link-header nil)))
(:p (:a :href (concatenate 'string "/entry/" (entry-slug entry))
"Edit This Entry")))))
(make-handler (entry)
(let* ((url (script-name *request*))
(entry (entry-from-url url)))
(if (eq (request-method*) :GET)
(show-entry-form entry)
(create-or-update-entry (slug-from-url url)))))
(defun show-entry-form (entry)
(let* ((e (or entry (make-instance 'blog-entry :slug "" :title "" :body "")))
(post-url (concatenate 'string "/entry/" (entry-slug e)))
(page-title (if entry
(concatenate 'string "Edit Entry: " (entry-title entry))
"Write a New Entry")))
(standard-page (:title (str page-title))
(:div :id "content"
(:form :action post-url :method "post"
(:p (:label "Title" (:br)
(:input :type "text"
:name "title"
:value (entry-title e)
:autofocus t)))
(:p (:label "Slug" (:br)
(:input :type "text"
:name "slug"
:value (entry-slug e))))
(:p (:label "Body" (:br)
(:textarea :name "body"
(str (entry-body e)))))
(:p (:input :type "submit"
:value "Save")
" or "
(:a :href "/index" "Cancel")))))))
(defun create-or-update-entry (slug-or-nil)
(let ((title (parameter "title"))
(slug (parameter "slug"))
(body (parameter "body"))
(entry (entry-from-slug slug-or-nil)))
(if entry
(update-entry entry slug title body)
(add-entry slug title body))
(redirect "/index")))
(make-handler (style)
(setf (hunchentoot:content-type* hunchentoot:*reply*) "text/css")
(css-lite:css
(("h1, h2, h3, div, p, ol, ul, li")
(:margin 0 :padding 0))
(("body")
(:color "#222"
:font-family "\"DejaVu Sans\", sans-serif"
:font-size "1em"
:line-height "1.5em"
:padding "2em"))
(("a")
(:color "#2F51A9"
:text-decoration "none"))
(("a:hover")
(:text-decoration "underline"))
(("h1, h2")
(:font-weight "normal"))
(("h1")
(:margin-bottom "0.5em"))
(("h2")
(:margin-top "1em"
:margin-bottom "0.2em"))
(("h3")
(:color "#777"
:font-size "0.8em"))
(("ol, ul, p+p, li>p")
(:margin "1em 0"))
(("input, textarea")
(:font "inherit"))
(("input[type='text'], textarea")
(:border "1px solid #000"
:width "100%"))
(("textarea")
(:height "20em"))
(("#content")
(:width "40em"))))
(push (create-static-file-dispatcher-and-handler "/favicon" "favicon.png" "image/png")
*dispatch-table*)
;;;; Web Server
(defparameter *acceptor*
(make-instance 'hunchentoot:acceptor :port 8080))
;; (hunchentoot:start *acceptor*)
;; (hunchentoot:stop *acceptor*) | 8,766 | Common Lisp | .lisp | 234 | 28.858974 | 86 | 0.554483 | tsmall/blog.lisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:33:17 AM (Europe/Amsterdam) | 617dc93392fdd43da78a78954409282783600bb71c262d0b07d3d44dd1fc0699 | 27,432 | [
-1
] |
27,449 | math.lisp | davidlohr_euler-clisp/math.lisp | ;
; Copyright (C) 2012 Davidlohr Bueso <[email protected]>
;
; General purpose math functions - used throughout the problems.
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
(defun factorial (n)
(if (zerop n)
1
(* n (factorial (- n 1)))))
(defun fibonacci (n)
(if (<= n 2)
1
(+ (fibonacci (- n 2)) (fibonacci (- n 1)))))
(defun is-prime (n)
(if (< 2 n)
(do ((dividend 2 (1+ dividend))
(chk-to (sqrt n)))
((equal (rem n dividend) 0))
(when (<= chk-to dividend)
(return t)))
t)
)
| 1,196 | Common Lisp | .lisp | 35 | 31.685714 | 74 | 0.69171 | davidlohr/euler-clisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:24 AM (Europe/Amsterdam) | 7c408fa4007fdc4b35a8f2ea4cd49592138a92e646dda888632201f294a0856f | 27,449 | [
-1
] |
27,450 | problem20.lisp | davidlohr_euler-clisp/problem20.lisp | ;
; Copyright (C) 2012 Davidlohr Bueso <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
;
; URL: http://projecteuler.net/problem=20
; Description: n! means n * (n - 1) * ... * 3 * 2 * 1
; For example, 10! = 10 * 9 * ... * 3 * 2 * 1 = 3628800,
; and the sum of the digits in the number 10!
; is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.
;
; Problem: Find the sum of the digits in the number 100!
(require "math.lisp")
(defun problem-20 (max)
; a beautiful example of map/reduce usage.
(reduce '+ (map 'list (lambda (c) (or (digit-char-p c) '-))
(prin1-to-string (factorial max)))))
(print (problem-20 100)) | 1,334 | Common Lisp | .lisp | 31 | 41.612903 | 74 | 0.681015 | davidlohr/euler-clisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:24 AM (Europe/Amsterdam) | 7d5e1d6f2f092ac9a7a8bb5d70faf38d879e33b51e36c4d1ab2bf367853fd039 | 27,450 | [
-1
] |
27,451 | problem2.lisp | davidlohr_euler-clisp/problem2.lisp | ;
; Copyright (C) 2012 Davidlohr Bueso <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
;
; URL: http://projecteuler.net/problem=2
; Description: Each new term in the Fibonacci sequence is generated by
; adding the previous two terms.
; By starting with 1 and 2, the first 10 terms will be:
; 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
;
; Problem: By considering the terms in the Fibonacci sequence whose values
; do not exceed four million find the sum of the even-valued terms.
(require "math.lisp")
(defun problem-2 (max)
(setf a 0)
(setf sum 0)
(loop
(setf num (fibonacci (incf a)))
(if (evenp num)
(incf sum num))
(when (> num max) (return sum))))
(print (problem-2 4000000)) | 1,443 | Common Lisp | .lisp | 36 | 38.416667 | 76 | 0.704626 | davidlohr/euler-clisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:24 AM (Europe/Amsterdam) | 8d23f60683c661429afbc80f142e8cf0c70f4bcae6ca749707511f2592446f29 | 27,451 | [
-1
] |
27,452 | problem3.lisp | davidlohr_euler-clisp/problem3.lisp | ;
; Copyright (C) 2012 Davidlohr Bueso <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
;
; URL: http://projecteuler.net/problem=3
; Description: The prime factors of 13195 are 5, 7, 13 and 29.
; Problem: What is the largest prime factor of the number 600851475143 ?
(require "math.lisp")
(defun problem-3 (num)
(loop for i from (floor (sqrt num)) downto 1
do (when (zerop (mod num i))
; we can return after finding just the first prime
; factor as we start iterating in decreasing order.
(when (is-prime i) (return i)))))
(print (problem-3 600851475143)) | 1,265 | Common Lisp | .lisp | 29 | 41.827586 | 74 | 0.743922 | davidlohr/euler-clisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:24 AM (Europe/Amsterdam) | 901146554830726aa27298ab677e22e8e443e61fe14e22c3225dd38730936dc5 | 27,452 | [
-1
] |
27,453 | problem10.lisp | davidlohr_euler-clisp/problem10.lisp | ;
; Copyright (C) 2012 Davidlohr Bueso <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
;
; URL: http://projecteuler.net/problem=10
; Description: The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
;
; Problem: Find the sum of all the primes below two million.
(require "math.lisp")
; TODO - this is a slow O(n) naive version
; try with sieve of erasthones for a faster implementation!!
(defun problem-10 (num)
(setf sum 0)
(loop for i from 2 to num
do (when (is-prime i) (incf sum i)))
sum)
(print (problem-10 2000000)) | 1,220 | Common Lisp | .lisp | 31 | 38.064516 | 74 | 0.74305 | davidlohr/euler-clisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:24 AM (Europe/Amsterdam) | 3ec6a5093c44c79efcfbfc890342e38ba4354585365282b5808caf34864587fd | 27,453 | [
-1
] |
27,454 | problem6.lisp | davidlohr_euler-clisp/problem6.lisp | ;
; Copyright (C) 2012 Davidlohr Bueso <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
;
; URL: http://projecteuler.net/problem=6
; Description: The sum of the squares of the first ten natural numbers is,
; 1**2 + 2**2 +...+10**2 = 386
; The square of the sum of the first ten natural numbers is,
; (1 + 2 +...+ 10)**2 = 55**2 = 3025
; Hence the difference between the sum of the squares of the
; first ten natural numbers and the square of the sum is
; 3025 385 = 2640.
;
; Problem: Find the difference between the sum of the squares of the first
; one hundred natural numbers and the square of the sum.
(defun upto (max)
(let ((result nil))
(dotimes (i (+ max 1))
(push i result))
(nreverse result)))
(defun problem-6 (num)
"returns the difference of the sum of the squares of the first num
natural numbers and the square of the sum"
(setq sum1 0)
(loop for i from 1 to num
do (incf sum1 (expt i 2)))
(setq sum2 (reduce '+ (upto num)))
(- (expt sum2 2) sum1))
(print (problem-6 100)) | 1,792 | Common Lisp | .lisp | 43 | 39.953488 | 74 | 0.686892 | davidlohr/euler-clisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:24 AM (Europe/Amsterdam) | cb9f98ad5ecd58b890e8045a39a53d8648225932044eada247ba48194bc18d13 | 27,454 | [
-1
] |
27,455 | problem13.lisp | davidlohr_euler-clisp/problem13.lisp | ;
; Copyright (C) 2012 Davidlohr Bueso <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
;
; URL: http://projecteuler.net/problem=13
; Description: none.
;
; Problem: Work out the first ten digits of the sum of the following
; one-hundred 50-digit numbers.
; 37107287533902102798797998220837590246510135740250
; 46376937677490009712648124896970078050417018260538
; 74324986199524741059474233309513058123726617309629
; .... the entire numbers are seen below in the code.
(defun problem-13 (p n)
" return first p digits of a usually long ass number n"
(if (< n p)
0)
(if (= n p)
n)
; TODO: find a way around converting to string and back to number
(parse-integer (subseq (write-to-string n) 0 p)))
(print (problem-13 10 (+ 37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
89261670696623633820136378418383684178734361726757
28112879812849979408065481931592621691275889832738
44274228917432520321923589422876796487670272189318
47451445736001306439091167216856844588711603153276
70386486105843025439939619828917593665686757934951
62176457141856560629502157223196586755079324193331
64906352462741904929101432445813822663347944758178
92575867718337217661963751590579239728245598838407
58203565325359399008402633568948830189458628227828
80181199384826282014278194139940567587151170094390
35398664372827112653829987240784473053190104293586
86515506006295864861532075273371959191420517255829
71693888707715466499115593487603532921714970056938
54370070576826684624621495650076471787294438377604
53282654108756828443191190634694037855217779295145
36123272525000296071075082563815656710885258350721
45876576172410976447339110607218265236877223636045
17423706905851860660448207621209813287860733969412
81142660418086830619328460811191061556940512689692
51934325451728388641918047049293215058642563049483
62467221648435076201727918039944693004732956340691
15732444386908125794514089057706229429197107928209
55037687525678773091862540744969844508330393682126
18336384825330154686196124348767681297534375946515
80386287592878490201521685554828717201219257766954
78182833757993103614740356856449095527097864797581
16726320100436897842553539920931837441497806860984
48403098129077791799088218795327364475675590848030
87086987551392711854517078544161852424320693150332
59959406895756536782107074926966537676326235447210
69793950679652694742597709739166693763042633987085
41052684708299085211399427365734116182760315001271
65378607361501080857009149939512557028198746004375
35829035317434717326932123578154982629742552737307
94953759765105305946966067683156574377167401875275
88902802571733229619176668713819931811048770190271
25267680276078003013678680992525463401061632866526
36270218540497705585629946580636237993140746255962
24074486908231174977792365466257246923322810917141
91430288197103288597806669760892938638285025333403
34413065578016127815921815005561868836468420090470
23053081172816430487623791969842487255036638784583
11487696932154902810424020138335124462181441773470
63783299490636259666498587618221225225512486764533
67720186971698544312419572409913959008952310058822
95548255300263520781532296796249481641953868218774
76085327132285723110424803456124867697064507995236
37774242535411291684276865538926205024910326572967
23701913275725675285653248258265463092207058596522
29798860272258331913126375147341994889534765745501
18495701454879288984856827726077713721403798879715
38298203783031473527721580348144513491373226651381
34829543829199918180278916522431027392251122869539
40957953066405232632538044100059654939159879593635
29746152185502371307642255121183693803580388584903
41698116222072977186158236678424689157993532961922
62467957194401269043877107275048102390895523597457
23189706772547915061505504953922979530901129967519
86188088225875314529584099251203829009407770775672
11306739708304724483816533873502340845647058077308
82959174767140363198008187129011875491310547126581
97623331044818386269515456334926366572897563400500
42846280183517070527831839425882145521227251250327
55121603546981200581762165212827652751691296897789
32238195734329339946437501907836945765883352399886
75506164965184775180738168837861091527357929701337
62177842752192623401942399639168044983993173312731
32924185707147349566916674687634660915035914677504
99518671430235219628894890102423325116913619626622
73267460800591547471830798392868535206946944540724
76841822524674417161514036427982273348055556214818
97142617910342598647204516893989422179826088076852
87783646182799346313767754307809363333018982642090
10848802521674670883215120185883543223812876952786
71329612474782464538636993009049310363619763878039
62184073572399794223406235393808339651327408011116
66627891981488087797941876876144230030984490851411
60661826293682836764744779239180335110989069790714
85786944089552990653640447425576083659976645795096
66024396409905389607120198219976047599490197230297
64913982680032973156037120041377903785566085089252
16730939319872750275468906903707539413042652315011
94809377245048795150954100921645863754710598436791
78639167021187492431995700641917969777599028300699
15368713711936614952811305876380278410754449733078
40789923115535562561142322423255033685442488917353
44889911501440648020369068063960672322193204149535
41503128880339536053299340368006977710650566631954
81234880673210146739058568557934581403627822703280
82616570773948327592232845941706525094512325230608
22918802058777319719839450180888072429661980811197
77158542502016545090413245809786882778948721859617
72107838435069186155435662884062257473692284509516
20849603980134001723930671666823555245252804609722
53503534226472524250874054075591789781264330331690)))
| 6,976 | Common Lisp | .lisp | 135 | 47.548148 | 75 | 0.886354 | davidlohr/euler-clisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:24 AM (Europe/Amsterdam) | c7ca01303c74d79865475b0c172aa7e199bdd18c0409c7da757e8fd4ef0a72db | 27,455 | [
-1
] |
27,456 | problem16.lisp | davidlohr_euler-clisp/problem16.lisp | ;
; Copyright (C) 2012 Davidlohr Bueso <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
;
; URL: http://projecteuler.net/problem=16
; Description: 2**15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
;
; Problem: What is the sum of the digits of the number 2**1000
(defun problem-16 (base power)
(reduce '+ (map 'list (lambda (c) (or (digit-char-p c) '-))
(prin1-to-string (expt base power)))))
(print (problem-16 2 1000)) | 1,133 | Common Lisp | .lisp | 26 | 42.192308 | 81 | 0.729656 | davidlohr/euler-clisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:24 AM (Europe/Amsterdam) | 4a01753175cd49475e11924a435dc504af35cad7c407f17d3142b7a88459d3ac | 27,456 | [
-1
] |
27,457 | problem7.lisp | davidlohr_euler-clisp/problem7.lisp | ;
; Copyright (C) 2012 Davidlohr Bueso <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
;
; URL: http://projecteuler.net/problem=7
; Description: By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13,
; we can see that the 6th prime is 13.
;
; Problem: What is the 10001st prime number?
(require "math.lisp")
(defun problem-7 (num)
(if (<= num 1)
2) ; always return 2, being the first prime
(setf n 0)
(setf i 3)
(loop
(if (is-prime i)
(when (= (- num 1) (incf n)) (return i)))
(incf i)))
(print (problem-7 10001)) | 1,254 | Common Lisp | .lisp | 34 | 34.970588 | 78 | 0.70936 | davidlohr/euler-clisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:24 AM (Europe/Amsterdam) | 6f45332d74055c97b26e5fe01f8600e18454312e90487820fa1f00a763e8dde4 | 27,457 | [
-1
] |
27,458 | problem48.lisp | davidlohr_euler-clisp/problem48.lisp | ;
; Copyright (C) 2012 Davidlohr Bueso <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
;
; URL: http://projecteuler.net/problem=48
; Description: The series, 1**1 + 2**2 + 3**3 + ... + 10**10 = 10405071317
;
; Problem: Find the last ten digits of the series, 1**1 + 2**2 + 3**3 +
; ... + 1000**1000.
(defun problem-48 (num)
(setq res 0)
(loop for i from 1 to num
do (incf res (expt i i)))
(setf str (write-to-string res))
(parse-integer (subseq str (- (length str) 10))))
(print (problem-48 1000)) | 1,206 | Common Lisp | .lisp | 30 | 38.833333 | 74 | 0.712095 | davidlohr/euler-clisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:24 AM (Europe/Amsterdam) | 7e8f10a39fd461db9bb2522c1f9ea87133670578877357d597700919ca4476f6 | 27,458 | [
-1
] |
27,459 | problem1.lisp | davidlohr_euler-clisp/problem1.lisp | ;
; Copyright (C) 2012 Davidlohr Bueso <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
;
; URL: http://projecteuler.net/problem=1
; Description: If we list all the natural numbers below 10 that are multiples
; of 3 or 5, we get 3, 5, 6 and 9.The sum of these multiples is 23.
;
; Problem: Find the sum of all the multiples of 3 or 5 below 1000.
(defun problem-1 (n m)
(setf sum 0)
(loop for i from n to (- m 1)
do (when (or (= 0 (mod i 3))
(= 0 (mod i 5)))
(incf sum i)))
sum)
(print (problem-1 1 1000))
| 1,226 | Common Lisp | .lisp | 31 | 37.83871 | 80 | 0.716681 | davidlohr/euler-clisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:24 AM (Europe/Amsterdam) | 38053defc63b9a6c7f779733dbc17a90fd89edd1eff9545a126d22169f634295 | 27,459 | [
-1
] |
27,486 | package.lisp | aivijay_cl-ibe/package.lisp | ;;;; package.lisp
(defpackage #:cl-ibe
(:use #:cl)
(:export #:get-cipher #:encrypt #:decrypt))
| 101 | Common Lisp | .lisp | 4 | 22.75 | 45 | 0.631579 | aivijay/cl-ibe | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:40 AM (Europe/Amsterdam) | 02e47028688856c40a73010f63b1963111a14d95cfa2059a3c58b32f938ab46a | 27,486 | [
-1
] |
27,487 | cl-ibe.lisp | aivijay_cl-ibe/cl-ibe.lisp | ;;;; cl-ibe.lisp
(in-package #:cl-ibe)
;;; "cl-ibe" main codebase
(defun get-cipher (key) (ironclad:make-cipher :blowfish :mode :ecb :key (ironclad:ascii-string-to-byte-array key)))
(defun encrypt (plaintext key)
(let ((cipher (get-cipher key))
(msg (ironclad:ascii-string-to-byte-array plaintext)))
(ironclad:encrypt-in-place cipher msg)
(ironclad:octets-to-integer msg)))
(defun decrypt (ciphertext-int key)
(let ((cipher (get-cipher key))
(msg (ironclad:integer-to-octets ciphertext-int)))
(ironclad:decrypt-in-place cipher msg)
(coerce (mapcar #'code-char (coerce msg 'list)) 'string)))
| 618 | Common Lisp | .lisp | 14 | 41.214286 | 115 | 0.714524 | aivijay/cl-ibe | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:40 AM (Europe/Amsterdam) | e34c7e0a050f919bbe469574819533137fae229d87d360c4aa899e33dc729ba8 | 27,487 | [
-1
] |
27,488 | cl-ibe.asd | aivijay_cl-ibe/cl-ibe.asd | ;;;; cl-ibe.asd
(defclass cl-ibe-source-file (cl-source-file) ())
(defclass txt-file (doc-file) ())
(defclass css-file (doc-file) ())
(defmethod source-file-type ((c txt-file) (s module)) "txt")
(defmethod source-file-type ((c css-file) (s module)) "css")
(asdf:defsystem #:cl-ibe
:version "0.01"
:author "Vijay <[email protected]>"
:maintainer "Vijay <[email protected]>"
:description "Identity Based Encryption implementation in pure Common Lisp"
:serial t
:depends-on (#:ironclad)
:components ((:file "package")
(:file "cl-ibe")))
| 567 | Common Lisp | .asd | 15 | 34.6 | 77 | 0.677007 | aivijay/cl-ibe | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:40 AM (Europe/Amsterdam) | 6d0e3a52e16767435cd6ff6d984bfca8960e58d81421c27670abb56b8177e72f | 27,488 | [
-1
] |
27,507 | microblog.lisp | tsmall_microblog-lisp/microblog.lisp | ;;; microblog.lisp
;;;
;;; This is a simple microblog I wrote in Common Lisp. I found that
;;; keeping short status updates were a great way for me to keep a
;;; journal after originally writing this application in Seaside in
;;; Pharo. Unfortunately, that program seemed to take up a lot of
;;; resources on my laptop, and I've come to really appreciate lisp,
;;; so here we are.
;;;
;;; Copyright (c) 2011 Tom Small
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;;
;;;; Instructions
;;;
;;; To run this, do the following:
;;;
;;; 1) Start Slime in Emacs
;;; 2) Eval (ql:quickload '(:hunchentoot :cl-who :css-lite :split-sequence))
;;; 3) Compile and load this file (C-c C-k)
;;; 4) Eval (microblog:init)
(defpackage :microblog
(:use :common-lisp :hunchentoot :cl-who :css-lite :split-sequence))
(in-package :microblog)
;;;; Model
(defparameter *statuses* '())
(defparameter *statuses-file-path* "~/Dropbox/statuses")
(defclass status ()
((message :reader status-message
:initarg :message)
(date-created :reader status-date-created
:initform (get-universal-time)
:initarg :date-created)))
(defun statuses ()
(sort (copy-list *statuses*) #'> :key #'status-date-created))
(defun add-status (message)
(push (make-instance 'status :message message)
*statuses*))
;;;; Persistence
(defmethod print-object ((stat status) stream)
(if *print-readably*
(with-slots (message date-created)
stat
(format stream
(concatenate 'string
"#.(make-instance 'status "
":message ~S :date-created ~D)")
message date-created))
(call-next-method)))
(defun save-statuses (statuses pathname)
(with-open-file (stream pathname :direction :output :if-exists :supersede)
(with-standard-io-syntax
(let ((*print-readably* t)
(*package* (find-package :common-lisp)))
(print statuses stream))))
pathname)
(defun load-statuses (pathname)
(with-open-file (stream pathname :direction :input)
(with-standard-io-syntax
(let ((*package* (find-package :microblog)))
(read stream)))))
;;;; Helpers
(defconstant day-names
'("Monday" "Tuesday" "Wednesday" "Thursday"
"Friday" "Saturday" "Sunday"))
(defconstant month-names
'("January" "February" "March" "April" "May" "June" "July"
"August" "September" "October" "November" "December"))
(defconstant month-short-names
(map 'list
(lambda (month) (subseq month 0 3))
month-names))
(defun humanize-date (universal-time)
(multiple-value-bind
(second minute hour date month year day-of-week dst-p tz)
(decode-universal-time universal-time)
(format nil "~a ~d ~d"
(nth (1- month) month-short-names)
date
year)))
(defun humanize-time (universal-time)
(multiple-value-bind
(second minute hour date month year day-of-week dst-p tz)
(decode-universal-time universal-time)
(format nil "~d:~2,'0d" hour minute)))
;;;; View
(defmacro standard-page ((&key title) &body body)
`(with-html-output-to-string (*standard-output* nil :prologue t)
(:html :xmlns "http://www.w3.org/1999/xhtml"
:xml\:lang "en"
:lang "en"
(:head
(:meta :http-equiv "Content-Type"
:content "text/html;charset=utf-8")
(:link :rel "stylesheet"
:href "/style")
(:link :rel "icon"
:href "/favicon"
:type "image/png")
(:title ,title))
(:body
(:h1 "The Lisp Microblog")
,@body))))
(defmacro make-handler ((name) &body body)
`(push (create-prefix-dispatcher
,(format nil "/~(~a~)" name)
(lambda () ,@body))
*dispatch-table*))
(make-handler (index)
(standard-page (:title "The Lisp Microblog")
(:div :id "body"
(:form :action "/status" :method "post"
(:p (:label "What are you doing?" (:br)
(:textarea :id "message"
:name "message"
:autofocus t)))
(:p (:input :type "submit"
:value "Log It")))
(:h2 "What have you done recently?")
(:table
(dolist (status (statuses))
(htm
(:tr
(:th
(fmt (humanize-date (status-date-created status))) (:br)
(fmt (humanize-time (status-date-created status))))
(:td (fmt (status-message status))))))))))
(make-handler (status)
(let ((message (parameter "message")))
(add-status message)
(save-statuses *statuses* *statuses-file-path*)
(redirect "/index")))
(make-handler (style)
(setf (hunchentoot:content-type* hunchentoot:*reply*) "text/css")
(css-lite:css
(("body")
(:background-color "#ddd"
:font-family "\"Helvetica Neue\", \"Helvetica\", \"Arial\", sans-serif"
:font-size "12pt"
:line-height "16pt"
:width "75%"
:margin-left "auto"
:margin-right "auto"
:padding "1em 0"))
(("h1")
(:margin "0 0 1em 0"))
(("h2")
(:font-size "1em"
:font-weight "normal"
:border-bottom "1px solid #000"))
(("table")
(:width "100%"))
(("th")
(:color "#777"
:font-size "0.75em"
:font-weight "normal"
:line-height "1.2em"
:text-align "left"
:text-transform "uppercase"
:padding-right "1em"
:padding-top "0.4em"
:vertical-align "top"
:width "13%"))
(("td")
(:padding-bottom "1em"))
(("input[type=\"submit\"]")
(:font "inherit"))
(("textarea")
(:font "inherit"
:height "4em"
:width "100%"))
(("#body")
(:background-color "#fff"
:padding "1em 2em"))))
(push (create-static-file-dispatcher-and-handler "/favicon" "favicon.png" "image/png")
*dispatch-table*)
;;;; Web Server
(defparameter *microblog-acceptor*
(make-instance 'hunchentoot:easy-acceptor :port 9001))
;;;; Public interface
(defun init ()
"Start the microblog."
(setf *statuses* (load-statuses *statuses-file-path*))
(hunchentoot:start *microblog-acceptor*))
(export 'init) | 7,006 | Common Lisp | .lisp | 196 | 28.780612 | 86 | 0.5954 | tsmall/microblog-lisp | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:34:53 AM (Europe/Amsterdam) | 20ad2c0192313f8042e4e211718a0bfa0337be703e226bbd6a32c2d1300199f1 | 27,507 | [
-1
] |
27,524 | package.lisp | jollheef_tick/package.lisp | ;;;; This file is part of the tick application, released under
;;;; GNU General Public License, Version 3.0
;;;; See file COPYING for details.
;;;;
;;;; Author: Klementyev Mikhail <[email protected]>
(defpackage #:tick
(:use #:cl
#:date-calc)
(:export #:with-tick
#:tick
#:ltick))
| 297 | Common Lisp | .lisp | 11 | 24.727273 | 62 | 0.677193 | jollheef/tick | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:35:17 AM (Europe/Amsterdam) | cbd91c5a1bd9954da3575372e144af78675da83bc8e180c8bde5d083fcf64b4c | 27,524 | [
-1
] |
27,525 | tick.lisp | jollheef_tick/tick.lisp | ;;;; This file is part of the tick application, released under
;;;; GNU General Public License, Version 3.0
;;;; See file COPYING for details.
;;;;
;;;; Author: Klementyev Mikhail <[email protected]>
(in-package #:tick)
(defun tick-s (lstart-time)
(let ((lcurrent-time (multiple-value-list (date-calc:localtime))))
(let ((hs (nth 3 lstart-time))
(ms (nth 4 lstart-time))
(ss (nth 5 lstart-time))
(hc (nth 3 lcurrent-time))
(mc (nth 4 lcurrent-time))
(sc (nth 5 lcurrent-time)))
(date-calc:delta-hms hs ms ss hc mc sc))))
(defmacro ltick ()
`(cdr (multiple-value-list (tick-s lstart-time))))
(defmacro tick ()
`(let ((l-of-tick
(cdr (multiple-value-list (tick-s lstart-time)))))
(format nil "~2,'0D:~2,'0D:~2,'0D"
(nth 0 l-of-tick)
(nth 1 l-of-tick)
(nth 2 l-of-tick))))
(defmacro with-tick (&body body)
`(let ((lstart-time (multiple-value-list (date-calc:localtime))))
,@body))
(defun timer-tick ()
(with-tick
(tick)))
| 996 | Common Lisp | .lisp | 30 | 29.7 | 68 | 0.640625 | jollheef/tick | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:35:17 AM (Europe/Amsterdam) | e228f476f49282a07de4d14558452ff4086e1d44d0640e7f516d7f33a7827625 | 27,525 | [
-1
] |
27,526 | tick.asd | jollheef_tick/tick.asd | ;;;; This file is part of the tick application, released under
;;;; GNU General Public License, Version 3.0
;;;; See file COPYING for details.
;;;;
;;;; Author: Klementyev Mikhail <[email protected]>
(asdf:defsystem #:tick
:description "Simple time tick"
:author "Mikhail Klementyev <[email protected]>"
:license "GPLv3"
:depends-on (#:date-calc)
:components ((:static-file "COPYING")
(:static-file "README")
(:file "package")
(:file "tick")))
| 483 | Common Lisp | .asd | 14 | 31 | 62 | 0.675214 | jollheef/tick | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:35:17 AM (Europe/Amsterdam) | 8339d3da68098bfd45ea5b85d28dafc29c3de2b819887e3a087ff76bdac91a54 | 27,526 | [
-1
] |
27,544 | the-lisp-life.lisp | RobotDisco_the-lisp-life/the-lisp-life.lisp | ;;;; the-lisp-life.lisp
(in-package #:the-lisp-life)
;;; "the-lisp-life" goes here. Hacks and glory await!
(defun alivep (cell)
(eql cell :alive))
(defun princ-cell (cell)
(princ (cond ((alivep cell) "*")
(t "."))))
(defun princ-world (world)
(loop for i below (array-dimension world 0)
do (progn
(loop for j below (array-dimension world 1) do
(princ-cell (aref world i j)))
(terpri))))
(defun neighbours (world row col)
(let ((rows (array-dimension world 0))
(cols (array-dimension world 1))
(nrows (list (1- row) row (1+ row)))
(ncols (list (1- col) col (1+ col))))
(loop for r in nrows nconc
(loop for c in ncols collect
(aref world (mod r rows) (mod c cols))))))
(defun tick-cell (world row col)
(let ((cell (aref world row col))
(live-adj (list-length (remove-if-not #'alivep
(neighbours world row col)))))
(if (alivep cell)
(cond ((or (= live-adj 2) (= live-adj 3)) :alive)
(t :dead)) ; Death by under/over-population
(cond ((= live-adj 3) :alive) ; Birth by reproduction
(t :dead)))))
(defun tick (world)
(let ((nworld (make-array (array-dimensions world)))
(rows (array-dimension world 0))
(cols (array-dimension world 1)))
(progn
(loop for r below rows do
(loop for c below cols do
(setf (aref nworld r c) (tick-cell world r c))))
nworld)))
(defun tick-thunk (world)
(labels ((thunk-gen (world)
(cons world (lambda () (thunk-gen (tick world))))))
(thunk-gen world)))
| 1,508 | Common Lisp | .lisp | 44 | 30.295455 | 57 | 0.629808 | RobotDisco/the-lisp-life | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:35:33 AM (Europe/Amsterdam) | b8f8f004d9e1c83c8189dbe730ca86c5e212bcc2ae8ae5730348b6d0f0a2927f | 27,544 | [
-1
] |
27,545 | the-lisp-life.asd | RobotDisco_the-lisp-life/the-lisp-life.asd | ;;;; the-lisp-life.asd
(asdf:defsystem #:the-lisp-life
:serial t
:description "Describe the-lisp-life here"
:author "Gaelan D'costa"
:license "GPLv3"
:components ((:file "package")
(:file "the-lisp-life")))
| 234 | Common Lisp | .lisp | 8 | 24.875 | 44 | 0.647321 | RobotDisco/the-lisp-life | 0 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:35:33 AM (Europe/Amsterdam) | 8c44d602d6ba913d656dbe4fa7e735ec619840a1216238fd08bb6a25dffc33b6 | 27,545 | [
-1
] |
27,564 | washi.lisp | codepony_washi_lisp/washi.lisp | #| washi.lisp - A simple waschi cl-i-ent written in CommonLisp (SBCL) - version current-git
Copyright (C) 2013 @d3f <http://identi.ca/d3f>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
|#
; Load the DRAKMA-webclient:
(ql:quickload :drakma)
; Load a html de/encoder for @Revengedays random-word API
(ql:quickload :html-entities)
; If you get an error here like: `"Unable to load any of the alternatives:~%~S"("libssl.so.1.0.0" "libssl.so.0.9.8"
; "libssl.so" "libssl.so.4")' or`The loaded code expects an incompatible layout for class SB-PRETTY:PRETTY-STREAM.'
; you can just accept those 2
(defun replace-all (string part replacement &key (test #'char=))
"(replace-all) function for the lists
Stolen from: http://cl-cookbook.sourceforge.net/strings.html"
(with-output-to-string (out)
(loop with part-length = (length part)
for old-pos = 0 then (+ pos part-length)
for pos = (search part string
:start2 old-pos
:test test)
do (write-string string out
:start old-pos
:end (or pos (length string)))
when pos do (write-string replacement out)
while pos)))
(defun split-by-newline (string)
"Also a (split-by-newline) function would be great:
Stolen from: http://cl-cookbook.sourceforge.net/strings.html"
(loop for i = 0 then (1+ j)
as j = (position #\Newline string :start i)
collect (subseq string i j)
while j))
; Define system parameters:
(defparameter *username* "Hugo")
(defparameter *password* "mycock")
; You can change these here
; fetching the serverlist:
(defparameter *server-list-url* "http://waschi.org/servers.php")
; stored as variable to produce less traffic:
(defparameter *server-list* (list))
; Save obj-lists - use some ram:
(defparameter *all-obj-list* (list))
; It hurts to use a global variable for that:
(defparameter *isupdated* nil)
(defun get-server-list ()
"Returns a list of all washi servers in the network"
(setf *server-list* (mapcar #'symbol-name
; remove empty list parts, to fix bugs (and improve logic):
(remove '|| (mapcar #'intern
(split-by-newline
(replace-all
(drakma:http-request *server-list-url*)
"receive.php" "found")))))))
(defun get-obj-list (found-site)
"Parses a found-site and returns a list oft the site encoded in utf-8"
(let ((working (ignore-errors (drakma:http-request found-site))))
; Some servers give a #\Return #\Newline back:
(let ((working-list (concatenate 'list working)))
; sometimes you get a code-file and sometimes chars (fuck webservers)
(if (not (characterp (car working-list)))
(ignore-errors (setf working-list (flexi-streams:octets-to-string working :external-format :utf-8)))
(ignore-errors (setf working-list (flexi-streams:octets-to-string
(flexi-streams:string-to-octets working) :external-format :utf-8))))
; producing a list we can work with (chars instead of code) - Now with working utf-8
(remove '|| (mapcar #'intern
(split-by-newline (concatenate 'string (remove #\Return (concatenate 'list working-list)))))))))
; the (intern) functions changes the "strings" to '|Symbols| - easier to compare for me.
(defun save-obj-list ()
"Creates a list of pairs of sites with their objects"
(setf *all-obj-list* (list))
(loop for i from 0 to (1- (length *server-list*)) do
(push (cons (nth i *server-list*) (cons (get-obj-list (nth i *server-list*)) nil)) *all-obj-list*))
*all-obj-list*)
(defun search-ui ()
"A simple user interaction for the searching"
(format t "What are you looking for?~%")
(let ((str (read-line)))
(cond ((equal str "back") (startup))
((equal str "quit") (exit))
(t (search-my-clothing (intern str))))))
(defun clean-ui ()
"A simple user interaction for the cleaning"
(format t "What do you want to clean?~%")
(let ((str (read-line)))
(format t "~%")
(cond ((equal str "back") (startup))
((equal str "random") (send-random-word))
((equal str "quit") (exit))
(t (clean-my-clothing (string str) 0 )))))
(defun startup ()
"Initialize the interface and give a simple overview"
(format t "Do you want to '(s)earch' or '(c)lean' or change (u)sername and password or 'take-all' or (quit) something?~%")
(let ((str (read-line)))
(cond ((or (equal str "search") (equal str "s")) (search-ui))
((or (equal str "clean") (equal str "c")) (clean-ui))
((equal str "u") (change-username))
((equal str "take-all") (take-all))
((equal str "quit") (exit))
((equal str "score") (highscore))
(t (startup)))))
(defun succsess (obj found-server-list)
"Function used when an object was found"
(format t "Your ~a was found by me. ~a~%" obj found-server-list)
(setf *isupdated* nil)
(search-ui))
(defun failed (obj)
"Function used when an object was not found"
(format t "Your ~a was not found by me.~%" obj)
(setf *isupdated* nil)
(search-ui))
(defun search-my-clothing (obj)
"This will lookup your object on the servers, and re-fetches the list if it's not found on the first time."
(let ((obj-server-list (list)))
; -1 we start counting from 0, but length is human-like:
(loop for i from 0 to (- (length *server-list*) 1)
do
(let ((obj-list (cadr (nth i *all-obj-list*))) (obj-server (car (nth i *all-obj-list*))))
(when (find obj obj-list)
(format t "~a ~%" (drakma:http-request (replace-all obj-server "found" "echowash.php")
:method :post
:parameters (list (cons "Kleidung" (symbol-name obj))
(cons "Username" *username*)
(cons "Password" *password*)
(cons "TakeAway" "True"))))
(push (replace-all obj-server "found" "") obj-server-list))))
(if obj-server-list
(succsess obj obj-server-list)))
(if *isupdated*
(failed obj)
(progn
(format t "Reloading Obj-list from all servers...~%")
(get-server-list)
(save-obj-list)
(setf *isupdated* t)
; recursive call:
(search-my-clothing obj))))
(defun clean-my-clothing (obj callcount)
"Sends your laundry to a random server"
(if (eq *server-list* NIL)
(progn
(format t "No serverlist found!~%")
(get-server-list)
(search-ui)))
(let ((obj-send (flexi-streams:octets-to-string
(flexi-streams:string-to-octets obj :external-format :utf-8)))
(server-send (replace-all (nth (random (length *server-list*)) *server-list*) "found" "echowash.php")))
(let ((resp (drakma:http-request server-send
:method :post
:parameters (list (cons "Kleidung" obj-send)
(cons "Username" *username*)
(cons "Password" *password*)))))
(format t "Your ~a has been sent to ~a~%" obj (replace-all server-send "echowash.php" ""))
(if resp
; See what the response was like - changed to 4, because reply looks fucked up atm.:
(case (char resp 4)
(#\H (format t "Your laundry (~a) was done, and is now clean~%" obj))
(#\D (format t "Oh fuck, they lost your ~a~%" obj))
(otherwise (format t "They can't clean that ~%")))
(progn
(format t "Oh well, they don't like you. Trying another server...~%")
(if (> callcount (length *server-list*))
(progn
(format t "To many retries~%")
(clean-ui))
(progn
(clean-my-clothing obj (+ 1 callcount))))))))
(clean-ui))
(defun send-random-word ()
"Creates a random word, using the API of @Revengeday"
(clean-my-clothing (html-entities:decode-entities
(drakma:http-request "http://dev.revengeday.de/pointlesswords/api/")) 0))
(defun take-all ()
"Tries your username and password for any object"
(get-server-list)
(save-obj-list)
(mapcar #'(lambda (x) (fetch-my-clothing x))
(apply #'append (mapcar #'(lambda (x) (car (cdr x))) *all-obj-list*)))
(startup))
(defun fetch-my-clothing (obj)
"Just a simple search-my-clothing function for (take-all)"
(loop for i from 0 to (- (length *server-list*) 1)
do
(let ((obj-list (cadr (nth i *all-obj-list*))) (obj-server (car (nth i *all-obj-list*))))
(when (find obj obj-list)
(format t "~a ~%" (drakma:http-request (replace-all obj-server "found" "echowash.php")
:method :post
:parameters (list (cons "Kleidung" (symbol-name obj))
(cons "Username" *username*)
(cons "Password" *password*)
(cons "TakeAway" "True"))))))))
(defun change-username ()
"Simple lets you reset the username and password for the current run"
(format t "What username do you want to choose?~%")
(setf *username* (read-line))
(format t "And your password?~%")
(setf *password* (read-line))
(startup))
(defun highscore ()
"fetches the current highscore from http://waschi.org/highscore.php"
(format t "~a ~%" (drakma:http-request "http://waschi.org/highscore.php"
:method :post
:parameters (list (cons "action" "list"))))
(startup))
(defun first-init ()
"Initial function, gives some instructions and a small how to."
(format t "~%~%~T~TWelcome to washi.lisp a full cl-i-ent (commonlisp-commandlineinterface-client) for @MeikosDis' Waschi~%~%")
(format t "~T~TAt first the basics (for people too lazy reading the source-code):~%")
(format t "~T~T~T> You can choose with the input of `search' `clean' and `quit' what you want to do~%")
(format t "~T~T~T> Typing `score' will post the current highscore~%")
(format t "~T~T~T> When you are in a mode you can go `back' to choose again (quit always works)~%")
(format t "~T~T~T> In cleaning-mode you can wash a random item by typing `random'~%")
(format t "~T~T~T> The laundry will be sent to a random waschi-server.~%")
(format t "~% [@][@] /¯¯¯¯¯/| _\\| _|<<<<|_ I'm your washi client.")
(format t "~% / \\/ \\ |¯¯¯¯¯|@| \\ | * * | I will wash your socks")
(format t "~% [@][@][@] | WSH |#| \\| < | better, and with love!")
(format t "~% \\ /\\ / \\~a~a~a|_____|/ |__~a~a__| Trust me, because I am" "~" "~" "~" "~" "~")
(format t "~% [@][@] _||_ written in CommonLisp!~%")
(format t "~%~T~TThis program comes with ABSOLUTELY NO WARRANTY; As This is free software~%")
(format t "~T~Tyou are welcome to redistribute it under certain conditions; (AGPLv3+)")
(format t "~T~T~%~%")
(format t "~T~TThe sourcecode can be found at github <https://github.com/codepony/washi.lisp>~%")
(format t "~T~TInformation about Waschi in general can be found at <http://waschi.meikodis.org>~%~%~%")
(format t "Loading server-list (may take some time) ...~%~%")
(get-server-list)
(save-obj-list)
(startup))
; start on load:
(first-init)
| 12,500 | Common Lisp | .lisp | 237 | 43.139241 | 128 | 0.588925 | codepony/washi.lisp | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | de21929e73c621ea3f679affc25670ba3804ce299c81abd4af16e9e7f2fd68d0 | 27,564 | [
-1
] |
27,581 | ajr36-lispcw.lisp | alexr1993_symbolic-algebra-implementation/ajr36-lispcw.lisp | ;;;;
;;;; ajr36 - Alex Remedios
;;;;
;;;; CM20214/221
;;;; Advanced Programming Principles/Programming II Assessed Coursework
;;;; Assignment 1 - Using Common Lisp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; MY REPRESENTATION ;;
;; ;;
;; Single term = (coefficient ((var1 power1)(var2 power2) ...(varn powern))) ;;
;; ;;
;; Polynomial = (term1 term2 ...termn) ;;
;; ;;
;; Terms containing constants will express the constants as coefficients of ;;
;; ("x" 0) (or possible use a different symbol depending on the input) ;;
;; ;;
;; Valid input is anything using the structure above, with coefficients and ;;
;; powers being numbers, and vars being strings ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; NOTE: Througout the documentation I refer to variable-power pairs e.g.
;;; ("x" 2) as 'variable's. I refer to the actual 'variable' as the
;;; 'symbol'.
;;;
;;; NOTE 2: p+, p- and p* are designed to accept well formed i.e. already
;;; simplified polynomials, if you put in polynomials which are not
;;; simplified they will still undergo the operations you desire, however
;;; the chances are they will come out still partially unsimplified.
;;;
;;; NOTE 3: format-polynomial will simplify a polynomial, I am not sure if
;;; this was required, however I made it because I thought p= should be
;;; able to except unsimplified polynomials.
;;;
;;; NOTE 4: A lot of my test cases use terribly formed polynomials, this is
;;; mostly to show that the code will still perform mathematical correct
;;; operations, even if the formatting doesn't look as nice as it could do
;;; afterwards.
;;;
(defun p- (a b)
"Subtracts polynomial b from polynomial a, returns polynomial"
;; This function uses the already implemented p+ and p*
;; b is multiplied by -1 then added to a
(p+ a (p* b '((-1 (("x" 0)))))))
(defun p+ (poly-one poly-two)
"Adds polynomial b to polynomial a, returns polynomial"
(cond
;; If at any point poly-one becomes null due to elimination of terms
;; replace its value with a canonical representation of zero
;; Base: If there is no second polynomial, return the first unchanged
((null poly-two) (if (null poly-one) '((0 (("x" 0)))) poly-one))
;; Recursion: Add head of poly-2 to poly-1, then recurse with the new
;; polynomial as poly-1 and the tail of poly-2 as poly-2
(t (p+ (add-term-to-polynomial (if (null poly-one) '((0 (("x" 0))))
poly-one)
(car poly-two))
(cdr poly-two)))))
(defun sort-variables (variables)
"Sorts list of variable-power cons pairs so that they can be compared using
equal"
(sort (copy-list variables) ; Sort is destructive, so give it a copy
; Variables are sorted to string-less order
(lambda (a b) (if (string-lessp (car b)(car a)) t nil))))
(defun add-term-to-polynomial (polynomial input-term)
"Searches polynomial for a term which matches input term, if there is a
match, the matching terms are combined, if not the new term is added on the
end"
;; Bind coefficient and variable lists for the first term in polynomial
;; and the input term
(let ((coefficient-a (caar polynomial))
(variables-a (car (cdar polynomial)))
(coefficient-b (car input-term))
(variables-b (car (cdr input-term))))
(cond
;; If the variable compatibility predicate says they can be added..
((compatible-variables-p (sort-variables variables-a)
(sort-variables variables-b))
(if (= (+ coefficient-a coefficient-b) 0)
;; New coeff is zero? There will be no new term, just
;; return the rest of the terms
(cdr polynomial)
;; return new term and the rest of the terms
(append (list (append (list (+ coefficient-a
coefficient-b))
(list variables-a)))
(cdr polynomial))))
;; Base: If this is the only term left in the polynomial, and the
;; input term does not match it, then the input term must be added
;; to the end of the polynomial
((null (cdr polynomial)) (list (car polynomial) input-term))
;; Recursion: If the input term cannot be added to the polynomial
;; term, list the polynomial term with the rest of itself added to
;; the input term.
(t (cons (car polynomial)
(add-term-to-polynomial (cdr polynomial) input-term))))))
(defun p* (a b)
"Returns a polynomial which is the product of polynomials a and b"
(cond
;; Base: This condition occurs when there are no terms left in b to
;; multiply a by
((null b) nil)
;; Base: If b is a single term (i.e the car of the polynomial b)
;; return the product of term b and polynomial a
((termp b) (multiply-term-by-polynomial b a))
;; Recursion: Add up the polynomials resulting from the product of
;; polynomial a with each term from polynomial b, this causes the
;; polynomial to simplify whilst multiplying.
(t (p+ (p* a (car b)) (p* a (cdr b))))))
(defun multiply-term-by-polynomial (term polynomial)
"accepts a term and a polynomial, returns a polynomial which is the product
of them"
(cond
;; Base: This condition occurs when there are no terms left in the
;; polynomial to multiply by
((null polynomial) nil)
;; Base: If polynomial is a single term (i.e the car of polynomial)
;; return the product of polynomial and term
((termp polynomial) (list (multiply-terms polynomial term)))
;; Recursion: Append the results of the head of polynomial * term, and
;; the tail of polynomial * term, resulting in a single resultant
;; polynomial
(t (append (multiply-term-by-polynomial (car polynomial) term)
(multiply-term-by-polynomial term (cdr polynomial))))))
(defun multiply-terms (term-a term-b)
"accepts two terms, returns one term - their product"
(let ((variables-a (cadr term-a)) (variables-b (cadr term-b))
(new-coefficient (* (car term-a) (car term-b))))
(list new-coefficient (combine-variables variables-a
variables-b))))
(defun combine-variables (variables-a variables-b)
"Accepts two lists containing variable-power pairs, returns one list with
them merged as they would be in a multiplication operation"
(cond
;; Base: If there is no variable-power list to be added, just return
;; the first
((null variables-b) (if (null variables-a) '(("x" 0)) variables-a))
;; Recursion: Add the first term of variables-b to variables-a then
;; recurse with the tail of variables-b
(t (combine-variables
(add-variable-to-variable-list (if (null variables-a)
'(("x" 0))
variables-a)
(car variables-b))
(cdr variables-b)))))
(defun add-variable-to-variable-list (variable-list input-variable)
"Integrates the input-variable into the given variable-list, returns this
new variable list"
;; Example input-variable: ("x" 2)
;; Example variable-list: (("x" 3) ("x" 2) ("y" 1))
;; Bind symbol and power values for the first variable list in variable
;; list, and for input-variable
(let ((symbol-a (caar variable-list)) (power-a (cadr (car variable-list)))
(symbol-b (car input-variable)) (power-b (cadr input-variable)))
(cond
;; If both variables are constants, then eliminate them
((and (= power-a 0) (= power-b 0)) (cdr variable-list))
;; Base: If the symbols are equal e.g. both "x", then the powers
;; can be added
((string= symbol-a symbol-b)
;; If resultant power is zero, then variable is eliminated,
;; otherwise add the powers
(if (= (+ power-a power-b) 0)
(cdr variable-list)
(append (list (list symbol-a (+ power-a power-b)))
(cdr variable-list))))
;; Base: If there are no more variables in variable-list to attempt
;; to match after this one, add the unmatched variable to the end
;; of the variable list
((null (cdr variable-list)) (list (car variable-list)
input-variable))
;; Recursion: If we haven't found a matching variable, add what we
;; have attempted to match, to the variables that will be matched
;; in future
(t (cons (car variable-list)
(add-variable-to-variable-list (cdr variable-list)
input-variable))))))
(defun p= (a b)
"Returns true if poly a - poly b is zero, otherwise false"
;; If the difference of the polynomials is equal to the canonical
;; representation of zero, they are p=
(if (equal (p- (format-polynomial a) (format-polynomial b))
'((0 (("x" 0))))) t nil))
(defun termp (term)
"Term predicate: Returns true if the car is a number and the cdr is a list"
(if (and (numberp (car term)) (listp (cdr term))) t nil))
(defun compatible-variables-p (vars-one vars-two)
"Returns true if vars-one and vars-two are equal - i.e. a term with vars
one can be added to a term with vars two to create one resultant term"
;; Terms can be added when all of their non-constant variables are equal
(cond
;; Base: If both are null they must have matched correctly
((and (null vars-one) (null vars-two)) t)
;; If vars-one is out of variables, the rest of vars-two must be
;; constants for them to match
((null vars-one)
;; Recurse: Watches for constant on vars-two
(if (= (cadr (car vars-two)) 0) ; if power is zero
(compatible-variables-p vars-one (cdr vars-two)) nil))
;; If vars-two is out of variables, the rest of vars-one must be
;; constants for them to match
((null vars-two)
;; Recurse: If a constant appears, ignore it by moving on
(if (= (cadr (car vars-one)) 0) ; if power is zero
(compatible-variables-p (cdr vars-one) vars-two) nil))
;; Recurse: If they are equal, continue
((equal (car vars-one) (car vars-two))
(compatible-variables-p (cdr vars-one) (cdr vars-two)))
;; Recurse: If either var is a constant, it can be ignored
((= (cadr (car vars-two)) 0)
(compatible-variables-p vars-one (cdr vars-two)))
((= (cadr (car vars-one)) 0)
(compatible-variables-p (cdr vars-one) vars-two))
;; Base: If none of the above conditions are met, vars do not match
(t nil)))
(defun format-polynomial (polynomial &optional (sorted '((0 (("x" 0))))))
"Ensures the polynomial is as simplified as possible and each term's
variables are in alphabetical order"
(cond
;; Base: If there is only one term, no simplifications is needed,
;; just add 0 to ensure vars are sorted
((null (cdr polynomial)) (add-term-to-polynomial sorted
(car polynomial)))
;; Recursion: If there is more than one term in polynomial, add
;; the first term to sorted, then recurse.
(t (format-polynomial (cdr polynomial)
(add-term-to-polynomial sorted
(car polynomial))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; TEST CASES ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; p+
;#|
;; 1. Same variables - coefficients add
(print (p+ '((1 (("x" 1))))
'((2 (("x" 1))))))
;;((3 (("x" 1))))
;; 2. Different variables - terms append
(print (p+ '((1 (("x" 2))))
'((2 (("x" 1))))))
;;((1 (("x" 2))) (2 (("x" 1))))
;; 3. Resultant coefficient is zero - term is eliminated
(print (p+ '((1 (("x" 1))))
'((-1 (("x" 1))))))
;;((0 (("x" 0))))
;; 4. Multi-term addition on well formed (already simplified) polynomials
(print (p+ '((1 (("x" 2))) (2 (("x" 1))))
'((3 (("x" 2))) (1 (("x" 0))))))
;;((4 (("x" 2))) (2 (("x" 1))) (1 (("x" 0))))
;; 5. Last 4 test cases combined.
(print (p+ '((1 (("x" 2))) (2 (("x" 1))))
'((3 (("x" 2))) (-2 (("x" 1))) (1 (("x" 0)))) ))
;;((4 (("x" 2))) (1 (("x" 0))))
;; 6. Adding variables using different symbols.
(print (p+ '((1 (("y" 2))) (2 (("y" 1))))
'((3 (("x" 2))) (1 (("y" 1))))))
;;((1 (("y" 2))) (3 (("y" 1))) (3 (("x" 2))))
;; 7. Adding constants which have different symbols.
(print (p+ '((1 (("x" 0))))
'((3 (("y" 0))))))
;;((4 (("x" 0))))
;; 8. Adding terms with different combinations of variables.
(print (p+ '((1 (("y" 2)("x" 1))) (2 (("y" 1))))
'((3 (("y" 2)("x" 1))) (1 (("var" 1)("z" 3))))))
;;((4 (("y" 2) ("x" 1))) (2 (("y" 1))) (1 (("var" 1) ("z" 3))))
;; 9. Adding terms with variables in different orders.
(print (p+ '((1 (("y" 2)("x" 1))) (2 (("y" 1))))
'((3 (("x" 1)("y" 2))) (1 (("var" 1)("z" 3))))))
;;((4 (("y" 2) ("x" 1))) (2 (("y" 1))) (1 (("var" 1) ("z" 3))))
;; 10. Last 4 test cases combined.
(print (p+ '((1 (("y" 2)("x" 1))) (2 (("x" 0)("y" 1))))
'((3 (("y" 2)("x" 1))) (1 (("y" 1)("z" 0))))))
;;((4 (("y" 2) ("x" 1))) (3 (("x" 0) ("y" 1))))
;; 11. Combining test cases 5 and 10.
(print (p+ '((1 (("y" 2)("x" 1))) (2 (("x" 0)("y" 1))) (2 (("x" 1))))
'((3 (("y" 2)("x" 0))) (1 (("y" 1)("z" 0))) (-2 (("x" 1))))))
;;((1 (("y" 2) ("x" 1))) (3 (("x" 0) ("y" 1))) (3 (("y" 2) ("x" 0))))
;|#
;; p*
;#|
;; 1. Linear * constant, coefficients multiply
(print (p* '((1 (("x" 1))))
'((2 (("x" 0))))))
;;((2 (("x" 1))))
;; 2. Identical variables - powers add
(print (p* '((1 (("x" 1))))
'((2 (("x" 1))))))
;;((2 (("x" 2))))
;; 3. Resultant power is zero - variable eliminated (powers can subtract)
(print (p* '((1 (("x" 1))))
'((2 (("x" -1))))))
;;((2 (("x" 0))))
;; 4. Multi-term polynomial multiplication
(print (p* '((1 (("x" 1)))(1 (("x" 0))))
'((2 (("x" 1)))(1 (("x" 0))))))
;;((2 (("x" 2))) (3 (("x" 1))) (1 (("x" 0))))
;; 5. Last 4 cases combined.
(print (p* '((1 (("x" 2)))(1 (("x" 1))))
'((2 (("x" 2)))(2 (("x" -1))))))
;;((2 (("x" 4))) (2 (("x" 3))) (2 (("x" 1))) (2 (("x" 0))))
;; 6. Multiplication with different variables
(print (p* '((1 (("x" 1))))
'((2 (("x" 1)))(1 (("x" 0))))))
;;((2 (("x" 2))) (1 (("x" 1))))
;; 7. Multiply constants using different symbols
(print (p* '((1 (("y" 0))))
'((2 (("x" 1)))(1 (("x" 0))))))
;;((2 (("x" 1) ("y" 0))) (1 (("x" 0))))
;; 8. Multiply terms with multiple variables
(print (p* '((1 (("y" 0)("x" 1))))
'((2 (("z" 0)))(1 (("x" 0))))))
;;((3 (("x" 1))))
;; 9. Multiply by zero
(print (p* '((1 (("y" 0))))
'((0 (("z" 0))))))
;;((0 (("x" 0))))
;; 10. Last 4 cases combined
(print (p* '((1 (("y" 2)("x" 1)))(1 (("x" 0))))
'((2 (("z" 0)))(0 (("x" 0))))))
;;((2 (("z" 0) ("y" 2) ("x" 1))) (2 (("x" 0))))
;; 11. Adding cases 5 and 10
(print (p+ (p* '((1 (("y" 2)("x" 1)))(1 (("x" 0))))
'((2 (("z" 0)))(0 (("x" 0)))))
(p* '((1 (("x" 2)))(1 (("x" 1))))
'((2 (("x" 2)))(2 (("x" -1)))))))
;;((2 (("z" 0) ("y" 2) ("x" 1))) (4 (("x" 0))) (2 (("x" 4))) (2 (("x" 3) (2 (("x" 1))))
;|#
;; p- (this is just p+ and p* used together)
;#|
;; 1. Same variables - coefficients subtract
(print (p- '((1 (("x" 1))))
'((2 (("x" 1))))))
;;((-1 (("x" 1))))
;; 2. Different variables - terms append
(print (p- '((1 (("x" 2))))
'((2 (("x" 1))))))
;;((1 (("x" 2))) (-2 (("x" 1))))
;; 3. Resultant coefficient is zero - term is eliminated
(print (p- '((1 (("x" 1))))
'((1 (("x" 1))))))
;;((0 (("x" 0))))
;; 4. Multi-term subtraction on well formed (already simplified) polynomials
(print (p- '((1 (("x" 2))) (2 (("x" 1))))
'((3 (("x" 2))) (1 (("x" 0))))))
;;((-2 (("x" 2))) (2 (("x" 1))) (-1 (("x" 0))))
;; 5. Last 4 test cases combined.
(print (p- '((1 (("x" 2))) (2 (("x" 1))))
'((3 (("x" 2))) (2 (("x" 1))) (1 (("x" 0)))) ))
;;((-2 (("x" 2))) (-1 (("x" 0))))
;; 6. Subtracting variables using different symbols.
(print (p- '((1 (("y" 2))) (2 (("y" 1))))
'((3 (("x" 2))) (1 (("y" 1))))))
;;((1 (("y" 2))) (1 (("y" 1))) (-3 (("x" 2))))
;; 7. Subtracting constants which have different symbols.
(print (p- '((1 (("x" 0))))
'((3 (("y" 0))))))
;;((-2 (("x" 0))))
;; 8. Adding terms with different combinations of variables.
(print (p- '((1 (("y" 2)("x" 1))) (2 (("y" 1))))
'((3 (("y" 2)("x" 1))) (1 (("var" 1)("z" 3))))))
;;((-2 (("y" 2) ("x" 1))) (2 (("y" 1))) (-1 (("x" 0) ("var" 1) ("z" 3))))
;|#
;; p=
;; 1. Single term polynomials: Should resolve to T
(print (p= '((3 (("y" 2))))
'((3 (("y" 2))))))
;; 2. Single term polynomials: Should resolve to NIL
(print (p= '((3 (("y" 2))))
'((2 (("y" 2))))))
;; 3. Single term polynomials: Should resolve to NIL
(print (p= '((3 (("y" 3))))
'((3 (("y" 2))))))
;; 4. Single term polynomials: Should resolve to NIL
(print (p= '((3 (("x" 2))))
'((2 (("y" 2))))))
;; 5. Multi term polynomials: Should resolve to T
(print (p= '((3 (("x" 2)("z" 0)("y" 2))))
'((3 (("y" 2)("x" 2))))))
;; 6. Unsimplified multi term polynomials: Should resolve to T
(print (p= '((3 (("x" 2))) (2 (("x" 2))))
'((5 (("x" 2))))))
;; 7. Unsimplified multi term polynomials: Should resolve to T
(print (p= '((3 (("x" 2)("y" 0))) (2 (("x" 2))))
'((5 (("z" 0)("x" 2))))))
;; 8. Compare results from addition: Should resolve to NIL
(print (p= (p+ '((3 (("y" 2)("x" 1)("z" 1))))
'((2 (("y" 2)("x" 1)))))
(p+ '((2 (("y" 2)("x" 1))))
'((3 (("y" 2)("x" 1)("z" 0)))))))
;; 9. Compare results from addition: Should resolve to T
(print (p= (p+ '((3 (("y" 2)("x" 1)("z" 0))))
'((2 (("y" 2)("x" 1)("a" 0)))))
(p+ '((2 (("y" 2)("h" 0)("x" 1))))
'((3 (("y" 2)("x" 1)))))))
;; 10. Compare results from multiplication: Should resolve to T
(print (p= (p* '((1 (("y" 2)("x" 1)))(1 (("x" 0))))
'((2 (("z" 0)))(0 (("x" 0)))))
(p* '((1 (("y" 2)("x" 1)))(1 (("x" 0))))
'((2 (("z" 0)))(0 (("x" 0)))))))
;; 11. Compare results from subtraction: Should resolve to T
(print (p= (p- '((1 (("y" 2)("x" 1))) (2 (("y" 1))))
'((3 (("y" 2)("x" 1))) (1 (("var" 1)("z" 3)))))
(p- '((1 (("y" 2)("x" 1))) (2 (("y" 1))))
'((3 (("y" 2)("x" 1))) (1 (("var" 1)("z" 3)))))))
| 20,486 | Common Lisp | .lisp | 405 | 42.037037 | 88 | 0.48554 | alexr1993/symbolic-algebra-implementation | 0 | 0 | 0 | GPL-2.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 6a0a874a72134331292922db4a90cc6c8f6d5ae6205aec1f1cb3b5ccefa4b2b9 | 27,581 | [
-1
] |
27,598 | package.lisp | GazeboHub_lupine-m2/src/main/lisp/lupine-xmi/package.lisp |
(im-package #:cl-user)
(defpackage #:lupine/xmi
(:use #:lupine/aux #:cl)
(:export
;; validation.lisp
#:version-namespace
#:compute-xmi-namespace
))
| 186 | Common Lisp | .lisp | 8 | 17.5 | 31 | 0.585227 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | f97e231528444257c7b26000a981d0f338fa74e978eae5398b78cd940ca55434 | 27,598 | [
-1
] |
27,599 | validation.lisp | GazeboHub_lupine-m2/src/main/lisp/lupine-xmi/validation.lisp |
(in-package #:xmi)
(defconstant* version-namespace (simplify-string "20110701")
"Refer to MOF 2 /XMI Mapping Specification, v2.4.1, subclause 7.3.1
See also: `compute-xmi-namespace'")
(defun compute-xmi-namespace (&optional (version-ns version-namespace))
"Refer to MOF 2 /XMI Mapping Specification, v2.4.1, subclause 7.3.1"
(declare (type string version-ns)
(values simple-base-string &optional))
(concatenate 'simple-base-string
#.(simplify-string "http://www.omg.org/spec/XMI/")
version-ns))
| 540 | Common Lisp | .lisp | 11 | 44 | 71 | 0.711538 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | f07e5defee361b007a103f46b903785f4e0fe7560300f980cb888e77e87671a3 | 27,599 | [
-1
] |
27,600 | package.lisp | GazeboHub_lupine-m2/src/main/lisp/lupine-aux/package.lisp |
(in-package #:cl-user)
(defpackage #:lupine/aux
(use #:cl)
(export
;; refs.lisp
#:defconstant*
;; strings.lisp
#:simplify-string
#:simplify-string*
;; files.lisp
#:%file-buffer-size%
#:%file-buffer-element-type%
#:file=
))
| 336 | Common Lisp | .lisp | 14 | 14.928571 | 36 | 0.515358 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 86975956fed50ab683478f00f6995c3b113da70934c3da4a7ea55b9137abd551 | 27,600 | [
-1
] |
27,601 | strings.lisp | GazeboHub_lupine-m2/src/main/lisp/lupine-aux/strings.lisp |
(in-package #:lupine/aux)
(defun simplify-string (string)
"Coerce STRING to a `SIMPLE-BASE-STRING', if possible, or else to a `SIMPLE-STRING', or else err.
See also: `SIMPLIFY-STRING*'"
(declare (type string string)
(values simple-string &optional))
(or (ignore-errors (coerce string 'simple-base-string))
(coerce string 'simple-string)))
(defun simplify-string* (string)
"Coerce STRING to a `SIMPLE-BASE-STRING', if possible, else err
See also: `SIMPLIFY-STRING'"
(declare (type string string)
(values simple-base-string &optional))
(coerce string 'simple-base-string))
| 622 | Common Lisp | .lisp | 14 | 39.785714 | 98 | 0.707155 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 0e31e59989a603d007737f7e86b693085b33256893cdfa8d3c7a6f930540c70b | 27,601 | [
-1
] |
27,602 | files.lisp | GazeboHub_lupine-m2/src/main/lisp/lupine-aux/files.lisp |
(in-package #:lupine/aux)
(defvar %file-buffer-size% 1024)
(defvar %file-buffer-element-type% '(unsigned-byte 8))
(defun file= (f1 f2 &key (start 0) end (test #'=) (element-type %file-buffer-element-type%) (buffer-size %file-buffer-size%))
;; Initial motivation: This function design was begun, originally, with the intention of providing a capability for testing a specific section of a source file for equivalence onto a given section of a template file - as for ensuring the presence of specific licensing information within a source file, from procedures that may be executed before a source code commit. Secondly, it was intended that the function be reusable for other file byte comparisons.
(let ((n (when end start))
(test-fn (coerce test 'function))
(b1 (make-array file-buffer-size :element-type element-type))
(b2 (make-array file-buffer-size :element-type element-type)))
(declare (type function test-fn))
(with-open-file (f1s f1 :direction :input :element-type element-type)
(setf (file-position f1s) start)
(with-open-file (f2s f2 :direction :input :element-type element-type)
(setf (file-position f2s) start)
(block read-loop
(flet ((return-false () (return-from read-loop nil))
(return-true () (return-from read-loop t)))
(loop
(cond
((and n (= n end))
(return-from read-loop t))
(t
(let ((r1n (read-sequence b1 f1s))
(r2n (read-sequence b2 f2s)
long-read-p ;;; signifies an "effective EOF"
))
;; FIXME: Revise this to account for a read past END
(when end
;; FIXME: Test this logic
(let ((foo-1 (+ n r1n))
(foo-2 (+ n r2n)))
(when (> foo-1 end)
(setq long-read-p t
r1n (- foo-1 (- foo-1 end))))
(when (> foo-2 end)
(setq long-read-p t
r2n (- foo-2 (- foo-2 end))))
))
(cond
((not (= (the fixnum r1n) (the fixnum r2n))))
(return-false)
((zerop (the fixnum r1n))
(return-true))
(t
(dotimes (nth r1n)
(let ((it-1 (aref b1 nth))
(it-2 (aref b2 nth)))
(unless (funcall test-fn it-1 it-2)
(return-false))))))
(cond
(long-read-p (return-true))
(n (incf n (the fixnum r1n))))
))))))))))) ;; file= | 3,467 | Common Lisp | .lisp | 53 | 36.849057 | 462 | 0.408971 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 97beeeb327a83eac209c444fa695116ba8ed4c382b049948d26e4397d3768023 | 27,602 | [
-1
] |
27,603 | refs.lisp | GazeboHub_lupine-m2/src/main/lisp/lupine-aux/refs.lisp | (in-package #:lupine/aux)
(defmacro defconstant* (name value &optional docs)
`(eval-when (:compile-toplevel :load-toplevel :execute)
(unless (boundp (quote ,name))
(defconstant ,name ,value
,@(when docs (list docs))))))
| 261 | Common Lisp | .lisp | 6 | 35.666667 | 59 | 0.61811 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 6d36df4bfd03ffb1834fe599fa910bc7e73c3c9a509f09dccda85dc5a046d6bf | 27,603 | [
-1
] |
27,604 | parse.lisp | GazeboHub_lupine-m2/module/ucx/src/main/lisp/parse.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/ucx)
;;; * Utils for Parse-Schema
(deftype parser-input-source ()
'(or pathname stream string runes:xstream))
;;; * Source->URI Computation
(defgeneric compute-source-uri (source)
(:method ((source pathname))
(let ((pbuff (make-string-output-stream))
(%source (merge-pathnames source)))
(write-char #\/ pbuff)
(dolist (p (cdr (pathname-directory %source)))
(write-string p pbuff)
(write-char #\/ pbuff))
(let* ((n (pathname-name %source))
(tp (pathname-type %source)))
(when n
(write-string n pbuff)
(when tp
(write-char #\. pbuff)
(write-string tp pbuff))))
(make-instance 'puri:uri
:scheme :file
:host nil
:path (get-output-stream-string pbuff))))
(:method ((source file-stream))
(compute-source-uri (pathname source)))
#+TO-DO
(:method ((source a-socket-stream-in-a-network-transport-app))
)
#+TO-DO
(:method ((source runes:xstream))
))
#|
(compute-source-uri
(make-pathname :directory '(:absolute "tmp" "foo")
:name "foo"
:type "md"))
|#
| 1,364 | Common Lisp | .lisp | 45 | 26.466667 | 70 | 0.671505 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 5a1b71603dea748270ed0f9fc7ec208ae01c6214380dc612da5773b58d885338 | 27,604 | [
-1
] |
27,605 | package.lisp | GazeboHub_lupine-m2/module/ucx/src/main/lisp/package.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(defpackage #:lupine/ucx
(:use #:lupine/ns #:puri #:lupine/aux #:cl)
(:export
;; parse.lisp
#:parser-input-source
#:compute-source-uri
))
| 440 | Common Lisp | .lisp | 14 | 28.285714 | 70 | 0.729858 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 6b5bd804b3bd36a1aaac4f56e8431cb06cf82771f2fef1fe37641bf600497559 | 27,605 | [
-1
] |
27,606 | ns-xsd.lisp | GazeboHub_lupine-m2/module/xd/src/main/lisp/ns-xsd.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/xd/xsd)
(defgeneric namespace-uri (namespace))
(defgeneric (setf namespace-uri) (uri namespace))
(defgeneric element-namespace (object))
(defgeneric (setf element-namespace) (namespace object))
(defgeneric prefix-namespace (prefix container))
(defgeneric (setf prefix-namespace) (namespace prefix container))
(defgenric namespace-prefixes (namespace container))
(defclass namespace-container ()
;; TO DO: Implement the procedures of the previous,
;; onto this genrric NAMESPACE-CONTAINER class,
;; extending this class for:
;; * CXML elements
;; * RNG schema
;; * XSD schema
;; * MOF models
;; * OWL ontologies
())
(defclass xml-namespace (namespace)
;; Design Decision (to do)
;; Namely, should an XML Namespace be represented with a unique
;; object type, or just be implicitly be representd with a URI?
((ns-uri
:initarg :ns-uri
:type string
:initform +null-namespace+)
(ns-prefixes
:initarg ns-prefixes
:type sequence ;; not good...
)))
| 1,291 | Common Lisp | .lisp | 37 | 32.459459 | 70 | 0.753027 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 56f2d0cfcea4f0b7faee91fff8f5d726e50b7171f58eefd5fe272d032dbbd739 | 27,606 | [
-1
] |
27,607 | package.lisp | GazeboHub_lupine-m2/module/xd/src/main/lisp/package.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:cl-user)
(defpackage #:lupine/xd
(:use #:c2mop #:cl)
(:export
#:namespace-type
#:namespace
#:put-instance
#:get-instance
))
| 459 | Common Lisp | .lisp | 16 | 24.625 | 70 | 0.704805 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | ce9f167d0d6db1686c5a8c492fdb7ade0a83d860c85336d009d3566e18d0b5f3 | 27,607 | [
-1
] |
27,608 | ns.lisp | GazeboHub_lupine-m2/module/xd/src/main/lisp/ns.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/xd)
(defclass namespace-type (standard-class)
())
(defclass namespace ()
())
(defgeneric put-instance (name object namespace)
;; the generic xD protocol will not define an exact storage model
#+:nil
(:method (name (object namespace) (namespace namespace-type))
))
(defgeneric get-instance (name namespace)
#+:nil
(:method (name (namespace namespace-type))
))
| 717 | Common Lisp | .lisp | 21 | 30.047619 | 70 | 0.72969 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 76b8b55365362cc12501347692e8ebac1d1a5eb19737cbe6094f33731f9906e8 | 27,608 | [
-1
] |
27,609 | package.lisp | GazeboHub_lupine-m2/module/ns/src/main/lisp/package.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:cl-user)
(defpackage #:lupine/ns
(:use #:lupine/final #:lupine/aux #:cl)
(:export
#:ncname
#:simple-ncname
#:namespace
#:prefix-qualified-namespace
#:namespace-string
#:namespace-package
#:make-namespace
#:make-prefix-qualified-namespace
#:compute-qname-string
#:find-prefix
#:namespace-registry
#:make-namespace-registry
#:namespace-not-found
#:namespace-not-found-error
#:compute-namespace
#:namespace-prefix-condition
#:namespace-prefix-bind
#:namespace-prefix-unbind
#:prefix-already-bound
#:prefix-already-bound-error
#:prefix-not-found
#:prefix-not-found-error
#:resolve-prefix-namespace
#:bind-prefix
#:compute-qname
#:compute-qname-symbol
#:ensure-standard-namespaces
))
(defpackage "http://www.w3.org/XML/1998/namespace"
;; cf. http://www.w3.org/TR/xml-names/#ns-decl
(:nicknames #:ns/xml)
(:export #:|base| #:|id| #:|lang| #:|space| )
(:use))
(defpackage "http://www.w3.org/2000/xmlns/"
;; cf. http://www.w3.org/TR/xml-names/#ns-decl
;;
;; NOTE: Application developers may be cautioned before binding
;; symbols in this package to any document-specific values. For
;; example, Whereas in an XML namespace, xmlns:quux may denote one
;; namespace in a document A and an entirely other namespace in a
;; document B, then if ns/xmlns::|quux| would bound to any single
;; value in processing the former document, the behaviors are
;; unspecified for how the binding of ns/xmlns::|quux| would be
;; handled in processing the latter document.
;;
;; For most intents and purposes, this package may simply serve in
;; denoting the xmlns namespace and any symbols that may be interned
;; in that namespace, though normal application procedures
;;
;; FIXME: Concerning "Package as persistent collector" - it's up to
;; the application developer to ensure that symbols will be
;; uninterned when no longer needed in any xmlns/foo package
;; namespace. Regarding the matter of packages serving as persisent
;; objects, implementation-specific features may be avaialble for
;; deleting unused packages.
(:nicknames #:ns/xmlns)
(:use))
| 2,487 | Common Lisp | .lisp | 68 | 33.088235 | 70 | 0.727727 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 05bd53dab4e60f4f9afad287662f7c7f616352e7696636870901a4a5409c13b7 | 27,609 | [
-1
] |
27,610 | ns.lisp | GazeboHub_lupine-m2/module/ns/src/main/lisp/ns.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/ns)
;;; * Compile/Load/Eval-Time Forms
;;; ** :SYMBOL-NAME-EQ feature
(eval-when (:compile-toplevel :execute)
(let ((name "ncname"))
(when (eq (symbol-name (read-from-string name))
(symbol-name (read-from-string name)))
(pushnew :SYMBOL-NAME-EQ *features* :test #'eq)
))
) ;; EVAL-WHEN
;;; ** Constants
(eval-when (:compile-toplevel :load-toplevel :execute)
(defconstant +qname-buffer-extent+ 32)
) ;; EVAL-WHEN
;;; * Type Definitions
;; This needs the cxml-ncname-patch.diff onto CXML
;; for (fboundp #'cxml::valid-ncname-p) => T
(deftype ncname ()
;; FIXME: Compatibility with Closure RUNES - needs to be further
;; integrated into this system, for supporting non-UTF lisp
;; implementations
'(and (or runes::rod string)
(satisfies cxml::valid-ncname-p)))
(deftype simple-ncname ()
#+NIL
'(and (simple-array runes:rune (*)) ncname)
'(and (or runes::simple-rod simple-string)
ncname))
;;; * Namespace Qualified Names (QNames)
;; FIXME: The followimg code, excepting the call to ncname-p, does
;; not depend exclusively on CXML. Move the code into a seperate
;; file.
;; This implementation endeavors to minimize the number of string
;; values created in the Lisp image, for persistent representstion of
;; QName (Namespace URI and NCName) values
;;; ** Class Definitions
(defstruct (namespace
(:include finalizable-instance)
(:conc-name #:%namespace-)
(:constructor
%make-namespace
(string &key
#+NAMESPACE-URI uri
(package (find-package* string)))))
(string #.(simplify-string "")
;; string version of namespace URI
:type simple-string)
#+NAMESPACE-URI ;; FIXME: Use or discard the URI support
;; URI vesion of namespace URI
(uri (allocate-instance (find-class 'puri:uri))
:type puri:uri)
;; FIXME: PACKAGE essentially duplicates LOCAL-NAMES-TABLE,
;; albeit serving as an index of unique strings inasmuch.
#-:SYMBOL-NAME-EQ
(local-names-table (make-hash-table
:test #'equal
:size #.+qname-buffer-extent+)
:type hash-table)
(package (copy-structure (defpackage "NAMESPACE-CLONE"))
:type package
))
(defstruct (prefix-qualified-namespace
(:include namespace)
(:constructor
%make-prefix-qualified-namespace
(string &key
#+NAMESPACE-URI uri
(package (find-package* string))
prefix-table)))
(prefix-table (make-array #.+qname-buffer-extent+
:element-type 'simple-string
:adjustable t
:fill-pointer 0)
:type (or (vector simple-string) simple-vector)))
;;; * Accessor Protocol
(defgeneric namespace-string (namespace)
(:method ((namespace namespace))
(%namespace-string namespace)))
#+NAMESPACE-URI
(defgeneric namespace-uri (namespace)
(:method ((namespace namespace))
(%namespace-uri namespace)))
(defgeneric namespace-package (namespace)
(:method ((namespace namespace))
(%namespace-package namespace)))
#-:SYMBOL-NAME-EQ
(defgeneric namespace-local-names-table (namespace)
(:method ((namespace namespace))
(%namespace-local-names-table namespace)))
(defgeneric namespace-prefix-table (namespace)
(:method ((namespace prefix-qualified-namespace))
(prefix-qualified-namespace-prefix-table namespace)))
(defgeneric (setf namespace-string) (new-value namespace)
(:method ((new-value string) (namespace namespace))
(setf (%namespace-string namespace)
new-value)))
#+NAMESPACE-URI
(defgeneric (setf namespace-uri) (new-value namespace)
(:method ((new-value uri) (namespace namespace))
(setf (%namespace-uri namespace)
new-value)))
(defgeneric (setf namespace-package) (new-value namespace)
(:method ((new-value package) (namespace namespace))
(setf (%namespace-package namespace)
new-value)))
#-:SYMBOL-NAME-EQ
(defgeneric (setf namespace-local-names-table) (new-value namespace)
(:method ((new-value hash-table) (namespace namespace))
(setf (%namespace-local-names-table namespace)
new-value)))
(defgeneric (setf namespace-prefix-table) (new-value namespace)
(:method ((new-value vector)
(namespace prefix-qualified-namespace))
(setf (prefix-qualified-namespace-prefix-table namespace)
new-value)))
#|
(let ((ns (simplify-string "CL")))
(defparameter *ns*
(%make-namespace ns #+NIL (puri:intern-uri ns))))
(eq (namespace-package *ns*) (find-package "COMMON-LISP"))
=EXPECT=> T
|#
(defmethod print-object ((instance prefix-qualified-namespace) stream)
(print-unreadable-object (instance stream :type t :identity t)
(format stream "~A ~A ~A ~A"
(namespace-prefix-table instance)
(namespace-string instance)
(instance-finalized-p instance)
(package-shortest-name (namespace-package instance)))))
(defmethod finalize ((instance prefix-qualified-namespace))
;; FIXME: call FINALIZE sometime after model initialization
;; FIXME: Thread safety
(setf (namespace-prefix-table instance)
(coerce (namespace-prefix-table instance)
'simple-vector)))
(defmethod unfinalize ((instance prefix-qualified-namespace))
;; Assumption: INSTANCE is finalized
;; FIXME: Regression testing
;; FIXME: Thread safety
(let* ((table (namespace-prefix-table instance))
(len (length (the simple-vector table))))
(setf (namespace-prefix-table instance)
(make-array len
:element-type 'simple-string
:fill-pointer len
:adjustable t
:initial-contents table))))
(declaim (type hash-table *qname-ns-registry*))
(defvar *qname-ns-registry* (puri:make-uri-space )) ;; ??
(defun make-namespace (ns-string
&optional
(package (find-package* ns-string)))
(declare (type string ns-string)
(type package package)
(values namespace &optional))
(let ((s (simplify-string ns-string)))
(%make-namespace s
#+NAMESPACE-URI :uri
#+NAMESPACE-URI (puri:intern-uri s *qname-ns-registry*)
:package package)))
(defun make-prefix-qualified-namespace (ns-string
&optional
(package
(find-package* ns-string)))
(declare (type string ns-string)
(type package package)
(values prefix-qualified-namespace &optional))
(let ((s (simplify-string ns-string)))
(%make-prefix-qualified-namespace
s #+NAMESPACE-URI :uri
#+NAMESPACE-URI (puri:intern-uri s *qname-ns-registry*)
:package package)))
#-:SYMBOL-NAME-EQ
(defun compute-qname-string (ncname ns &optional ensure)
(declare (type string ncname)
(type namespace ns)
(values simple-ncname &optional))
(locally (declare (inline cxml::valid-ncname-p))
(let* ((ncname-s (simplify-string ncname))
(table (namespace-local-names-table ns))
(it (gethash ncname-s table)))
(cond
(it (values it))
(ensure
(unless (cxml::valid-ncname-p ncname)
(error 'type-error :expected-type 'ncname :datum ncname))
(setf (gethash ncname-s table) ncname-s))
(t (error 'name-not-found :name ncname :namespace ns))))))
#+:SYMBOL-NAME-EQ
(defun compute-qname-string (ncname ns &optional ensure)
(declare (type string ncname)
(type namespace ns)
(values simple-ncname &optional))
(locally (declare (inline cxml::valid-ncname-p))
(let ((p (namespace-package ns)))
(declare (type package p))
(multiple-value-bind (s visibility)
(find-symbol ncname p)
(cond
;; NOTE: If NCNAME is already interned in P, this function
;; assumes it must be a valid ncname
(visibility (values (symbol-name s)))
(ensure
(unless (cxml::valid-ncname-p ncname)
(error 'type-error :expected-type 'ncname :datum ncname))
(values (symbol-name (intern ncname p))))
(t (error 'name-not-found :name ncname :namespace ns)))))))
#|
;; FIXME: note that regression tests for this system should be
;; conducted under conditions both of when this code is compiled
;; #+:SYMBOL-NAME-EQ and when #-:SYMBOL-NAME-EQ. That, in itself, may
;; serve to need some extension f othe test harness framework
(progn
(defpackage "http://foo.example.com/"
(:use))
(let ((reg (make-namespace "http://foo.example.com/"))
(q "FOO"))
(eq (compute-qname-string q reg t)
(compute-qname-string q reg)))
)
;; =expect=> T
|#
(defun find-prefix (prefix namespace &optional (errorp t))
(declare (type simple-string prefix)
(type prefix-qualified-namespace namespace)
(values (or null simple-string) &optional))
;; Note that this system prefers a simple string table for prefix
;; values, rather than any additional packages for the same, as in
;; consideration:
;;
;; * that prefix values may not be as numerous as cname values,
;; within a namespace
;;
;; * that prefix values may be effectively "moved" between
;; namespace URI within a naming context
(or (find prefix (prefix-qualified-namespace-prefix-table namespace)
:test #'string=)
(when errorp
(error 'prefix-not-found
:name prefix
:namespace namespace))))
;;; ** Meta Registry (Multiple Namespaces)
;; FIXME: When moving this code into a new Lupine/NS module,
;; also move the finalizable instance proocol into its own module,
;; namely Lupine/Final
(defstruct (namespace-registry
(:include finalizable-instance)
(:constructor make-namespace-registry
(&optional null-namespace))
(:conc-name #:namespace-registry-))
;; the prefix-table slot uses a vector for its table, in not
;; expecting a lot of variety/breadth in the table's contents
(prefix-table (make-array #.+qname-buffer-extent+
:element-type 'prefix-qualified-namespace
:adjustable t
:fill-pointer 0)
:type (or (vector namespace) simple-vector))
(null-namespace
;; FIXME: There may be some ambiguous semantics with regards to a
;; "Null namespace" within a namespace-registry decoupled from an
;; XML document object model - to a question, what would be the
;; namespace URI of the null namespace within a namespace registry?
(%make-namespace #.(simplify-string "")
:package
(copy-structure
(defpackage "NULL-NAMESPACE-CLONE")))
:type namespace))
;; (namespace-registry-null-namespace (make-namespace-registry))
(defmethod print-object ((instance namespace-registry) stream)
(print-unreadable-object (instance stream :type t :identity t)
(format stream "~D ~A"
(length (namespace-registry-prefix-table instance))
(instance-finalized-p instance))))
(defmethod finalize ((instance namespace-registry))
;; FIXME: call FINALIZE sometime after model initialization
;; FIXME: Thread safety
(let ((table (coerce (namespace-registry-prefix-table instance)
'simple-vector)))
(setf (namespace-registry-prefix-table instance)
table)
(finalize (namespace-registry-null-namespace instance))
(do-vector (ns (the simple-vector table) instance)
(finalize ns))))
(defmethod unfinalize ((instance namespace-registry))
;; Assumption: INSTANCE is finalized
;; FIXME: Thread Safety
;; FIXME: Regression testing
(let* ((table (namespace-registry-prefix-table instance))
(len (length (the simple-vector table))))
(setf (namespace-registry-prefix-table instance)
(make-array len
:element-type 'namespace
:fill-pointer len
:adjustable t
:initial-contents table))
(unfinalize (namespace-registry-null-namespace instance))
(do-vector (ns table instance)
(unfinalize ns))))
;;; * Condition Type Protocol: NAMESPACE-NOT-FOUND
(define-condition namespace-not-found (name-not-found)
()
(:report
(lambda (c s)
(format s "Namespace ~s not found in ~s"
(name-condition-name c)
(namespace-condition-namespace c)))))
(define-condition namespace-not-found-error (program-error
namespace-not-found)
())
;;; * Namespace Resolvers
(defun compute-namespace (uri registry &optional ensure-p)
"Ensure that a namespace object exists for the string URI within the
specified NAMESPACE-REGISTRY. Returns the namespace object and a
boolean value indicating whether the namespace object was created
newly in this evaluation.
## Exceptional Situations
When ENSURE-P is true and a namespace is not found for the URI onto
REGISTRY, this function will create a new PREFIX-QUALIFIED-NAMESPACE.
If there is no package defined with the URI as a package name or
nickname at that time, then an error of type PACKAGE-NOT-FOUND will be
signaled.
If REGISTRY is finalized-p and ENSURE-P is true, then when a new
namespace must be added to the registry, an error of type
INSTANCE-FINALIZED-ERROR will be signaled.
If ENSURE-P is false and no namespace is found for URI onto REGISTRY,
then an error of type NAMESPACE-NOT-FOUND-ERROR will be signaled."
(declare (type string uri)
(type namespace-registry registry)
(values namespace boolean &optional))
(let ((%uri (simplify-string uri))
(table (namespace-registry-prefix-table registry)))
(declare (type simple-string %uri)
(type vector table))
(flet ((find-registered ()
(do-vector (ns table)
(declare (type namespace ns))
(when (string= %uri (namespace-string ns))
(return ns)))))
(let ((ns (find-registered)))
(cond
(ns (values ns nil))
(ensure-p
(assert-not-finalized registry
"Unable to add instance for uri ~s"
%uri)
(let ((ns-new (make-prefix-qualified-namespace %uri)))
(vector-push-extend ns-new table)
(values ns-new t)))
(t (error 'namespace-not-found-error
:name %uri
:namespace registry)))))))
;;; * Condition Type Protocol: Namespace Binding/Unbinding
(define-condition namespace-prefix-condition (name-condition
namespace-condition)
())
(defmethod print-object ((instance namespace-prefix-condition) stream)
(print-unreadable-object (instance stream :type t :identity t)
(format stream "~A ~A"
(name-condition-name instance)
(namespace-condition-namespace instance))))
(define-condition namespace-prefix-bind (namespace-prefix-condition)
()
(:report
(lambda (c s)
(format s "prefix ~s bound to ~a"
(name-condition-name c)
(namespace-condition-namespace c)))))
(define-condition namespace-prefix-unbind (namespace-prefix-condition)
()
(:report
(lambda (c s)
(format s "prefix ~s unbound from ~a"
(name-condition-name c)
(namespace-condition-namespace c)))))
;;; * Condition Type Protocol: PREFIX-ALREADY-BOUND
(define-condition prefix-already-bound (name-condition
namespace-condition)
()
(:report
(lambda (c s)
(format s "Prefix ~s is already bound to ~s"
(name-condition-name c)
(namespace-condition-namespace c)))))
(define-condition prefix-already-bound-error (program-error
prefix-already-bound)
())
;;; * Condition Type Protocol: PREFIX-NOT-FOUND
(define-condition prefix-not-found (name-not-found)
()
(:report
(lambda (c s)
(format s "Prefix ~s not found in ~s"
(name-condition-name c)
(namespace-condition-namespace c)))))
(define-condition prefix-not-found-error (program-error
prefix-not-found)
())
;;; * Namespace Prefix Resolvers
(defun resolve-prefix-namespace (prefix registry &optional (errorp t))
"Compute and return the namespace for PREFIX within REGISTRY,
if PREFIX is bound to any namespace within REGISTRY.
When PREFIX is found, the namespace is returned as the first
value. The exact, simplified prefix string object for PREFIX within
that namesapce is returned as the second value.
## Exceptional Situations
When PREFIX is not found for any namespace within REGISTRY and ERRORP
is \"True\", an error of type PREFIX-NOT-FOUND-ERROR is signaled"
(declare (type string prefix)
(type namespace-registry registry)
(values (or prefix-qualified-namespace null)
(or simple-string null)
&optional))
(let ((namespaces (namespace-registry-prefix-table registry)))
(do-vector (ns namespaces (cond
(errorp
(error 'prefix-not-found-error
:name prefix
:namespace registry))
(t (values nil nil))))
(declare (type namespace ns))
(let ((p (find-prefix prefix ns nil)))
(when p
(return (values ns p)))))))
(defun bind-prefix (prefix uri registry &optional move-p)
"Ensure that the namespace prefix PREFIX is registered uniquely to
the namespace URI in namespace-registry REGISTRY.
The namespace object is returned as the first value. The exact,
simplified prefix string object for PREFIX is returned as the second
value.
## Signals
If an existing prefix/namespace binding is superseded by this binding,
a condition of type NAMESPACE-PREFIX-UNBIND is signaled.
If a new prefix/namespace binding is created - whether newly or in
superseding an existing binding - a condition of type
NAMESPACE-PREFIX-BIND is signaled.
## Exceptional Situations
An error of type PREFIX-ALREADY-BOUND-ERROR is signaled when MOVE-P
is \"False\" and PREFIX denotes a prefix bound to a namespace not
namespace-equivalent (that is, string-equivalent) to URI
An error of type SIMPLE-INSTANCE-FINALIZED-ERROR is signaled when a
new binding must be created in either the REGISTRY or the namespace,
though the respective object would be FINALIZED-P"
(declare (type string prefix uri)
(type namespace-registry registry)
(values prefix-qualified-namespace
simple-string &optional))
(let ((pfx (simplify-string prefix))
(urix (simplify-string uri)))
(declare (type simple-string pfx urix))
(block local-binding
(labels ((bind-ns-uri ()
;; 1) check for URI in Registry
;; 1.A) if not, create namespace, initial prefix binding,
;; and add to registry, emit signal PREFIX-BIND (?)
;; 1.B) if so, determine whether prefix exists for namespace
;; 1.B.A) if so, return
;; 1.B.B) if not, add prefix to namespace, emit signal
;; PREFIX-BIND
(multiple-value-bind (ns ns-new-p)
(compute-namespace uri registry t)
(flet ((add-prefix ()
(assert-not-finalized ns
"Unable to add prefix ~s"
pfx)
;; FIXME: Thread safety onto NS - lock NS
(vector-push-extend pfx (namespace-prefix-table ns)
#.+qname-buffer-extent+)
(restart-case
(signal 'namespace-prefix-bind
:namespace ns
:name pfx)
(continue ()
(bind-ns-uri)))
(values ns pfx)))
(cond
(ns-new-p (add-prefix))
(t
(let ((pf-p (find-prefix pfx ns nil)))
(cond
;; scan for prefix
(pf-p (return-from local-binding
(values ns pf-p)))
(t (add-prefix)))))))))
(bind-ns-prefix ()
;; 0) check for prefix in registry (locating namespace
;; if available)
;; 0.A) If so: Check for string equivalence to URI
;; 0.A.A) If so, return
;; 0.A.B) If not: remove prefix, emit signal PREFIX-UNBIND
(multiple-value-bind (ns-p pf-p)
(resolve-prefix-namespace pfx registry nil)
(cond
((and ns-p (string= (namespace-string ns-p) urix))
(return-from local-binding
(values ns-p pf-p)))
((and ns-p move-p)
(assert-not-finalized ns-p
"Unable to add prefix ~s"
pf-p)
;; FIXME: Thread safety onto NS-P - lock NS-P
(setf (namespace-prefix-table ns-p)
(delete pf-p (namespace-prefix-table ns-p)
:test #'eq))
;; FIXME: when the unbind signal is caught in
;; a containing handler-case calling this function
;; within its body, then even after 'continue' in that
;; handler-case, the later binding is not made
(restart-case
(signal 'namespace-prefix-unbind
:name pf-p
:namespace ns-p)
(continue ()
;; How to ensure that BIND-NS-URI is called
;; after control flow returns (?) to this function?
(bind-ns-uri))))
(ns-p
(error 'prefix-already-bound-error
:name pf-p
:namespace ns-p))
))))
(bind-ns-prefix)
(bind-ns-uri))
))) ;; defun
;; FIXME: For XML namespace support, defun ADD-DEFAULT-XML-NAMESPACES
;; cf. "xml" and "xmlns" prefixes' standard namespace bindings
#|
(progn ;; test harness setup
(defparameter *r* (make-namespace-registry))
(defparameter *foo* (simplify-string "foo"))
(defparameter *foo.ex* (simplify-string "http://foo.example.com/"))
(defpackage #.*foo.ex* (:use) (:nicknames "NS/FOO"))
)
(compute-namespace *foo.ex* *r* t)
;; => #<...>, t ; first call
;; => #<...>, nil ; later calls
(eq (compute-namespace *foo.ex* *r*)
(compute-namespace *foo.ex* *r*)
)
;; => T
(multiple-value-bind (ns pfx)
(bind-prefix *foo* *foo.ex* *r* t)
(values (eq pfx *foo*) ns )
)
;; => T, #<structure-object ...>
;; (resolve-prefix-namespace "foo" *r*) ;; OK
;; (resolve-prefix-namespace "nope" *r*) ;; expect error
;; (resolve-prefix-namespace "2xNull" *r* nil) ;; expect NIL, NIL
;; (namespace-registry-prefix-table *r*)
;; ^ informative
(= (length (namespace-registry-prefix-table *r*)) 1)
;; => T
(bind-prefix "bar" *foo.ex* *r* t)
;; ^ when called multiple times, should not be duplicating prefixes
;; an example of appropriate handling for namespace-perfix-unbind,
;; such that the handler results in completion of the later binding
;; behavior:
(handler-bind ((NAMESPACE-PREFIX-UNBIND
#'(lambda (c)
(declare (ignore C))
(invoke-restart 'CONTINUE))))
(progn
(defpackage "http://bar.example.com/")
(defparameter *r* (make-namespace-registry))
(bind-prefix *foo* *foo.ex* *r* t)
(bind-prefix "bar" *foo.ex* *r* t)
(bind-prefix "bar" "http://bar.example.com/" *r* t)
(length (namespace-registry-prefix-table *r*))
))
;; => 2
;;; "last test"
(handler-case
(bind-prefix (string (gensym "NS-")) "http://bar.example.com/" *r*)
(namespace-prefix-bind (c)
(warn "Caught bind signal: ~s" c)
(continue c)))
;; ^ always adds a new prefix. cf:
(namespace-registry-prefix-table *r*)
|#
;;; * QName Resolvers
(defun compute-qname (cname registry &optional ensure)
(declare (type string cname)
(type namespace-registry registry)
(values (or simple-string null)
namespace &optional))
(multiple-value-bind (prefix name)
(split-string-1 #\: cname)
(when prefix
(unless (cxml::valid-ncname-p prefix)
(error 'type-error :expected-type 'ncname :datum prefix)))
(unless (cxml::valid-ncname-p name)
(error 'type-error :expected-type 'ncname :datum name))
(let ((ns (cond
(prefix (resolve-prefix-namespace prefix registry))
(t (namespace-registry-null-namespace registry)))))
(cond
(ns
;; NB: may result in NAME-NOT-FOUND error (note in docs)
(values (compute-qname-string name ns ensure)
ns))
(t
(error 'prefix-not-found-error
:name prefix
:namespace registry))))))
;; (compute-qname "FOO" (make-namespace-registry) t)
(defun compute-qname-symbol (cname registry &optional ensure)
(declare (type string cname)
(type namespace-registry registry)
(values symbol namespace &optional))
(multiple-value-bind (ncname ns)
;; NB: may result in NAME-NOT-FOUND error (note in docs)
(compute-qname cname registry ensure)
;; Note than when #+:SYMBOL-NAME-EQ this results in
;; (intern (symbol-name (intern ncname p)) p)
(values (intern ncname (namespace-package ns))
ns)))
#|
;; test harness setup
(defparameter *foo.ex* (simplify-string "http://foo.example.com/"))
(progn
(defparameter *r* (make-namespace-registry))
(defparameter *foo* (simplify-string "foo"))
(defpackage #.*foo.ex* (:use) (:nicknames "NS/FOO"))
(defparameter *ns* (bind-prefix *foo* *foo.ex* *r*))
)
(multiple-value-bind (s ns)
(compute-qname-symbol "foo:FOO" *r* t)
(values (eq ns *ns*) s))
;; =EXPECT=> T, |http://foo.example.com/|::FOO
|#
(defun ensure-standard-namespaces (registry)
(declare (type namespace-registry registry)
(values namespace-registry &optional))
(dolist (spec
'(("xml" . "http://www.w3.org/XML/1998/namespace")
("xmlns" . "http://www.w3.org/2000/xmlns/"))
registry)
(destructuring-bind (pfx . uri) spec
(bind-prefix pfx uri registry t))))
#|
;; test harness setup
(defparameter *foo.ex* (simplify-string "http://foo.example.com/"))
(progn
(defparameter *r* (make-namespace-registry))
(defparameter *foo* (simplify-string "foo"))
(defpackage #.*foo.ex* (:use) (:nicknames "NS/FOO"))
(defparameter *ns* (bind-prefix *foo* *foo.ex* *r*))
)
(progn
(ensure-standard-namespaces *r*)
(multiple-value-bind (s ns)
(compute-qname-symbol "foo:FOO" *r* t)
(values (eq ns *ns*) s)))
;; =EXPECT=> T, |http://foo.example.com/|::FOO
(progn
(ensure-standard-namespaces *r*)
(multiple-value-bind (s ns)
(compute-qname-symbol "xml:id" *r* t)
(values (eq s 'ns/xml::|id|)
(eq (namespace-package ns)
(find-package "http://www.w3.org/XML/1998/namespace")))
))
;; => T, T
|#
| 25,284 | Common Lisp | .lisp | 670 | 33.362687 | 73 | 0.692399 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | e0306484d6ab96e1d71718dc129d1b3f6c9ea93433afc3a349a355f8f127bf3f | 27,610 | [
-1
] |
27,611 | package.lisp | GazeboHub_lupine-m2/module/mop/src/main/lisp/package.lisp |
(in-package #:cl-user)
(defpackage #:lupine/mop
(:use #:c2mop #:lupine/aux #:cl)
#+(or CMU SBCL)
(:shadowing-import-from
#+sbcl #:sb-pcl
#+cmu #:pcl
#:validate-superclass)
(:shadowing-import-from
#:c2mop
#:defmethod
#:defgeneric
#:standard-generic-function
)
(:export
#:class-designator
#:compute-class
#:compute-direct-slot-definitions
#:slot-definition-not-found
#:direct-slot-definition-not-found
#:find-slot-definition
#:find-direct-slot-definition
)
)
(let ((p (find-package '#:lupine/mop)))
(do-external-symbols (s '#:c2mop)
(export s p)))
| 625 | Common Lisp | .lisp | 27 | 19.222222 | 39 | 0.652101 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 5806b4a0cab9edacf36fe593541ec58626cc75afb2d1820542ea12061af96b13 | 27,611 | [
-1
] |
27,612 | ext-std-class.lisp | GazeboHub_lupine-m2/module/mop/src/main/lisp/ext-std-class.lisp |
(in-package #:lupine/mop)
(defclass extended-standard-class (standard-class)
())
(defmethod validate-superclass ((class extended-standard-class)
(superclass standard-class))
t)
(defmethod direct-slot-definition-class
((class extended-standard-class) &rest initargs)
;; this system could endeavor to use an initarg-centric sorting
;; method, in defining a sort of "slot definition module"
;; architecture
;;
;; If each slot definition extension "module" would be assigned a
;; single slot definition initarg or "initarg signature", such that
;; would effectively signify the class of either or both of the
;; direct and effective slot definitions, in the containing class,
;; for the containing slot definition, then each slot definition
;; "module" should be provided with a protocol for defining its
;; "initarg signature" and registering the "module" to a central
;; "module registry"
(cond
((getf initargs :null-unbound)
(find-class 'direct-null-unbound-slot-definition))
(t (call-next-method))))
(defmethod effective-slot-definition-class
((class extended-standard-class) &rest initargs)
(let* ((name (getf initargs :name))
(dslotds (compute-direct-slot-definitions name class)))
(cond
((member-typep 'direct-null-unbound-slot-definition dslotds)
;; FIXME: "This gets the job done," but it may be an inefficient
;; approach for multiple dispatching, to use MEMBER-TYPEP as
;; such. Consider developing a MAP-DIRECT-SLOTS procedure,
;; instead (?)
(find-class 'effective-null-unbound-slot-definition))
(t (call-next-method)))))
#| Tests : Null-Unbound Slot Definition Framework
(defclass foo ()
((a)
(b :null-unbound t))
(:metaclass extended-standard-class))
(progn
(finalize-inheritance (find-class 'foo))
(member-typep 'effective-null-unbound-slot-definition
(class-slots (find-class 'foo))))
;; => (not nil)
(let ((it (compute-direct-slot-definitions 'b 'foo)))
(and (car it) (null (cdr it))
(typep (car it) 'direct-null-unbound-slot-definition)))
;; => T
(defclass bar (foo)
((b))
(:metaclass extended-standard-class))
(progn
(finalize-inheritance (find-class 'bar))
(member-typep 'effective-null-unbound-slot-definition
(class-slots (find-class 'bar))))
;; => (not nil)
(let ((it (class-direct-slots (find-class 'bar))))
(member-typep 'direct-null-unbound-slot-definition it))
;; => NIL, NIL
(defclass quux (bar)
()
(:metaclass extended-standard-class))
(progn
(finalize-inheritance (find-class 'bar))
(member-typep 'effective-null-unbound-slot-definition
(class-slots (find-class 'bar))))
;; => (not nil)
(let ((it (class-direct-slots (find-class 'bar))))
(member-typep 'direct-null-unbound-slot-definition it))
;; => NIL, NIL
|#
| 2,814 | Common Lisp | .lisp | 73 | 35.150685 | 71 | 0.713603 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | e41c507c019da7025aec5b265de6a7467337eef7c27229d147b88a98923efdb7 | 27,612 | [
-1
] |
27,613 | aux.lisp | GazeboHub_lupine-m2/module/mop/src/main/lisp/aux.lisp |
(in-package #:lupine/mop)
(defun compute-direct-slot-definitions (name class)
(declare (type symbol name)
(type class-designator class)
(values list &optional))
(let* ((c (compute-class class))
(ds (class-direct-slots c))
(it (find name ds :key #'slot-definition-name :test #'eq)))
(flet ((compute-on-dsupers ()
(mapcan #'(lambda (c)
(compute-direct-slot-definitions name c))
(cdr (class-precedence-list c)))))
(cond
(it (cons it (compute-on-dsupers)))
(t (compute-on-dsupers))))))
;; (defclass a () ((a-1)))
;; (defclass b (a) ((b-1) (a-1)))
;; (defclass c (b) ((a-1) (b-1) (c-1)))
;; (dolist (it '(a b c)) (finalize-inheritance (compute-class it)))
;; (compute-direct-slot-definitions 'a-1 'c)
(define-condition slot-definition-not-found (name-not-found-error)
()
(:report
(lambda (c s)
(format s "Slot definition ~s not found in ~s"
(name-condition-name c)
(namespace-condition-namespace c)))))
(define-condition direct-slot-definition-not-found (slot-definition-not-found)
()
(:report
(lambda (c s)
(format s "Direct slot definition ~s not found in ~s"
(name-condition-name c)
(namespace-condition-namespace c)))))
(defun find-slot-definition (name class &optional (errorp t))
(declare (type symbol name)
(type class-designator class)
(values (or slot-definition null) &optiona))
(let* ((c (compute-class class))
(it (find name (class-slots c)
:key #'slot-definition-name
:test #'eq)))
(cond
(it (values it))
(errorp (error 'slot-definition-not-found
:name name :namespace c))
(t (vaules nil)))))
(defun find-direct-slot-definition (name class &optional (errorp t))
(declare (type symbol name)
(type class-designator class)
(values (or slot-definition null) &optiona))
(let* ((c (compute-class class))
(it (find name (class-direct-slots c)
:key #'slot-definition-name
:test #'eq)))
(cond
(it (values it))
(errorp (error 'direct-slot-definition-not-found
:name name :namespace c))
(t (vaules nil)))))
#|
(defclass a () ((a.1)))
(defclass b (a) ((b.1)))
(finalize-inheritance (find-class 'a))
(finalize-inheritance (find-class 'b))
(find-slot-definition 'a.1 'b)
(find-slot-definition 'a.1 'a)
(find-direct-slot-definition 'a.1 'b) ;; err
(find-direct-slot-definition 'a.1 'a)
(find-direct-slot-definition 'b.1 'b)
(find-direct-slot-definition 'b.1 'a) ;; err
|# | 2,499 | Common Lisp | .lisp | 72 | 30.486111 | 78 | 0.645643 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | f11431587a211a5b123c4429132db55410e870c638a510d581fbd28626e88993 | 27,613 | [
-1
] |
27,614 | null-unbound-slotd.lisp | GazeboHub_lupine-m2/module/mop/src/main/lisp/null-unbound-slotd.lisp |
(in-package #:lupine/mop)
(defclass null-unbound-slot-definition ()
((null-unbound
;; FIXME: This slot is defined only to consume the :null-unbound
;; initialization argument at slot definition initialization time,
;; and is otherwise unused
:initform t
:initarg :null-unbound
:allocation :class
)))
(defmethod slot-value-using-class (class instance
(slotd null-unbound-slot-definition))
(cond
((slot-boundp-using-class class instance slotd)
(call-next-method))
(t (values))))
(defclass effective-null-unbound-slot-definition
(null-unbound-slot-definition standard-effective-slot-definition)
())
;; FIXME: When parsing the defclass form for a class that may be
;; defined with null-unbound slot definitions, parse each direct slot
;; definition for the :null-unbound initarg and its value. If the
;; :null-unbound initarg is present and has a non-null value, then
;; initialize the slot definition as a
;; direct-null-unbound-slot-definition. Else, "prefer next method"...
;; FIXME: When defining a subclass of a class whose deinition contains
;; a direct null-unbound slot definition, permit the direct and
;; effectivr slot definitions' class selection to be overridden, if
;; that slot's defition in the subclass is provided with a
;; ':null-unbound nil' initarg/value pair
(defclass direct-null-unbound-slot-definition
(null-unbound-slot-definition standard-effective-slot-definition)
())
;; FIXME: Integrate this "null-unbound" slot definition protocol into
;; the class definitions in core-classes.lisp
;; ... defclass standard-class* ??
;; (refer to documentation, cf. AMOP)
#+NIL
(define-slot-definition-module ;; ??? (this is a prototype form)
(null-unbound-slot-definition)
((:direct-slotd-class direct-null-unbound-slot-definition)
(:effective-slotd-class effective-null-unbound-slot-definition)
(:direct-slotd-test
(lambda (&rest args &key (null-unbound nil nup) &allow-other-keys)
(when nup (values t))))))
#+nil
(defgeneric module-active-p (module class &rest initargs
&key &allow-other-keys)
(:method ((module slot-definition-module)
(class extended-standard-class)
&rest initargs)
(apply (module-signature-test-function module) initargs)))
| 2,289 | Common Lisp | .lisp | 52 | 40.5 | 70 | 0.741007 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 6cb51598470e1d76e70a264223883a031eae286580ae96278dcf206d4acfe7c1 | 27,614 | [
-1
] |
27,615 | package.lisp | GazeboHub_lupine-m2/module/xpc/src/main/lisp/package.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(defpackage #:lupine/xpc
(:use #:lupine/ns #:lupine/ucx #:lupine/aux #:cl)
(:export
))
| 380 | Common Lisp | .lisp | 11 | 31.636364 | 70 | 0.742466 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 6514aac0a126f44f56103060d5d119707b9a6f5e0045b808c1ce37e33c276480 | 27,615 | [
-1
] |
27,616 | scan.lisp | GazeboHub_lupine-m2/module/xpc/src/main/lisp/scan.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/ucx)
(define-condition frob (program-error) ;; temporary name in defn
())
(defstruct (qname
(:constructor make-qname (namespace local-name)))
;; FIXME: Integrate with the namespace resolver framework
#+NIL (namespace (error 'frob) :type namespace)
;; FIXME: use :QNAME-OVERRIDE style namespace binding onto QNAME objects
(namespace (error 'frob) :type (or simple-string null))
(local-name (error 'frob) :type simple-ncname))
(defun qname-string (qname)
(declare (type qname qname)
(values simple-string))
(let ((ns (qname-namespace qname))
(n (qname-local-name qname)))
(cond
(ns (format nil "{~a}~a" ns n))
(t (values n)))))
;; (qname-string (make-qname "http://a.example.com/" "b"))
(defun qname= (q1 q2)
(declare (type qname q1 q2)
(values boolean &optional))
(let ((ns-1 (qname-namespace q1))
(ns-2 (qname-namespace q2)))
(and (or (when (and ns-1 ns-2)
(string= (the simple-string ns-1)
(the simple-string ns-2)))
(and (null ns-1) (null ns-2)))
(string= (qname-local-name q1)
(qname-local-name q2)))))
(defun qname=* (ns lname q)
(declare (type (or null simple-string) ns)
(type simple-string lname)
(type qname q)
(values boolean &optional))
(let ((ns-q (qname-namespace q)))
(and (or (when (and ns ns-q)
(string= (the simple-string ns)
(the simple-string ns-q)))
(and (null ns) (null ns-q)))
(string= lname (qname-local-name q)))))
#|
;;; Test QNAME=*, QNAME=
(let ((data '((t
("http://foo.example.com/" . "FOO")
("http://foo.example.com/" . "FOO"))
(t
(nil . "FOO")
(nil . "FOO"))
(nil
(nil . "FOO")
("http://foo.example.com/" . "FOO"))
(nil
("http://foo.example.com/" . "FOO")
(nil . "FOO"))
(nil
("http://a.foo.example.com/" . "FOO")
("http://b.foo.example.com/" . "FOO")))))
(dolist (spec data t)
(destructuring-bind (result (ns-1 . lname-1) (ns-2 . lname-2))
spec
(unless
(eq result
(qname= (make-qname ns-1 lname-1)
(make-qname ns-2 lname-2)))
(error "QNAME= test failed, input ~s" spec))
(unless
(eq result
(qname=* ns-1 lname-1
(make-qname ns-2 lname-2)))
(error "QNAME=* test failed, input ~s" spec)))))
;; => T
|#
(defstruct (simple-container
(:constructor make-simple-container ()))
(contents nil :type list))
(defmethod print-object ((object simple-container) stream)
(print-unreadable-object (object stream :type t :identity t)
(format stream "(~d)" (length (simple-container-contents object)))))
(defstruct (simple-node
(:include simple-container)
(:constructor make-simple-node (element &optional parent)))
(element (error 'frob) :type qname)
(parent nil :type (or simple-container null)))
(defmethod print-object ((object simple-node) stream)
(print-unreadable-object (object stream :type t :identity t)
(format stream "~a (~d)"
(qname-string (simple-node-element object))
(length (simple-container-contents object)))))
#+NIL
(declaim (optimize (speed 0) (safety 3) (debug 3)))
(defun scan-element-types (source)
;; Prototype for a basic XML paser, using Klacks
(declare (type parser-input-source source)
#+NIL (values list boolean &optional))
(let ((event-handler (cxml:make-source source))
(tree nil)
(node nil))
(klacks:with-open-source (s event-handler)
(loop
;; FIXME: &REST not allowed in MV-BIND
;; see also: read-xmi
(destructuring-bind (event-type &rest event-data)
;; NB: The "Variable number of return values" behavior
;; used in KLACKS:CONSUME and similar functions may seem
;; to essentially require some consing, to capture the
;; variable number of return values after the first return
;; value, for every Klacks event type
(multiple-value-list (klacks:consume s))
;; FIXME: It's stuck in a loop, after end packagedElement
(ecase event-type
((nil)
(return (values tree nil)))
(:start-document
(setq tree (make-simple-container)
node tree))
(:dtd)
(:start-element ;; uri, lname, qname
;; NB: This functions scans element names,
;; does not map-attributes
(destructuring-bind (uri lname qname)
event-data
(declare (type (or null simple-string) uri)
(type simple-string lname)
(ignore qname))
(flet ((add-node ()
(let ((n (make-simple-node (make-qname uri lname)
node)))
#+NIL (warn "START: ~S (~s)" n node)
(setf (simple-container-contents node)
(push n (simple-container-contents node)))
(setq node n))))
(add-node))))
(:end-element
#-SKIP-NODE
(flet ((finalize-node ()
#+NIL (warn "END ~s" node)
(setf (simple-container-contents node)
(nreverse (simple-container-contents node)))
(setq node (simple-node-parent node))))
#-SKIP-NODE
(finalize-node)))
(:characters)
(:processing-instruction)
(:comment)
(:end-document
(return (values tree nil))
)))))))
(defgeneric tree-to-list (container)
(:method ((container simple-container))
(mapcar #'tree-to-list (simple-container-contents container)))
(:method ((container simple-node))
(let ((name (qname-string (simple-node-element container))))
;; (warn "TREE-TO-LIST ~S" name)
(cons name
(call-next-method)))))
#|
(trace simple-node-parent)
(defparameter *tree*
(scan-element-types
(merge-pathnames
"../../../../../module/xmi/src/main/xmi/UML.xmi"))
)
;; note that PUSH results in the elements occurring in reverse order
;; in the result set, compared to their order in the input set.
;; (Thus, the corresponding NREVERSE call)
(simple-container-contents (car (simple-container-contents *tree*)))
;; FIXME: SCAN... is not nesting the result set correctly to the
;; nesting of the input set. It seems that many elements are being
;; skipped, entirely.
(princ (tree-to-list *Tree*) t)
|#
| 6,341 | Common Lisp | .lisp | 179 | 30.653631 | 74 | 0.646972 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 8bc6aec110b23e00893740381d394e1b6c5414952a582ddc184d42c1e39fe143 | 27,616 | [
-1
] |
27,617 | model.lisp | GazeboHub_lupine-m2/module/xmi/src/main/lisp/model.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/xmi)
(defclass model ()
())
(defclass simple-model ()
;; model with a single source
((source
:intiarg :source
:type uri
:accessor model-source)))
(defclass standard-model (simple-model)
())
| 521 | Common Lisp | .lisp | 18 | 25.833333 | 70 | 0.735354 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 4f7b96c05a2ea1c10d64d17605fcab84a095d37042dc4c63c7b330d91a92ca15 | 27,617 | [
-1
] |
27,618 | package.lisp | GazeboHub_lupine-m2/module/xmi/src/main/lisp/package.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:cl-user)
(defpackage #:lupine/xmi
(:use #:lupine/ns #:lupine/final
#:cxml #:lupine/mop #:puri
#:lupine/aux #:cl)
#+(or CMU SBCL)
(:shadowing-import-from
#+sbcl #:sb-pcl
#+cmu #:pcl
#:validate-superclass)
(:shadowing-import-from
#:c2mop
#:defmethod
#:defgeneric
#:standard-generic-function)
(:export
#:+xmi-2.4.1-namespace-uri+
#:+uml-2.4.1-namespace-uri+
#:+mofext-2.4.1-namespace-uri+
#:read-xmi
))
;; NB: See also package-late.lisp
;; for package-late.lisp
(in-package #:lupine/xmi)
(defconst +xmi-2.4.1-namespace-uri+
(simplify-string "http://www.omg.org/spec/XMI/20110701")
"Namespace URI for XMI 2.4.1
See also:
* <http://www.omg.org/spec/XMI/20110701/XMI.xsd>
* Package NS/XMI/2.4.1")
(defconst +uml-2.4.1-namespace-uri+
(simplify-string "http://www.omg.org/spec/UML/20110701")
"Namespace URI for UML 2.4.1 serialized as XMI
See also:
* Package NS/UML/2.4.1")
(defconst +mofext-2.4.1-namespace-uri+
(simplify-string "http://www.omg.org/spec/MOF/20110701")
"Namespace URI for 'mofext' XMI element namespace
See also:
* Package NS/MOFEXT/2.4.1")
| 1,435 | Common Lisp | .lisp | 47 | 27.468085 | 70 | 0.701384 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | ac894e46dce65e8f4bb7b40489b3c12761d7e0443e16672b7e4f2d0b226f8927 | 27,618 | [
-1
] |
27,619 | transform.lisp | GazeboHub_lupine-m2/module/xmi/src/main/lisp/transform.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/xmi)
#| Here-Documentation (Markdown Format)
refer to ./transform.md
|#
;;; * Metaclasses
#+NIL
(defclass lupine-standard-class (standard-class)
;; FIXME: Improve and utilize lupine-mop "read-only standard
;; slots" protocol in this metaclass' instances
())
(defclass model ()
((source-serialization-model
:type serialization-model
:initarg :source-serialization-model
:reader model-source-serialization-model
;; :read-only t
)
(source
:type uri
:initarg :source
:reader model-source)
(source-encoding
;; should be a symbol interned in #:XML/ENCODING
;; (FIXME: Denote that package and its usage, in the codebase
;; documentation)
:type symbol
:initarg :source-encoding
:accessor model-source-encoding
;; FIXME: Provide recode functionaliy on slot-value change.
;; (low-priority; complex procedures for nested model string
;; element iteration and recoding)
)
(id-table
;; FIXME: Implement this slot
;; Note also in documentation: Persistent element IDs
)
(ns-registry
;; NB: This slot consumes the :namespaces instance initarg
:type namespace-registry
:accessor model-namespace-registry)
)
#+NIL (:metaclass lupine-standard-class) ;; cf :READ-ONLY slots
)
(defmethod shared-initialize :after ((instance model)
slots &rest initargs
&key namespaces &allow-other-keys)
(declare (ignore slots initargs))
(when namespaces
(flet ((ensure-nsreg ()
(cond
((slot-boundp instance 'ns-registry)
(model-namespace-registry instance))
(t
(let ((nsreg (make-namespace-registry)))
(setf (model-namespace-registry instance)
nsreg))))))
(let ((nsreg (ensure-nsreg)))
(ensure-standard-namespaces nsreg)
(dolist (ns namespaces)
(destructuring-bind (prefix . uri) ns
(bind-prefix prefix uri nsreg t)))))))
#| TEST
(defparameter *m*
(make-instance 'model
:namespaces
'(("uml" . "http://www.omg.org/spec/UML/20110701" )
("xmi" . "http://www.omg.org/spec/XMI/20110701" )
("mofext" . "http://www.omg.org/spec/MOF/20110701")
)))
(mapcar #'(lambda (n)
(compute-qname-symbol n (model-namespace-registry *m*)))
'("xmi:XMI" "uml:Package" "mofext:Tag"))
|#
(defclass serialization-model (model)
((model-class
;; cf. ALLOCATE-MODEL, BOOTSTRAP-METAMODEL
:type class-designstor
:initarg :model-class
:accessor serialization-model-model-class)
(qname-override-p
;; FIXME: Use this slot's value during qname resolution in
;; TRANSFORM-ELEMENT cf. Namespaces.md (Lupine-XMI Documentation)
:type boolean
:initarg :qname-override
:accessor serialization-model-qname-override-p
)
))
;;; * Element transformation protocol
(defgeneric allocate-model (encoding source serialzation-model)
(:method ((encoding symbol) (source t)
(serialization-model bootstrap-metamodel))
;; the bootstrap-metamodel is used effectively to bootstrap itself
(setf (model-source serialization-model) source)
(setf (model-source-encoding serialization-model) encoding)
(values serialization-model))
(:method ((encoding symbol) (source t)
(serialzation-model serialization-model))
(let ((m (allocate-instance
(find-class
(serialization-model-model-class serialzation-model)))))
(setf (model-source m) (compute-source-uri source))
(setf (model-source-encoding m) encoding))))
(defgeneric compute-element-class (qname namespace name
model serialzation-model)
(:method ((qname symbol) (ns simple-string) (name simple-string)
(model bootstrap-metamodel) (source t)
(serialization-model serialzation-model))
(declare (ignore ns name model source serialization-model))
;; FIXME (Documentation) : Denote this usage of
;; (namespace, package, symbol, class name)
;; with regards to BOOTSTRAP-METAMODEL
(find-class qname nil)))
;; To Do: Determine the relation between "Property type" and
;; "metaclass contained by property"
;;
;; e.g. with regards to the definition of the packagedElement
;; package property in the following excerpt from UML.xmi
;;
;; <xmi:XMI ...
;; <uml:Package xmi:type="uml:Package" name="UML"
;; URI="http://www.omg.org/spec/UML/20110701">
;; <packagedElement name="Package"
;; xmi:type="uml:Class" ...
;; <ownedAttribute name="packagedElement"
;; xmi:type="uml:Poperty"
;; type="PackagableElement" ...
;; Some observations:
;;
;; * packagedEleent is the name of a property defined to the
;; UML::Package metaclass. packagedElement is not in itself a
;; UML metaclass.
;;
;; * The xmi:type defined for pacakgedElement as an
;; ownedAttribute belongs effectively to the packagedElement
;; element itself - the element defined in the given
;; specification - it denoting that element's type within
;; the element's (in this case, property) relation to its
;; containing metaclass, namely UML::Package
;;
;; * The non-namespace-qualified 'type' attribute denotes a
;; base type for elements defined in that relation. As
;; demonstrated in the example itself, a packagedElement
;; declaration may serve to define a type extending that
;; base type for the packagedElement property - as noting that
;; uml:Class is a subtype of PackagableElement
;;
;; So, in extensional conclusions:
;; 1) Insofar as the type of the property specified in the
;; element is known (as would be known in a fully defined
;; metamodel), a call to change-class may not be
;; needed. Note that ownedAttribute defines a relation of
;; a property to a metaclass (as of the packagedElement
;; relation in its relation to the Package metaclass).
;; Inasmuch, the specification of @xmi:type="uml:Property"
;; would seem redundant
;;
;; 2) In NS/XMI:|type| the class of the element being defined
;; to its containing element or model is published - as
;; with the uml:Property type of the packagedElement
;; relation thusly fedined
;;
;; 3) Insofar a uml:Property defines a relation between
;; subject and object - as with a tuple (s,p,o) in
;; defining p' as the property - the
;; non-namespace-qualified 'type' attribute denotes the
;; type of the object in that relation, not of the
;; relation in itself
;; Note also: once the instance is created (whether as an
;; instance of a forward-referenced class or otherwise), it
;; must be bound to its container e.g. (FIXME TO DO)
;;
;; (BIND-ELEMENT ELEMENT PROPERTY CONTAINER)
;;
;; in which case the PROPERTY (if a named element) takes up
;; its qualified, compound name (as derived from its name and
;; the name of the direct and effective containers)
;;
;; see also: IMPORT-ELEMENT (TO DO) cf package import
;; relations in UML
(defgeneric allocate-element (qname namespace name
model source serialzation-model)
(:method ((qname symbol) (ns simple-string) (name simple-string)
(model bootstrap-metamodel) (source t)
(serialization-model serialzation-model))
;; FIXME: Later, audit this method for application not only w.r.t
;; BOOTSTRAP-METAMODEL, BOOTSTRAP-METAMODEL-ELEMENT (broaden)
;; See also: COMPUTE-QNAME-SYMBOL; UML-CLASS
;; To a note about how the XMI evaluator may operate:
;;
;; Functionally, the xmi:XMI element serves as a contaier for an
;; XML-encoded UML metamodel, such that in UML.xmi[1] serves as a
;; serialization of the UML metamodel itself - where, in effect,
;; the XMI UML encoding is serving as a sort of functional
;; meta-metamodel (introducing, perhaps, some conceputal ambiguity
;; with regards to MOF) a sort of functional meta-metamodel in
;; which the UML metamodel itself is encoded
;;
;; Functionally, Lupine-XMI will regard each xmi:XMI element as
;; it introducing a new model - whether that model represents a
;; meta-model or simply a user model.
;;
;; Specifically in regards to UML.xmi, xmi:XMI contains two
;; elements - once, a 'uml:Package' element (UML 2.4.1
;; namespace[2]) defining the package named "UML", in its entire
;; conjoined infrastructure/superstructure model[3]. The second
;; element represents an XML namespace prefix for that package,
;; explicitly encoded in addition to the 'URI' property contained
;; on the previous UML package element
;;
;; Concerning what the processing model must consume, on processing
;; the contents of uml:Pacakge: Every element defined within that
;; 'uml:Package' XML element is defined within a 'packagedElement'
;; XML element.
;;
;; [1] <http://www.omg.org/spec/UML/20110701/UML.xmi>
;; [2] <http://www.omg.org/spec/UML/20110701>
;; [3] Effectiely, UML.xmi serves to present the
;; UML superstructure after all package merge operations. Although
;; the package structure presented in UML.xmi does not match
;; the package structure presented in either Infrastructure.xmi
;; or Supersturcture.xmi, but at least in regards to that the
;; "UML" package in UML.xmi may represent the only normative
;; definition of the "UML" package together with its namespace
;; URI[2], perhaps it may be implied that UML.xmi represents
;; the exclusive normative encoding of UML 2.4.1 such as may be applied for purpose for XMI format model
;; serializations
(let ((c (compute-element-class qname ns name
model serialization-model)))
;; usage:
;; 1. Inputs:
;; qname = UML::|Package|
;; ns="http://www.omg.org/spec/UML/20110701"
;; name="Package"
;; model, serilization-model ...
;;
;; Intended behavior: find class UML::|Package|,
;; allocate-instance of that class
;; 2 Inputs:
;; qname = UML::|packageImport|
;; ns="http://www.omg.org/spec/UML/20110701"
;; name="packageImport"
;; model, serilization-model ...
;;
;; Intended behavior: allocate an instance of a class for
;; represeting the property defined in the packageImport
;; specification.
;;
;; (find-class (quote UML::packageImport)) may suffice
;;
(allocate-instance c))
))
(defgeneric apply-atrribute (value qname namespace name element
model source serialzation-model)
;; FIXME: move defmethods to after bootstrap-metamodel-element class definition
(:method ((value simple-string)
(qname (eql ns/xmi:|type|))
(ns simple-string) (name simple-string)
(element bootstrap-metamodel-element)
(model bootstrap-metamodel)
(source t) (serialization-model serialzation-model))
(let ((type (normalize-string value)))
(multiple-value-bind (prefix name)
(split-string-1 #\: type)
;; FIXME: If COMPUTE-ELEMENT-CLASS does not return a class, define a
;; FORWARD-REFERENCED-CLASS with TYPE denoting the cname
;; of that class - deriving the metaclass of that class from
;; MODEL or SERIALIZATION-MODEL
;;
;; ^ wrap in an ENSURE-METACLASS call
(let ((c (compute-element-class
;; FIXME: ^ what function to call, there?
(compute-qname-symbol
type
(model-namespace-registry
;; FIXME:
;; use model or serialiation-model here?
serialization-model)))))
(change-class element c)))
(:method ((value simple-string)
(qname symbol)
(ns simple-string) (name simple-string)
(element bootstrap-metamodel-element)
(model bootstrap-metamodel)
(source t) (serialization-model serialzation-model))
;; FIXME: Later, audit this method for application not only w.r.t
;; BOOTSTRAP-METAMODEL, BOOTSTRAP-METAMODEL-ELEMENT (broaden)
;; FIXME: "REAL WORK HERE"
;; See first: allocate-element, UML class definition, and
;; UML-CLASS "Property table" slot definitions (special cases:
;; generalizations, owned attributes, owned operations, owned
;; rules cf. OCL, and documentation-stub handling. also address
;; UML associations and UML enumeration metaclasses)
;; NB also: (eql ns/xmi:type) and CHANGE-CLASS (w.r.t class
;; selection in ALLOCATE-ELEMENT, and the specifications by which
;; that behavior will be defined in the Lupine-XMI UML
;; stub/metamodel unmarshaling protocol)
))
(defgeneric add-element (element container
model serialization-model))
;; ^ FIXME: In conceptual regards, clarify whether that function is
;; for adding an XML element or a model element. Contrast with
;; ADD-TYPED-RELATION
;; ^ FIXME (TO DO): Note that behaviors of ADD-ELEMENT may
;; differ per the type of the ELEMENT. For instance, a
;; packageImport element when added to a Package must result in the
;; imported package's contents becoming visible in the containing
;; package - such that must be handled in add-allocated-element,
;; however exactly "packaged element->package" visibility may
;; ultimately be handled in the Project Lupine UML API -
;; wheres a packagedElement being added to a package simply represents
;; the binding of a definition by way of a packagedElement property,
;; within the containing package.
#|
# UML Primitive Types
### UML PrimitiveTypes Package
* Package URI: <http://www.omg.org/spec/PrimitiveTypes/20110701>
### Primtiive Types - Mapping to Common Lisp (Trivial)
* PrimitiveTypes::Boolean -> CL:BOOLEAN
* PrimitiveTypes::Integer -> CL:INTEGER
* PrimitiveTypes::Real -> CL:REAL
* PrimitiveTypes::String -> CL:STRING
* PrimittiveTypes::UnlimitedNatural -> (or unsigned-byte (eql :*))
# Model Elements
## Model Element Types (Bootstrap model)
### Abstract Element Types (Bootstrap model)
* UML::Element
* UML::NamedElement
* UML::Namespace
* UML::Classifier
### Metaclass Types
* UML::Class
### Other Types
* UML::Association
* UML::Enumeration
* UML::Package
* UML::Property
### UML Packages
### UML Classes
#### Class Generalizations (from Classifier)
#### Class Attributes
#### Class Operations (from ???)
(Note: It's a matter of modeling the operations, not _per se_ of|
implementing the opeations)
#### Owned Rules (from Namespace)
#### Comments (from Element)
### UML Profiles
(extending UML::Package)
(metaclass,profle relations - by way of UML packages)
(stereotypes - extending metaclasses)
|#
#+NIL
(defgeneric add-typed-relation (relation container model serialization-model))
;; ^ no essential distinction with regards to ADD-ELEMENT, simply for
;; adding an element that repersents a typed relation
(defgeneric final-initialize (element container
model serialization-model)
(:method ((element model-element) (container model-element)
(model model)
(serialization-model serialization-model))
(initialize-instance element)
(add-element element container model serialization-model)
(values element)))
(defgeneric add-cdata (encoding cdata model-element model))
;; ^ cf. READ-XMI
;; ^ FIXME: Implement ADD-CDATA for those bootstrap metamodel elements
;; accepting cdata contents (cf. ownedComment, and the
;; non-OCL-interpreting ownedRule impl)
;;; * Bootstrap Metamodel
(defconstant +package-buffer-extent+ 1) ;; FIXME: usage ?
(defclass bootstrap-metamodel (serialization-model)
;; effectively a container for XMI -> Common Lisp transformation
;; descriptors, so far as to unmarshal the full UML metamodel
;; serialized in UML.xmi
;;
;; Regarding disjunction of this class with regards to other
;; SERIALIZATION-MODEL classes, refer to generic functions having
;; methods specializced this class and on SERIALIZATION-MODEL,
;; e.g. ALLOCATE-MODEL
())
(declaim (type bootstrap-metamodel *bootstrap-metamodel*)) ;; FIXME class?
(defvar *bootstrap-metamodel* ;; name ??
(make-instance
'bootstrap-metamodel
:model-class (quote bootstrap-metamodel)
:namespaces
;; FIXME: BACKWADS COMPATABILITY (PRE 2.4.1 SERIES UML/XMI/MOF SPECS)
'(("uml" . "http://www.omg.org/spec/UML/20110701" )
("xmi" . "http://www.omg.org/spec/XMI/20110701" )
("mofext" . "http://www.omg.org/spec/MOF/20110701")
)))
(defclass bootstrap-metamodel-element ()
;; used in METAMODEL-TRANSFORM and in BOOTSTRAP-METAMODEL-METACLASS
((model
;; model containing this component
:initarg :model
:type serialization-metamodel
:initform *bootstrap-metamodel*
:accessor component-model)
;; naming elements
(namespace ;; FIXME: Discard this slot (?)
;; namespace corresponding to the package containing the named
;; element reified by this component
:type namespace
:initarg :namespace
:accessor component-namespace)
(local-name ;; FIXME: Discard this slot, or inherit by NAMED-ELEMENT
;; ^ local name for type of metamodel serialization.
:initarg :local-name
:type string ;; FIXME: namespace qualified strings - see ensure-qname
:accessor component-local-name)
))
#+NIL ;; needs more baseline code
(defgeneric (setf resolve-composite-name) (new-value name model))
;; ^ return local-name
#+NIL ;; needs more baseline code
(defgeneric resolve-composite-name (name model &optional errorp))
#+NIL ;; needs cleanups
(defgeneric resolve-qname (name model &optional errorp)
;; some axioms:
;;
;; * before this function is called, MODEL must contain a set
;; of (URL, prefix+) namespace bindings
;;
;; * every element used in a serialized metamodel (i.e every
;; metamodel element) represents a model element or a feature of a
;; model element
;;
;; * every metamodel element supported in the stub metamodel - that
;; is, the bootsrap-metamodel - may be represented with a metaclass
;; or a slot definition contained by such a metaclass, such that may
;; be registered to the bootstrap-metamodel when or after the
;; metaclass is defined
;;
;; * once every such metaclass is defined in Lisp and furthermore is
;; registered to the bootstrap-metamodel, the bootstrap-metamodel
;; may then be used for unmarshallimg the entire UML metamodel
;; serialized in UML.xmi. (That unmarshaling procedure may result in
;; discrete modifications onto the same metaclasses used in
;; unmarshalling that metamodel, or alternately it would result in
;; the production of an objectively distinct model, however whose
;; metaclasses may inherit from metaclasses defined in the
;; bootstrap-metamodel)
;;
;; * once the UML metamodel is completely defined, then it may be
;; presented for graphical operations via CLIM presemtation methods
;;
;;
;; That outline basically describes the design intention underlying
;; the implementation of the Lupine-XMI components.
;;
;; In the implementation of the Lupine-XMI metamodel unmarshaling
;; model, as denoted in the previous outline, a design issue has
;; been noticed with regards to namespace defaulting. That design
;; issue and a workaround for that design issue have been denoted in
;; Namespaces.md in the Lupine XMI module's documentation
(:method ((name string) model &optional (errorp t))
(resolve-qname (simplify-string string) model errorp))
(:method ((name simple-string) (model bootstrap-metamodel)
&optional (errorp t))
(let ((ns-reg (model-namespace-registry model)))
(multiple-value-bind (pfx lname)
;; FIXME: allow for "foo" as well as "bar:foo"
;; i.e. "Null namespace" (but note: program must make
;; account for containing namespaces during element
;; processing) (see Namespaces.md)
(split-string-1 #\: name)
;; FIXME: use symbol bindings instead!
(flet ((resolve-in-namespace (ns)
(gethash lname (namespace-local-names-table ns))))
(cond
(pfx
(let ((ns (resolve-prefix-namespace pfx)))
(cond
(ns
(let ((ln-p (resolve-in-namespace ns)))
(cond
(ln-p (values ln-p))
(errorp
(error "Local name ~s not registered in ~
namespace ~s" ns))
(t (values nil ns)))))
(errorp
(error "No namepace registered for prefix ~s in ~s ~
ns-registry ~s"
pfx model nsreg))
(t (values nil nil)))))
(t ;; element name was not qualified with a prefix
;; FIXME: this assumes no namespace has been defaulted (?)
(let ((ns (registry-null-namespace ns-reg)))
(resolve-in-namespace ns)))))))))
(defmethod shared-initialize ((instance bootstrap-metamodel-element)
slots &rest initargs
&key qname &allow-other-keys)
;; This method consumes the :QNAME initarg
(macrolet ((uncadr (name)
(with-gensyms (it)
(let ((,it (getf initargs ,name)))
(cond
((and ,it (consp ,it))
(setf (getf initargs ,name)
(cadr ,it)))
(t (values ,it)))))))
(let ((model (uncadr :model))
(name (uncadr :qname)))
(when name
;; FIXME:
;; 1) split qname into name, prefix
;; 2) resolve namespace from prefix,
;; (setf getf) resolved namespace as :namespace initarg value
;; 3) (setf getf) local name as name value
(let ((reg (model-namespace-registry model)))
(multiple-value-bind (s ns)
(compute-qname-symbol name reg t)
(setf (getf initargs :local-name)
(symbol-name s))
(setf (getf initargs :namespace)
ns)
(delf :qname initargs)))
(prog1 (apply #'call-next-method instance slots initargs)
(when (and name model)
(let ((local-name (setf (resolve-composite-name name model)
instance)))
(setf (component-local-name instance)
local-name)))))))
;;; * ...
(defclass metamodel-transform (bootstrap-metamodel-element)
;; this may be subject to some revision - note the irrelevance of
;; the 'type' slot and the corredponding @xmi:type attribute, with
;; regards to "simple" metamodel unmarshaling
((element-p
;; whether the metamodel element is known to be serialized as an
;; XML element
:initarg :element-p
:type boolean
:accessor transform-element-p)
(attribute-p
;; whether the metamodel element is known to be serialized as an
;; XML attribute
:initarg :attribute-p
:type boolean
:accessor transform-attribute-p)
;; Note that xmi:type does not need to be implemented directly in
;; the metamodel unmarshalling framework.
;;
;; The input xmi:type value would rather denote the metaclass
;; of the element being umarshaled
))
;;; * Property Tables
;;
;; Precursor to PROPERTY-TRANSFORM-SLOT-DEFINITION
;;
;; Precedent: Unique trie of (value, name, table)
;;
;; Usage in UML:
;;
;; name => persistent XML ID, as a symbol interned in the model's
;; ID symbol namespace (cf. INTERN-ID, to do)
;; value => UML object representing <name>
(defclass property-table ()
;; usage: e.g. to store the set of packageElement properties
;; definied within a UML Package
())
(defclass named-property-table (named-element)
;; usage: e.g. to store the set of packageElement properties
;; definied within a UML Package
())
(defgeneric get-property (name table))
(defgeneric ensure-property (value name table))
(defgeneric map-properties (function table))
(defgeneric list-properties (sequence-type table))
(defclass simple-eq-property-table ()
((storage
:accessor property-table-storage
:type hash-table
:initform (make-hash-table :test #'eq))))
(defmethod get-property ((name symbol) (table simple-eq-property-table))
(getf name (property-table-storage table)))
(defmethod ensure-property ((value t) (name symbol)
(table simple-eq-property-table))
(setf (getf name (property-table-storage table)) value))
(defmethod map-properties ((function function)
(table simple-eq-property-table))
(maphash function (property-table-storage table)))
(defmethod list-properties ((sequence-type t)
(table simple-eq-property-table))
;; FIXME: THREAD SAFETY. LOCK STORAGE TABLE SLOT
;; DEFINE: (WITH-SLOT-VALUE-LOCK ...)
(let* ((len (hash-table-count (property-table-storage table)))
(buffer (make-array len :adjustable nil :fill-pointer 0)))
(map-properties (lambda (k v)
(declare (ignore k))
(vector-push-extend v buffer))
table)
(coerce buffer sequence-type)))
#|
Motivation:
A UML metaclass (type UML::Class) is defined with a set of properties,
in the following class attribute groups:
* Owned Attributes
* Owned Operations
* Owned Rules (Constraints, inherited from UML::Namespace)
* Owned Comments (inherited from UML::Element)
This protocol represents a generic framework for:
1) Define a single slot for each such attribute goup,
within a UML element instance
2) Add/Set/Delete/List/Map properties within each such attribute
group, within that slot's value on the element instance
|#
#+PROTOTYPE
(progn ;; define one such set for each such attribute group
(defgeneric add-comment (comment element))
(defgeneric delete-comment (comment element))
(defgeneric map-comments (function element))
)
;;; * UML-Class
(def-uml-package "UML") ;; ?
(defclass uml-class (classifier bootstrap-metamodel-metaclass)
;; NOTE: This class represents the main initial use-case for the
;; transformation algorithm proposed in Lupine XMI
((owned-attributes
:element-p t
:local-name "ownedAttribute" ;; qname (?)
:initarg :owned-attributes
;; NB: access to values of slot containing property-table types
;; may be faciliated with a special slot definition extension
:type property-table
:accessor class-direct-owned-attributes-table)
(documentation-stub
:initarg :documentation-stub
:type simple-string
:accessor class-documentation-stub
)
(is-abstract
:attribute-p t
:local-name "isAbstract"
:initarg :is-abstract
:type boolean)
)
(:metaclass bootstrap-metamodel-metaclass)
;; FIXME: add :MODEL to other class definitions (?)
(:model *bootstrap-metamodel*)
;; UML composite name
;;
;; This needs a "UML" package defined for appropriate resolution,
;; however.
;;
;; This class option would effectively denote a packagedElement
;; definition for the defining class.
(:qname "UML:Class")
;; "uml" in the following item denotes the namespace URI assigned
;; to the prefix "uml"
(:model-metaclass "uml:Class") ;; cf. @xmi:type="uml:Class"
)
#+Nil ;; FIXME: do this CHANGE-CLASS for all elements in the
;; *bootstrap-metamodel* after loading
(let ((c (find-class 'uml-class)))
(change-class c c))
;;; * Post Hoc
;; N.B: Can't use UML-CLASS as a :METACLASS util it's finalized,
;; and it won't be finalized until after DEFCLASS CLASSIFIER
(defclass element ()
((owned-comments
:element-p t
:local-name "ownedComment"
:initarg :owned-comments
:type property-table
:accessor class-direct-owned-comments-table))
(:metaclass bootstrap-metamodel-metaclass)
(:model *bootstrap-metamodel*)
(:model-metaclass "uml:Class")
(:qname "UML:Element")
(:is-abstract t))
(defclass named-element (element)
((name
:attribute-p t
:local-name "name"
:initarg :name
:type simple-string
;; fixme: :type simple-ncname ;; ?
;; (NB: NCName type for 'name' is not specified in UML, but may be
;; implied on account of the XMI serialization for UML named
;; elements, in which a named element's name is used as an XML
;; element name, optionally qualified within a XML namespace
;; having the URI of the UML package conaining the element)
:accessor named-element-name)
(namespace
;; not directly encoded in XMI, rather derived from when a
;; named-element is contained in a packagedElement relation (as
;; that relation entailing a subset of Namespace.ownedMember)
;; cf UML.xmi#A_ownedMember_namespace
:intiarg :namespace
:type namespace
:accessor named-element-namespace
)
)
(:metaclass bootstrap-metamodel-metaclass)
(:model *bootstrap-metamodel*)
(:model-metaclass "uml:Class")
(:qname "UML:NamedElement")
(:is-abstract t))
(defclass namespace (named-element)
((owned-rules
:element-p t
:local-name "ownedRule"
:initarg :owned-rules
:type property-table
:accessor class-direct-owned-rules-table
))
(:metaclass bootstrap-metamodel-metaclass)
(:model *bootstrap-metamodel*)
(:model-metaclass "uml:Class")
(:qname "UML:Namespace")
(:is-abstract t))
(defun compute-composite-name (named)
;; FIXME: note that the PrimitiveTypes package is the singleton
;; denoted with "::" as a prefix part. The InfrastructureLibrary
;; package, for instance, i not denoted with the "::" prefix in the
;; UML 2.4.1 specification, though it may be understood as
;; representing a "top level" package
;;
;; This implementation will skip the prefix "::" altogether
(declare (type named-element named)
(values simple-string &optional))
(let ((ns (when (slot-boundp named 'namespace)
(named-element-namespace named)))
(name (named-element-name named)))
(cond
(ns
(concatenate 'simple-string name
#.(simplify-string "::")
(compute-coposite-name ns)))
(t (values name)))))
#+NIL
(defmethod (setf resolve-composite-name) ((new-value bootstrap-metamodel-element)
(name string)
(model bootstrap-metamodel)
)
;; FIXME: complete this method definition
)
#+NIL
(defmethod resolve-composite-name ((name string)
(model bootstrap-metamodel)
&optional (errorp t))
;; FIXME: complete this method definition
)
(defclass classifier (namespace #+NIL type)
((generalizations
:element-p t
:local-name "generalization"
:initarg :generalizations
:type property-table
:accessor class-direct-generalizations-table
))
(:metaclass bootstrap-metamodel-metaclass)
(:model *bootstrap-metamodel*)
(:model-metaclass "uml:Class")
(:qname "UML:Classifier")
(:is-abstract t))
(defclass uml-package (namespace)
((uri ;; FIXME: intern as namespace in containing model
:attribute-p t
:local-name "URI"
:initarg :uri
:type string
:accessor uml-package-uri)
(packaged-elements
:element-p t
:local-name "packagedElement"
:type property-table
:accessor uml-package-packaged-elements))
(:metaclass bootstrap-metamodel-metaclass)
(:model *bootstrap-metamodel*)
(:model-metaclass "uml:Class")
(:qname "UML:Package"))
;;; * UML Primitive Types
(defclass data-type (classifier)
((lisp-type
:initarg :lisp-type
:accessor data-type-lisp-type))
(:metaclass bootstrap-metamodel-metaclass)
(:model *bootstrap-metamodel*)
(:model-metaclass "uml:Class")
(:qname "UML:Package")
(:is-abstract t))
(defclass primitive-type (data-type standard-class)
()
(:metaclass bootstrap-metamodel-metaclass)
(:model *bootstrap-metamodel*)
(:model-metaclass "uml:Class")
(:qname "UML:PrimitiveType"))
(defclass type-proxy ()
;; FIXME: use an AROUND method on (SETF TYPE-PROXY-VALUE) to ensure
;; that the NEW-VALUE is of the appopriate LISP-TYPE
((value
:initarg :value
:accessor type-proxy-value)
))
(defclass uml-boolean (type-proxy)
((value
:type boolean))
(:metaclass primitive-type)
(:lisp-type boolean)
(:model *bootstrap-metamodel*)
(:model-metaclass "uml:PrimitiveType")
(:qname "PrimitiveTypes:Boolean"))
(defclass uml-integer (type-proxy)
((value
:type integer))
(:metaclass primitive-type)
(:lisp-type integer)
(:model *bootstrap-metamodel*)
(:model-metaclass "uml:PrimitiveType")
(:qname "PrimitiveTypes:Integer"))
(defclass uml-string (type-proxy)
((value
:type string))
(:metaclass primitive-type)
(:lisp-type string)
(:model *bootstrap-metamodel*)
(:model-metaclass "uml:String")
(:qname "PrimitiveTypes:Integer"))
(deftype unlimited-natural ()
'(or unsigned-byte (eql :*)))
(defclass uml-unlimited-natural (type-proxy)
((value
:type unlimited-natural))
(:metaclass primitive-type)
(:lisp-type unlimited-natural)
(:model *bootstrap-metamodel*)
(:model-metaclass "uml:String")
(:qname "PrimitiveTypes:Integer"))
| 32,464 | Common Lisp | .lisp | 838 | 34.947494 | 112 | 0.709418 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | f314aeebf3c257c941492c61c75cb257853b6786491b936919743df911048a28 | 27,619 | [
-1
] |
27,620 | uri.lisp | GazeboHub_lupine-m2/module/xmi/src/main/lisp/uri.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/xmi)
(defgeneric compute-uri (source)
(:method ((source null))
(values nil))
(:method ((source pathname))
(parse-uri
(concatenate 'simple-string "file://" ;; ?
(namestring source))))
(:method ((source file-stream))
(compute-uri (pathname source)))
(:method ((source string))
(values nil))
(:method ((source runes:xstream))
(compute-uri (runes::xstream-os-stream source))))
| 720 | Common Lisp | .lisp | 21 | 30.714286 | 70 | 0.70317 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | b4e099a131fc5c2ed8582e99bf1e1f1de938a5b036db2ade07bd1f45d60c69aa | 27,620 | [
-1
] |
27,621 | xmi.lisp | GazeboHub_lupine-m2/module/xmi/src/main/lisp/xmi.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/xmi)
(defun read-xmi ( | 331 | Common Lisp | .lisp | 9 | 34.111111 | 70 | 0.772871 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | ddb04dbf13ccc6ee4d95c3b06ee07b21c15c9131b9de52db223419002c809aca | 27,621 | [
-1
] |
27,622 | types-cxml.lisp | GazeboHub_lupine-m2/module/xmi/src/main/lisp/types-cxml.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/xmi)
(deftype parser-input-source ()
'(or pathname stream string runes:xstream))
| 391 | Common Lisp | .lisp | 10 | 36.4 | 70 | 0.773936 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 9d9fef7543c12fa3811376009784f6f5cd5218a7555e33fe4be4d2ab95ef42e9 | 27,622 | [
-1
] |
27,623 | package-late.lisp | GazeboHub_lupine-m2/module/xmi/src/main/lisp/package-late.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/xmi)
(defpackage #:xml/encoding
(:nicknames #:encoding)
;; package for interning of arbitrary XML encoding names as symbols
;; cf. ADD-CDATA, READ-XMI
;; See also: <http://www.w3.org/TR/REC-xml/#NT-EncodingDecl>
(:use))
(defpackage #.lupine/xmi:+xmi-2.4.1-namespace-uri+
;; FIXME: Allow for processing multiple XMI versions
;; cf. xmi:XMI in lupine/xmi:read-xmi
(:use)
(:nicknames #:ns/xmi #:ns/xmi/2.4.1)
(:export #:|XMI|))
(defpackage #.lupine/xmi:+uml-2.4.1-namespace-uri+
;; FIXME: Allow for processing multiple XMI versions
;; cf. xmi:XMI in lupine/xmi:read-xmi
(:use)
(:nicknames #:ns/uml #:ns/uml/2.4.1)
(:export #:|Package|))
(defpackage #.lupine/xmi:+mofext-2.4.1-namespace-uri+
;; FIXME: Allow for processing multiple XMI versions
;; cf. xmi:XMI in lupine/xmi:read-xmi
(:use)
(:nicknames #:ns/mofext #:ns/mofext/2.4.1)
(:export #:|Tag|)) | 1,200 | Common Lisp | .lisp | 32 | 34.65625 | 70 | 0.704918 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | e04e2c2d585847ec0f8f035e7f107b0a2f63596f07cd1d04e0d026b3cf768210 | 27,623 | [
-1
] |
27,624 | uml-package.lisp | GazeboHub_lupine-m2/module/xmi/src/main/lisp/uml-package.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/xmi)
(defclass visibility-kind (?)
(?))
(defclass named-element (element)
((name
:attribute "name"
:initarg :name
:type string
:accessor named-element-name
))
(:metaclass uml-class)
(:namespace
("uml" "http://www.omg.org/spec/UML/20110701" ))
(:uml-name "UML::NamedElement")
(:is-absract . t))
(defclass packageable-element (named-element)
()
(:metaclass uml-class)
(:namespace
("uml" "http://www.omg.org/spec/UML/20110701" ))
(:uml-name "UML::PackageableElement")
(:is-absract . t))
(defclass uml-package | 867 | Common Lisp | .lisp | 30 | 25.633333 | 70 | 0.706167 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 9e2f3f3649a275ffd313f44bdfcc7a6fc6feac100c696d213df89894e40ed929 | 27,624 | [
-1
] |
27,625 | transform-klacks.lisp | GazeboHub_lupine-m2/module/xmi/src/main/lisp/transform-klacks.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/xmi)
(defun make-event-handler (source &key sax-handler)
;; FIXME: Modify this form producing a handler implementing the
;; QNAME-OVERRIDE behavior denoted in Namespaces.md
"Generate an appropriate `KLACKS:SOURCE' handler for parsing SOURCE.
SAX-HANDLER, if non-nil, must be a CXML SAX handler
See also:
* `SAX:SAX-PROXY'
* `SAX:BROADCAST-HANDLER'
* `SAX:DEFAULT-HANDLER'
* `SAX:CONTENT-HANDLER'"
(declare (type parser-input-source source)
(type (or null sax:abstract-handler) sax-handler)
(values klacks:source &optional))
(if sax-handler
(klacks:make-tapping-source source sax-handler)
(cxml:make-source source)))
#+NIL ;; use *boostrap-model*
(defun make-standard-model (&optional source)
(make-instance 'standard-model :source source))
(define-condition event-condition ()
((event :initarg :event :reader event-condition-event)
(event-data :initarg :event-data :reader event-condition-event-data)))
(define-condition unsupported-event-type (event-condition warning)
()
(:report (lambda (c s)
(format s "Unsupported event type: ~s - event data: ~s"
(event-condition-event c)
(event-condition-event-data c)))))
(defgeneric intern-qname-symbol (uri lname metamodel)
;; FIXME: This represents a point of integration between the XML and
;; Common Lisp namespaces, allowing for some peculiar instances, e.g
;; if URI is "CL". The side-effects of that may be negligible
;; insofar as the interned name is not used as a function or
;; variable name. However, it should be denoted in the
;; documentation, for developer interest.
(:method ((uri simple-string) (lname simple-string)
(metamodel stub-metamodel))
;; FIXME: Later, audit this method for application not
;; only w.r.t STUB-METAMODEL (broaden)
(let ((reg (model-namespace-registry metamodel))
;; FIXME: Define MODEL-NAMESPACE-REGISTRY accessor
;; and remove redefinitions of that feature
(ns (compute-namespace uri reg)))
(cond
(ns (let ((p (namespace-package ns)))
(values (intern lname (the package p))
p)))
(*INTERN-IN-NULL-NAMESPACE*
;; FIXME: Define this runtime feature - optionally as
;; a METAMODEL feature deriving somehow from
;; :QNAME-OVERRIDE
;; FIXME: Define REGISTY-NULL-NAMESPACE accessor, and
;; document this special handling of "null nameapace
;; in metamodel", specifically with regards to
;; :QNAME-OVERRIDE
(let ((p (registry-null-namespace reg)))
(values (intern lname (the package p))
p))))
(t (error "cannot intern local name ~s - No namespace ~
for ~s found in metamodel-namespace-registry ~s of ~s and not ~
*INTERN-IN-NULL-NAMESPACE*"
lname uri reg metsmodel))))))
(defun read-xmi (source &key
(event-handler (make-event-handler source))
(serialization-model *boostrap-model*))
(declare (type parser-input-source source)
(type serialization-model serialization-model)
(values model boolean &optional))
;; cf. `cxml-rng:parse-schema' for klacks usage reference
;; also <http://common-lisp.net/project/cxml/klacks.html#sources>
(let (model-element element-container
model
xml-version
xml-document-encoding
xml-standalone-p)
(klacks:with-open-source (s event-handler)
(handler-case
(block klacks-parse
(loop
(destructuring-bind (event-type &rest event-data)
;; NB: The "Variable number of return values" behavior
;; used in KLACKS:CONSUME and similar functions may seem
;; to essentially require some consing, to capture the
;; variable number of return values after the first return
;; value, for every Klacks event type
(multiple-value-list (klacks:consume s))
(macrolet ((warn-unsupported ()
(warn 'unsupported-event-type
:event event-type
:event-data event-data)))
(ecase event-type
((nil)
;; return model as created so far.
;; second value indicates "did not complete document"
;; note that this does not call INITIALIZE-MODEL
(return-from klacks-parse (values model nil)))
(:start-document
;; version, encoding, standalonep
(destructuring-bind (v enc s)
;; FIXME: Parse string values for numeric biding
(setq xml-version v
xml-document-encoding
(intern enc '#:xml/encoding)
xml-standalone-p s)))
(:dtd ;; name, public-id, system-id
(warn-unsupported))
(:start-element ;; uri, lname, qname
;;; 1) Detect root XMI element, intialize MODEL
;;; 2) Else, ALLOCATE-ELEMENT and map ATTRS "here"
(destructuring-bind (uri lname qname) event-data
(declare (ignore qname) (type simple-string uri lname))
(let ((qname-symbol (intern-qname-symbol
uri lname serialization-model)))
(cond
((eq qname-symbol (quote ns/xmi:XMI))
(setq model (allocate-model
xml-document-encoding
source serialization-model)))
(t
(setq
element-container model-element
model-element (allocate-element
qname-symbol
uri lname model source
serialization-model)))))
(klacks:map-attributes
(lambda (uri lname qname val defaulted-p)
(declare (simple-string uri lname val)
(ignore qname defaulted-p))
(let ((qs (intern-qname-symbol
uri lname serializatino-model)))
(apply-atrribute value qs uri lname
model-element model
source
serialization-model)))
source)))
(:end-element ;; uri, lname, qname
;; "close" model-element
(final-initialize model-element
element-container
model
serialization-model))
(:characters ;; data
;; FIXME: Normalize string - optional or
;; element-dependent - handle in ADD-CDATA
;; methods
(add-cdata xml-document-encoding data
model-element model))
(:processing-instruction ;; pi-target, data
(warn-unsupported))
(:comment ;; data
(warn-unsupported))
(:end-document
;; 1. "close" and shared-initialize model
(final-initialize model source serialization-model)
;; 2. then return - second value indicates
;; "Completed document"
(return-from klacks-parse (values m t)))
)))) ;; block klacks-parse
;; handle errors that the klacks parser might produce...
)))))
| 6,711 | Common Lisp | .lisp | 169 | 34.035503 | 73 | 0.684331 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 398ebeeb36f313ad841490a3ef615d54e8cde694e30ea879892cec4f8ce87c28 | 27,625 | [
-1
] |
27,626 | package.lisp | GazeboHub_lupine-m2/module/aux/src/main/lisp/package.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:cl-user)
(defpackage #:lupine/aux
(:use #:cl)
(:export
;; package.lisp
#:name-condition
#:name-condition-name
#:package-not-found
#:package-designator
#:find-package*
#:package-shortest-name
;; type.lisp
#:array-index
#:class-designator
#:compute-class
#:type-designator
#:member-typep
#:simplify-string
;; condition.lisp
#:simple-style-warning
#:namespace-condition
#:namespace-condition-namespace
#:name-not-found
#:name-not-found-error
#:simple-name-not-found-error
;; macro.lisp
#:with-gensyms
#:defconst
;; seq.lisp
#:array-index
#:array-dim
#:do-vector
#:split-string-1
#:readtable-case-designator
#:char-readtable-case
#:dash-transform-camel-case
)
)
(in-package #:lupine/aux)
;;; * Condition Type NAME-CONDITION
(define-condition name-condition ()
((name
:initarg :name
:reader name-condition-name)))
(define-condition package-not-found (name-condition error)
()
(:report
(lambda (c s)
(format s "Package not found: ~a" (name-condition-name c)))))
(deftype package-designator ()
'(or string symbol package character))
(defun find-package* (name &optional (errorp t))
(declare (type package-designator name)
(values (or package null) &optional))
(or (find-package name)
(when errorp
(error 'package-not-found :name name))))
;; (find-package* (gensym "NOT-A-PKG-"))
(defun package-shortest-name (package)
(declare (type package-designator package)
(values simple-string &optional))
(let ((p (or (find-package package)
(error "Package not found: ~s" package))))
(car (sort (cons (package-name p)
(copy-list (package-nicknames p)))
#'< :key #'length))))
#|
(package-shortest-name '#:cl)
=EXPECT=> "CL"
(defpackage "http://foo.example.com"
(:nicknames #:FOO))
(package-shortest-name "http://foo.example.com")
=EXPECT=> "FOO"
|#
| 2,238 | Common Lisp | .lisp | 81 | 23.91358 | 70 | 0.685393 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | f43193cb8c8a8c8133266e87d0820e9e85f8d3714096ca3aecb617da962dd00c | 27,626 | [
-1
] |
27,627 | seq.lisp | GazeboHub_lupine-m2/module/aux/src/main/lisp/seq.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/aux)
(deftype array-index ()
'(mod #.array-dimension-limit))
(deftype array-dim ()
`(integer 0 #.array-dimension-limit))
(defmacro do-vector ((var vector &optional retv) &body body)
(with-gensyms (%vector %len %n)
`(let* ((,%vector ,vector)
(,%len (length ,%vector)))
(declare (type vector ,%vector)
(type array-dim ,%len))
(dotimes (,%n ,%len ,retv)
(let ((,var (aref ,%vector ,%n)))
,@body)))))
;; (do-vector (c "FOO" 412) (format t "Char ~s~%" c))
(defun split-string-1 (c str)
(declare (type character c)
(type string str)
(values (or string null) string &optional))
(let ((n (position c str :test #'char=)))
(declare (type (or array-index null) n))
(cond
(n (values (subseq str 0 n)
(subseq str (1+ (the array-index n)))))
(t (values nil str)))))
;; (split-string-1 #\: "FOO:BAR")
;; (split-string-1 #\: "FOOBAR")
(deftype readtable-case-designator ()
"Symbol denoting READTABLE-CASE"
'(member :upcase :downcase :preserve :invert))
(defun char-readtable-case (c
&optional
(char-case
(readtable-case *readtable*)))
"Convert character C per CHAR-CASE
Note that the :INVERT CHAR-CASE is interpreted only with regards to C"
(declare (type character c)
(type readtable-case-designator char-case)
(values character &optional))
(ecase char-case
(:upcase (char-upcase c))
(:downcase (char-downcase c))
(:preserve (values c))
(:invert ;; complex condition
;; frob
(cond
((upper-case-p c)
(char-downcase c))
(t (char-upcase c))))))
(defun dash-transform-camel-case
(name &optional
(convert-case (readtable-case *readtable*)))
"Convert CompoundName name to COMPOUND-NAME
See also:
* <http://en.wikipedia.org/wiki/Medial_capitals>"
(declare (type string name)
(type readtable-case-designator convert-case)
(values simple-string &optional))
(let* ((start-p t)
after-up-p
multi-up-p
(len (length name))
(elt-type (array-element-type name))
(outbuff
(make-array
len :adjustable t :fill-pointer 0 :element-type elt-type))
(upcase-token
(make-array
0 :adjustable t :fill-pointer 0 :element-type elt-type)))
(declare (type array-dim len)
(type boolean start-p after-up-p multi-up-p))
(do-vector (c name (simplify-string outbuff))
(declare (type character c))
(let ((up-p (upper-case-p c)))
(declare (type boolean up-p))
(setq c (char-readtable-case c convert-case))
(cond
(up-p
(when after-up-p
(setq multi-up-p t))
(unless (or start-p after-up-p)
(vector-push-extend #\- outbuff))
(setq after-up-p t)
(vector-push-extend c upcase-token))
(after-up-p
(setq after-up-p nil)
(do-vector (uc upcase-token)
(vector-push-extend uc outbuff))
(when multi-up-p
(vector-push-extend #\- outbuff)
(setq multi-up-p nil))
(setf (fill-pointer upcase-token) 0)
(vector-push-extend c outbuff))
(t
(vector-push-extend c outbuff)))
(when start-p
(setq start-p nil))))))
;; (dash-transform-camel-case "FooBar" :upcase)
;; => "FOO-BAR"
;; (dash-transform-camel-case "fooBar" :upcase)
;; => "FOO-BAR"
;; (dash-transform-camel-case "fooXYZbar" :upcase)
;; => "FOO-XYZ-BAR"
;; (dash-transform-camel-case "XYZfoo" :upcase)
;; => "XYZ-FOO"
;; (dash-transform-camel-case "XYZfoo" :invert)
;; => "xyz-FOO"
;; (dash-transform-camel-case "FooBar" :invert)
;; => "fOO-bAR" ;; oddly perhaps
| 3,801 | Common Lisp | .lisp | 116 | 28.646552 | 70 | 0.654635 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | d89ecf228542f945eba860799e0a57b78e7ede6a7769c94530122b4a8a1e119b | 27,627 | [
-1
] |
27,628 | macro.lisp | GazeboHub_lupine-m2/module/aux/src/main/lisp/macro.lisp |
#|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/aux)
(defmacro with-gensyms ((&rest names) &body body)
`(let (,@(mapcar #'(lambda (n)
`(,n (gensym
,(simplify-string
(format nil "~a-" n)))))
names))
,@body))
;; (macroexpand-1 '(with-gensyms (a b c) (list a b c)))
;; (with-gensyms (a b c) (list a b c))
(defmacro defconst (name value &optional docs)
(with-gensyms (%value)
`(let ((,%value ,value))
(defconstant ,name
(cond
((boundp (quote ,name))
(symbol-value (quote ,name)))
(t ,%value))
,@(when docs (list docs))))))
;; (defconst *FOO* "foo")
| 880 | Common Lisp | .lisp | 27 | 28.259259 | 70 | 0.63658 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 9d1d44788a7e8e7e1f962a6101023b6de2f359dad7a2fda6592924c1c555ef11 | 27,628 | [
-1
] |
27,629 | condition.lisp | GazeboHub_lupine-m2/module/aux/src/main/lisp/condition.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/aux)
#-(or SBCL CMUCL)
(define-condition simple-style-warning (simple-condition
style-warning)
())
(defmacro simple-style-warning (ctrl &rest args)
`(warn
#+SBCL 'sb-int:simple-style-warning
#+CMU 'conditions:simple-style-warning
:format-control ,ctrl
:format-arguments (list ,@args)))
;; (simple-style-warning "FOO is not FOO : ~s" "foo")
;;; * Condition Type NAMESPACE-CONDITION
(define-condition namespace-condition ()
((namespace
:initarg :namespace
:reader namespace-condition-namespace)))
;;; * Condition Type Protocol: NAME-NOT-FOUND
(define-condition name-not-found (name-condition namespace-condition)
()
(:report
(lambda (c s)
(format s "Name ~s not found in ~s"
(name-condition-name c)
(namespace-condition-namespace c)))))
(define-condition name-not-found-error (program-error name-not-found)
())
(define-condition simple-name-not-found-error (simple-condition
name-not-found-error)
()
(:report
(lambda (c s)
(format s "Name ~s not found in ~s ~?"
(name-condition-name c)
(namespace-condition-namespace c)
(simple-condition-format-control c)
(simple-condition-format-arguments c)))))
| 1,525 | Common Lisp | .lisp | 44 | 30.590909 | 70 | 0.711263 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 0cee1da17b581dcf6366105bba2c2991d71dd71900d2d1704edb388d4dd21388 | 27,629 | [
-1
] |
27,630 | type.lisp | GazeboHub_lupine-m2/module/aux/src/main/lisp/type.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/aux)
(deftype class-designator ()
'(or symbol class))
(defun compute-class (c)
(declare (type class-designator c)
(values class &optional))
(etypecase c
(symbol (find-class c t))
(class c)))
;; (compute-class 'standard-class)
(deftype type-designator ()
'(or class-designator (cons symbol t)))
(defun member-typep (type list)
(declare
(type type-designator type)
(type list list)
(values t (or unsigned-byte null) &optional))
(do* ((restv list (cdr restv))
(eltv (car restv) (car restv))
(n 0 (incf n)))
((null restv) (values nil nil))
(when (typep eltv type)
(return (values eltv n)))))
;; (member-typep 'string '(1 2 "Three" #:4))
;; => "Three", 2
;; (member-typep 'string '(1 2 "Three"))
;; => "Three", 2
;; (member-typep 'string '("Three" 2 1))
;; => "Three", 0
;; (member-typep 'bignum '("Three" 2 1))
;; => NIL, NIL
(defun simplify-string (str)
(declare (type string str)
(values (or simple-string simple-base-string)
&optional))
(handler-case
(coerce str 'simple-base-string)
(type-error ()
(coerce str 'simple-string))))
#|
(type-of (simplify-string "FOO"))
(type-of
(simplify-string (make-array 31 :element-type 'character :adjustable t
:initial-element (code-char #x3C0))))
|#
| 1,598 | Common Lisp | .lisp | 52 | 27.461538 | 71 | 0.667538 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 6a52ec41435040587d55998b00407d7d1c5a72008285dacc63d530b47452ec72 | 27,630 | [
-1
] |
27,631 | primitive-types.lisp | GazeboHub_lupine-m2/module/m2/src/main/lisp/primitive-types.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(defgeneric element-generalizations (element))
(defgeneric (setf element-generalizations) (new-set element))
(defclass uml-element ()
())
(defclass uml-element-class (uml-element standard-class)
())
#+NIL ;; should this be derived on the class or its metaclass?
(defmethod element-generalizations ((element uml-element-class))
;; NB: This captures only those generalizations mapping onto a
;; class' direct superclasses
(let (bucket)
(dolist (elt (class-direct-superclasses element) bucket)
(when (typep elt 'uml-element)
(setq bucket (nconc bucket (list elt)))))))
(def-uml-package "InfrastructureLibrary")
(in-uml-package "InfrastructureLibrary")
(def-uml-package "Core")
(in-uml-package "Core")
(def-uml-package "Constructs")
;; stubs for PrimitiveType generaizations
(defclass classifier (uml-element-class)
()
(:metaclss uml-element-class)
(:name "Classifier")
(:package "Core::Constructs")
;; FIXME: Define classes for the ends of these generalizations:
(:generalizations "Core::Constructs::Type"
"Core::Constructs::Namespace")
(:documentation
"cf. UML 2.4.1 Infrastructure, subclause 11.6.1"))
(defclass data-type (uml-element-class)
()
(:metaclss uml-element-class)
(:name "DataType")
(:package "Core::Constructs")
(:generalizations "Core::Constructs::Classifier")
(:documentation
"cf. UML 2.4.1 Infrastructure, subclause 11.6.1"))
;;
(defclass primitive-type (uml-element-class)
()
(:metaclss uml-element-class)
(:name "PrimitiveType")
(:package "Core::Constructs")
(:generalizations "Core::Constructs::DataType")
(:documentation
"cf. UML 2.4.1 Infrastructure, subclause 11.6.5"))
(def-uml-package "PrimitiveTypes"
:cl-name #:primitive-types)
(in-uml-package "PrimitiveTypes")
;; FIXME: Define how to marshal/unmarshal values of these types, when
;; interpreting an XMI encoded UML model
;; FIXME: Try defining something more sophisticated than this trivial
;; implementation, such as with a macro, DEFINE-TYPE-TRANSFORM,
;; or other procedure that would produce a UML-ELEMENT for each
;; respective UML primitive type
(defclass Primitive-Types:boolean ()
()
(:documentation
"cf. UML 2.4.1 Infrastructure, subclause 13.1.1")
(:name "Boolean")
#+NIL (:package "PrimitiveTypes")
(:tag "org.omg.xmi.schemaType"
"http://www.w3.org/2001/XMLSchema#boolean")
(:metaclass primitive-type))
(defclass Primitive-Types:integer ()
()
(:documentation
"cf. UML 2.4.1 Infrastructure, subclause 13.1.2")
(:name "Integer")
#+NIL (:package "PrimitiveTypes")
(:tag "org.omg.xmi.schemaType"
"http://www.w3.org/2001/XMLSchema#integer")
(:metaclass primitive-type))
(defclass Primitive-Types:real ()
()
(:documentation
"cf. UML 2.4.1 Infrastructure, subclause 13.1.3")
(:name "Real")
#+NIL (:package "PrimitiveTypes")
(:tag "org.omg.xmi.schemaType"
"http://www.w3.org/2001/XMLSchema#real")
(:metaclass primitive-type))
(defclass Primitive-Types:string ()
()
(:documentation
Primitive-Types "cf. UML 2.4.1 Infrastructure, subclause 13.1.4")
(:name "String")
#+NIL (:package "PrimitiveTypes")
(:metaclass primitive-type))
(defclass Primitive-Types:unlimited-natural ()
()
(:documentation
"cf. UML 2.4.1 Infrastructure, subclause 13.1.5")
(:name "UnlimitedNatural")
#+NIL (:package "PrimitiveTypes")
(:metaclass primitive-type))
| 3,675 | Common Lisp | .lisp | 104 | 32.528846 | 70 | 0.732919 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | f0d2ed142f103bc9f84d6d169fa34956c394da98ccc2f5305d9412c43b1fadf9 | 27,631 | [
-1
] |
27,632 | package.lisp | GazeboHub_lupine-m2/module/pmmt/src/main/lisp/package.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(defpackage #:lupine/pmmt
(:use #:asdf #:lupine/aux #:puri #:cl))
| 354 | Common Lisp | .lisp | 9 | 36.555556 | 70 | 0.753666 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | d97cf54259fcb67aef865cf099d181515ee24cae9af9b29957d9792c3aa1abba | 27,632 | [
-1
] |
27,633 | project.lisp | GazeboHub_lupine-m2/module/pmmt/src/main/lisp/project.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:lupine/pmmt)
(defgeneric component-project (component))
(defclass component (asdf:component)
((project
:initarg :project
:accessor component-project)
;; make URI available for system, component identification
(uri
:initarg :uri
:type uri
:accessor component-uri)
))
(defmethod component-project :around ((component component))
(cond
((slot-boundp component 'project)
(call-next-method))
(t
(component-project (component-parent component)))))
| 796 | Common Lisp | .lisp | 25 | 28.12 | 70 | 0.740838 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 4510e8567de0416729e3a6d90a2dba515c6f2335c7fdd0d63dc273584b543f5c | 27,633 | [
-1
] |
27,634 | package.lisp | GazeboHub_lupine-m2/module/final/src/main/lisp/package.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
(in-package #:cl-user)
(defpackage #:lupine/final
(:use #:lupine/aux #:cl)
(:export
#:finalize
#:unfinalize
#:instance-finalized-p
#:instance-finalized
#:instance-finalized-instance
#:instance-finalized-error
#:simple-instance-finalized-error
#:assert-not-finalized
#:finalizable-instance
#:finalizable-object
)) | 639 | Common Lisp | .lisp | 22 | 25.590909 | 70 | 0.742623 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 2333d84326ab3d4f5007a477471788f844cde997617350b91e09ca5ee1a5a349 | 27,634 | [
-1
] |
27,635 | final.lisp | GazeboHub_lupine-m2/module/final/src/main/lisp/final.lisp | #|
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
;; Simple "Object Finalization" Protocol
;; example usage: in FINALIZE, convert adjustable vectors to simple
;; vectors
(in-package #:lupine/final)
;;; * Generic Functions
(defgeneric finalize (instance))
(defgeneric unfinalize (instance))
(defgeneric instance-finalized-p (instance))
(defgeneric (setf instance-finalized-p) (new-value instance))
;;; * Condition Protocol: INSTANCE-FINALIZED
(define-condition instance-finalized ()
((instance
:initarg :instance
:reader instance-finalized-instance))
(:report
(lambda (c s)
(format s "Instance is finalized: ~s"
(instance-finalized-instance c)))))
(define-condition instance-finalized-error (program-error instance-finalized)
())
(define-condition simple-instance-finalized-error (simple-condition
instance-finalized-error)
()
(:report
(lambda (c s)
(format s "Instance is finalized: ~s ~?"
(instance-finalized-instance c)
(simple-condition-format-control c)
(simple-condition-format-arguments c)))))
(defmacro assert-not-finalized (instance &optional format-control
&rest format-args)
(with-gensyms (%instance)
`(let ((,%instance ,instance))
(when (instance-finalized-p ,%instance)
,@(cond
(format-control
`((error 'simple-instance-finalized-error
:instance ,%instance
:format-control ,format-control
:format-arguments (list ,@format-args))))
(t
`((error 'instance-finalized-error
:instance ,%instance))))))))
;;; * FINALIZABLE-INSTANCE
(defstruct (finalizable-instance
(:conc-name #:%instance-))
(finalized-p nil
:type boolean))
(defmethod instance-finalized-p ((instance finalizable-instance))
(%instance-finalized-p instance))
(defmethod (setf instance-finalized-p) (new-value
(instance finalizable-instance))
(setf (%instance-finalized-p instance)
(when new-value t)))
(defmethod finalize :around ((instance finalizable-instance))
(unless (instance-finalized-p instance)
(when (next-method-p)
(call-next-method))
(setf (instance-finalized-p instance) t)))
(defmethod unfinalize :around ((instance finalizable-instance))
(when (instance-finalized-p instance)
(when (next-method-p)
(call-next-method))
(setf (instance-finalized-p instance) nil)))
;;; * FINALIZABLE-OBJECT
(defclass finalizable-object ()
((finalized-p
;; :read-only t ;; cf. read-only standard slots
:type boolean
:initform nil
:accessor instance-finalized-p
)))
(defmethod finalize :around ((instance finalizable-object))
(unless (instance-finalized-p instance)
(when (next-method-p)
(call-next-method))
(setf (instance-finalized-p instance) t)))
(defmethod unfinalize :around ((instance finalizable-object))
(when (instance-finalized-p instance)
(when (next-method-p)
(call-next-method))
(setf (instance-finalized-p instance) nil)))
| 3,226 | Common Lisp | .lisp | 89 | 31.865169 | 77 | 0.716129 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | b121918ed0645466a0e59c1ba5882aa73e1402547a6c83f9277545e55fe64f27 | 27,635 | [
-1
] |
27,636 | lupine-xmi.asd | GazeboHub_lupine-m2/src/main/lisp/lupine-xmi/lupine-xmi.asd | ;; -*- lisp -*-
(in-package #:asdf)
(eval-when (#:compile-toplevel #:load-toplevel #:execute)
;; ensure that the main sysdef is loaded, initially
(find-system #:lupine-aux))
(in-package #:lupine/system)
(defsystem #:lupine-xmi
:defsystem-depends-on (#:lupine-aux)
:components
((:file "package")
(:file "validation" :depends-on ("package"))
))
| 378 | Common Lisp | .asd | 12 | 27.583333 | 57 | 0.649171 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 2e17f1109271807e3ed3c96ee25b5c328a477c90781bcade909968b53775940a | 27,636 | [
-1
] |
27,637 | lupine-aux.asd | GazeboHub_lupine-m2/src/main/lisp/lupine-aux/lupine-aux.asd | ;; -*- lisp -*-
(in-package #:asdf)
(eval-when (#:compile-toplevel #:load-toplevel #:execute)
(defpackage #:lupine/system
(:use #:asdf #:cl)))
(in-package #:lupine/system)
(defsystem #:lupine-aux
:components
((:file "package")
(:file "refs" :depends-on ("package"))
(:file "strings" :depends-on ("package"))
(:file "files" :depends-on ("package"))
))
| 388 | Common Lisp | .asd | 13 | 26 | 57 | 0.609164 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | e13dfabd850d0858e927e3ed269598188eddd7521256e9ac77573146e42b03ee | 27,637 | [
-1
] |
27,638 | lupine-ucx.asd | GazeboHub_lupine-m2/module/ucx/src/main/lisp/lupine-ucx.asd | #| -*- lisp -*-
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
#-:asdf
(require #:asdf)
(in-package #:asdf-user)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defpackage #:lupine/system
(:use #:asdf #:cl)
))
(in-package #:lupine/system)
(defsystem #:lupine-ucx
;; :class 'lupine-system/system
;; :project #:lupine ;; FIXME: DEFPROJECT #:LUPINE
:depends-on (#:lupine-ns #:puri #:lupine-aux)
:components
((:file "package")
(:file "parse" :depends-on ("package"))))
| 781 | Common Lisp | .asd | 22 | 33 | 70 | 0.660453 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 86429cead0a765534e2ec2e728208d3ba2436a795d2761eb5bae939e32ab124f | 27,638 | [
-1
] |
27,639 | lupine-ns.asd | GazeboHub_lupine-m2/module/ns/src/main/lisp/lupine-ns.asd | #| -*- lisp -*-
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
#-:asdf
(require #:asdf)
(in-package #:asdf-user)
#-:lupine-asdf ;; defpackage
(asdf:find-system '#:lupine-pmmt)
(in-package #:lupine/system)
(defsystem #:lupine-ns
;; :class 'lupine-system/system
;; :project #:lupine
;; :defsystem-depends-on #:lupine-asdf
:depends-on (#:cxml #:puri #:lupine-final #:lupine-aux)
:components
((:file "package")
(:file "ns" :depends-on ("package"))
))
| 758 | Common Lisp | .asd | 22 | 31.818182 | 70 | 0.65522 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 4cc2c83126583dbf4900332a196163c77580c7767bd01e4c3d6f350b61daa162 | 27,639 | [
-1
] |
27,640 | lupine-mop.asd | GazeboHub_lupine-m2/module/mop/src/main/lisp/lupine-mop.asd | #| -*- lisp -*-
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
#-:asdf
(require #:asdf)
(in-package #:asdf-user)
#-:lupine-asdf
(asdf:find-system '#:lupine-pmmt) ;; defpackage
(in-package #:lupine/system)
(defsystem #:lupine-mop
:depends-on (#:closer-mop #:lupine-aux)
:components
((:file "package")
(:file "aux" :depends-on ("package"))
#+NULL-UNBOUND-SLOTS
;; unused - FIXME, move into a seperate module
(:file "null-unbound-slotd"
:depends-on ("package"))
#+NULL-UNBOUND-SLOTS
(:file "ext-std-class"
:depends-on ("null-unbound-slotd" "aux" "package"))
))
| 888 | Common Lisp | .asd | 26 | 31.076923 | 70 | 0.652989 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 5e2e3fee929ca05cfe7867b4d541f74d85135ee713a16e92e148e3bba70f746f | 27,640 | [
-1
] |
27,641 | lupine-xpc.asd | GazeboHub_lupine-m2/module/xpc/src/main/lisp/lupine-xpc.asd | #| -*- lisp -*-
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
#-:asdf
(require #:asdf)
(in-package #:asdf-user)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defpackage #:lupine/system
(:use #:asdf #:cl)
))
(in-package #:lupine/system)
(defsystem #:lupine-xpc
;; :class 'lupine-system/system
;; :project #:lupine ;; FIXME: DEFPROJECT #:LUPINE
:depends-on (#:lupine-ucx #:lupine-ns #:lupine-aux)
:components
((:file "package")
(:file "scan" :depends-on ("package"))
))
| 790 | Common Lisp | .asd | 23 | 31.782609 | 70 | 0.658762 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 171dc8a43bb150259451e5be72e0b5bcdce123bea7fcd94b31255bd5c4eae509 | 27,641 | [
-1
] |
27,642 | lupine-xmi.asd | GazeboHub_lupine-m2/module/xmi/src/main/lisp/lupine-xmi.asd | #| -*- lisp -*-
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
#-:asdf
(require #:asdf)
(in-package #:asdf-user)
#-:lupine-asdf ;; defpackage
(asdf:find-system '#:lupine-pmmt)
(in-package #:lupine/system)
(defsystem #:lupine-xmi
;; :class 'lupine-system/system
;; :project #:lupine
;; :defsystem-depends-on #:lupine-asdf
:depends-on (#:lupine-ns
#:cxml
#:lupine-mop
#:lupine-aux)
:components
((:file "package")
(:file "package-late" :depends-on ("package"))
(:file "transform" :depends-on ("package"))
(:file "util-cxml" :depends-on ("package"))
(:file "uri" :depends-on ("package"))
(:file "model" :depends-on ("package" "uri"))
(:file "transform-klacks" :depends-on ("package"
"package-late"
"transform"
"model"
"util-cxml"))
))
| 1,109 | Common Lisp | .asd | 34 | 28.588235 | 70 | 0.623243 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | f4229ad84089f9e441d9b29ee25b6b152a6e2efa3f9e1346a2b78d438f0eb093 | 27,642 | [
-1
] |
27,643 | lupine-aux.asd | GazeboHub_lupine-m2/module/aux/src/main/lisp/lupine-aux.asd | ;; -*- lisp -*-
(in-package #:cl-user)
#-asdf
(require #:asdf)
(defpackage #:lupine-aux-system
(:use #:asdf #:cl))
(in-package #:lupine-aux-system)
;; refer to http://www.alu.org/mop/index.html
(defsystem #:lupine-aux
:components
((:file "package")
(:file "type"
:depends-on ("package"))
(:file "macro"
:depends-on ("package" "type"))
(:file "seq"
:depends-on ("package" "type" "macro"))
(:file "condition"
:depends-on ("package"))
))
| 478 | Common Lisp | .asd | 20 | 20.75 | 45 | 0.612832 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 6983025d4c25a46a0abdb3c1ca8cb38f519208090ee347f60fd4347a5d04dfa0 | 27,643 | [
-1
] |
27,644 | lupine-pmmt.asd | GazeboHub_lupine-m2/module/pmmt/src/main/lisp/lupine-pmmt.asd | #| -*- lisp -*-
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
#-:asdf
(require #:asdf)
(in-package #:asdf-user)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defpackage #:lupine/system
(:use #:asdf #:cl)
))
(in-package #:lupine/system)
(defsystem #:lupine-pmmt
;; :class 'lupine-system/system
;; :project #:lupine ;; FIXME: DEFPROJECT #:LUPINE
:depends-on (#:puri #:lupine-aux)
:components
((:file "package")
(:file "project" :depends-on ("package"))
))
| 776 | Common Lisp | .asd | 23 | 31.173913 | 70 | 0.65906 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 0bc11105bf8fbc8ae5e6209fe49969c80b05616bedb3e1a319ecb8042f9424c0 | 27,644 | [
-1
] |
27,645 | lupine-final.asd | GazeboHub_lupine-m2/module/final/src/main/lisp/lupine-final.asd | #| -*- lisp -*-
Copyright (c) 2013, Sean Champ. All rights reserved.
This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this
distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
|#
#-:asdf
(require #:asdf)
(in-package #:asdf-user)
#-:lupine-asdf ;; defpackage
(asdf:find-system '#:lupine-pmmt)
(in-package #:lupine/system)
(defsystem #:lupine-final
;; :class 'lupine-system/system
;; :project #:lupine
;; :defsystem-depends-on #:lupine-asdf
:depends-on (#:lupine-aux)
:components
((:file "package")
(:file "final" :depends-on ("package"))
))
| 735 | Common Lisp | .asd | 22 | 30.772727 | 70 | 0.658156 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 78eec1d1d1f17b3c457b2f2f334a92151597c14a48e53ccc1423e55871769adf | 27,645 | [
-1
] |
27,648 | pom.xml | GazeboHub_lupine-m2/pom.xml | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ws.gazebo.ghub.lupine</groupId>
<artifactId>lupine</artifactId>
<version>1.0.1-SNAPSHOT</version>
<name>Project Lupine</name>
<packaging>pom</packaging>
<modules>
<module>module/aux</module>
<module>module/mop</module>
<module>module/asdf</module>
<module>module/pmmt</module>
<module>module/final</module>
<module>module/ns</module>
<module>module/ucx</module>
<module>module/xpc</module>
<module>module/m2</module>
<!-- unused -->
<!-- <module>module/xd</module> -->
<!-- <module>module/data-proxy</module> -->
</modules>
</project>
| 834 | Common Lisp | .l | 23 | 33.086957 | 104 | 0.699137 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 7b5d681fe23a67bc5cb37137e49ba01cb67641b9c7a5b06ed0cf854380b0a49b | 27,648 | [
-1
] |
27,655 | KnowledgeModeling.md | GazeboHub_lupine-m2/doc/wiki/KnowledgeModeling.md | Relevance of Knowledge Modeling Frameworks in Project Lupine
============================================================
_**Table of Contents**_
[TOC]
## Summary
## ODM
[ODM][odm] defines a set of MOF metamodels and UML profiles - collecively, albeit in non-normative terms, an MDA module - for visual, model-centric representation of a range of declarative languages including RDF, OWL, XML Topic Maps (ISO TMDM), and Common Logic. In turn, MOF and UML define conventions for normative, graphical representation of - respectively - metamodel and model elements, in a normative, abstract syntax.
Project Lupine proposes to provide explicit support for the ODM MDA module, as for purposes of intetrating RDF, OWL, TMDM, and Common Logic constructs and meta-constructs into more commonly known MDA modules such as SysML, SOAML, and UML itself, as well as for original MDA modules that may be developed in Project Lupine or in projects reusing components that may be developed of Project Lupine, such as [SpaceOWL][spaceowl], [Athtology][athtology], [#ArsDB][arsdb], the [Clyde Project][clyde], the [Gazebo Hub][ghub] project, and others.
### ODM onto RDF
### ODM onto OWL
#### Integrating [SWRL][swrl] into ODM for OWL
##### Developing an MOF Metamodel and UML Profile for RuleML
##### Integrating the RuleML Metamodel for MOF and UML Profile with ODM
### ODM onto ISO Common Logic
#### [Simple Common Logic][scl]
### ODM onto XML Topic Maps (ISO TMDM)
[odm]: http://www.omg.org/spec/ODM/1.0
[spaceowl]: https://sourceforge.net/projects/spaceowl/
[athtology]: https://sourceforge.net/projects/sportdb/
[arsdb]: https://sourceforge.net/projects/arsdb/
[clyde]: https://sourceforge.net/projects/clyde/
[ghub]: https://sourceforge.net/projects/ghub/
[swrl]: http://www.researchgate.net/publication/44065220_SWRL_A_Semantic_Web_Rule_Language_Combining_OWL_and_RuleML
[scl]: http://www.w3.org/2004/12/rules-ws/paper/103/
| 1,932 | Common Lisp | .l | 24 | 78.833333 | 539 | 0.746962 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 86596cb7e526024542e02c1342d9671b0063490d82959ecfc52625295018efc5 | 27,655 | [
-1
] |
27,656 | ModelingTypeRelations.md | GazeboHub_lupine-m2/doc/wiki/ModelingTypeRelations.md | Modeling Relations Among Common Lisp Data Types in Lupine M2
============================================================
_**Table of Contents**_
[TOC]
## Some Types of Model Element Relation in UML (M2)
Considering three specific modes of model element relation in UML, namely:
* Generalization
* Extension
* Realization
(referencing Cubetto)
This discussion will address how those three modes of relation can be factored onto the Common Lisp type system.
## Class and Type Relations in Common Lisp
Common Lisp defines concepts both of _Class_ and of _Type_.
* A Common Lisp _class_ has one or more _superclasses,_ as well as an ordered _class precedence list_ typically including at least the class itself, and the _system class_ 'T'.
* A Common Lisp class, once defined in the Lisp environment, serves as a type designator, both as the class itself and in the class' name, for a named class.
* A Common Lisp class has a _metaclass_, namely a class that the class itself is an _instance of_. (Classes, in Common Lisp, are first-order objects.)
* The matter of _generalization_ with regards to the definition of _types_, for types defined as by way of _cl:deftype_ or lexically scoped declarations, becomes slightly more complicated. The complexity of the model, in that context, may be attributed to the complexity of type definitions permitted in CLtL2.
### Complex Type Relations in Common Lisp
The Common Lisp type system permits the definition of types that may not present an exacting relation of generalization, though being no less relevant to the Common Lisp compiler, for purpose of type-oriented optimizations.
A modeling system based on MOF may endeavor to represent the relations of types in a complex Common Lisp type definition. Some reference may be drawn onto class diagrams in UML (as functionally within the MOF M2 and M1 tiers) however the complexity of the Common Lisp type system may serve to require something of an original approach to the metamodel (M2) design, for accurate modeling of Common Lisp type relations, in Common Lisp programs.
This discussion proposes to draw knowledge from the CType functionality in CMUCL, latterly forked in SBCL. The intention of drawing on that implementation-specific feature is not as if to lock the metamodel design into the features of any one Common Lisp implementation, but rather to inform the development of the Lupine M2 metamodel in accord with a graph defined of the CTypes model, in compiler interpretation of Common Lisp type definitions.
#### Common Lisp Compound Type Specifiers
_(ToDo: Also model these type specifiers, in the Lupine M2 metamodel. Firstly, determine how to best denote relations between these compound type specifiers and the respective types combined with relations in the same.)_
##### Type Specifiers, 'Or', 'And,' and 'Not'
The Common Lisp type system includes type specifiers for defining a _type_ as a _union_ or _intersection_ of one or more types, or alternately as a _complement_ of one type - respectively, the 'Or', 'And', and 'Not' type specifiers.
##### Type Specifiers, 'Eql' and 'Member'
The compound type specifiers 'Eql' and 'Member' provide a means for defining an object's type based on object equivalence, using the object equality predicate, 'EQL'.
##### Type Specifier, 'Satisfies'
The compound type specifier, 'Satisfies,' provides a means for defining an object's type as a consequence of the return value of a predicate function, when that predicate function would be applied to an object for purpose of type comparison.
(The behaviors are unspecified, if a predicate function used in a 'Satisfies' type definition may produce side effects beyond the computation of a _generalized boolean_ return value.)
#### Function Types in Common Lisp
Common Lisp defines functions as first-order objects. A Common Lisp program may declare that an object is a function, and may furthermore specify the argument value types and - furthermore, optionally - the return value types for the function object. Though typically optional from a perspective of Common Lisp program behaviors, an accurate function declaration may serve to support optimizations in compilation and runtime behaviors, for the function on which a function type is declared and for functions calling that function, in a program being compiled and/or ran in a given Common Lisp implementation.
### Superclass and Supertype
Considering that a class' name may also be used as a type name, and that not all types are classes, the Lupine M2 Model proposes that the _superclass_ relation inherits from the _supertype_ relation _(ToDo)_ - more generally, considering that the set of _types_ is a superset of the set of _classes_.
Furthemore, the Lupine M2 model proposes that the _supertype_ relation and the _type_ relation may be generalized, both, to a common ancestor in the metamodel. _(ToDo)_
### Class and Metaclass
Every Commmon Lisp class defined in CLtL2 is defined with a specific _metaclass_.
* System Class
* Built-In Class
* Structure Class
* Standard Class
Additionally, the type, _Condtion Type_ is defined in CLtL2. It would be assumed that _a Condition Type_ is a class, in a sense, considering that a specific _class precedence list_ is defined for each type of _Condition_.
#### The ANSI CL 'System Class' Type
Essentially, a _System Class_ defined in ANSI CL may be implemented as exactly one of a _Structure Class_, a _Standard Class_ or an implementation-specific _Built-In Class_, in any single Common Lisp implementation. Inasmuch, the exact relation between a _system class_ and any of a _built-in_, _structure_, or _standard class_ would be comprised as an _implementation specific_ feature - as explained in the book, CLtL2, by Guy Steele.
The _System Class_ type may be understood as it probably comprising a feature that would have been defined by ANSI X3J13, after the CLtL2 the book and prior to the finalization of ANSI Common Lisp (CLtL2, the programming language). It may be expected that definitions using metatypes _Built-In Class_ and _System Class_ will not be encountered in portable Common Lisp programs, except if to alter the behaviors of fundamental _implementation classes_, in any specific Common Lisp implementation.
In a portable Common Lisp program, a class may not be defined as having a _System Class_ as a _superclass_. The Lupine M2 model should seek to specify that limitation, within the metamodel, using OCL. _(ToDo)_
#### Class/Metaclass Relations onto UML (MOF M2, M1)
This discussion proposes that an M3 model for Common Lisp, if implemented as a _UML profile_, may utilize a _realization_ relation in UML, for denoting the relation between a _class_ and its _metaclass_. It would be recommended that a _realization_ relation, as such, would be denoted as a _"metaclass"_ relation, in order to indicate the application of that type of _relation,_ within a visual model.
For M2 and M1 modeling of Common Lisp programs onto UML, a UML stereotype extending _realization_ may be defined, for indicating the _metaclass_ relation in UML diagram tools supporting _UML profile_ extension. _(ToDo)_
| 7,164 | Common Lisp | .l | 49 | 144.265306 | 609 | 0.785018 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | edfd3e19982307cbfd29f7d5a7a4f075ad8ecdb732c04f5a0a5ffdabb5813818 | 27,656 | [
-1
] |
27,657 | UMLModelingTools.md | GazeboHub_lupine-m2/doc/wiki/UMLModelingTools.md | UML Modeling Tools
==================
_**Table of Contents**_
[TOC]
## Modeling Platforms
Project Lupine is surveying the following UML modeling platforms, on the desktop computing platform:
* [Modelio][modelio]
* [ArgoUML][argo]
* [Papyrus][papyrus]
Project Lupine is also making use of the following UML modeling tools, on the mobile computing platform:
* [Cubetto][cubetto]
### Modelio
**Availability**
* _[Free](http://archive.modeliosoft.com/en/products/modelio-free-edition.html)_ and _[Enterprise](http://archive.modeliosoft.com/en/products/modelio-enterprise-edition.html)_ Editions
**Noted Features**
* [Modelio][modelio] is extended with [Modelio Modules](http://www.modeliosoft.com/en/products/modeliosoft-modules-extensions.html)
* Modules may downloaded and/or purchased via the [Modelio store](http://www.modeliosoft.com/en/modelio-store.html)
* UML Profile Development supported with [MDA Designer](http://archive.modeliosoft.com/en/modules/modelio-mda-designer.html) features (unknown availability, not presently available in the module store), and with some features in recent editions of Modelio Free Edition (baseline)
* _[Creating Stereotypes](http://forge.modelio.org/projects/modelio-user-manual-english-22/wiki/Modeler-_modeler_mda_services_basic)_
* _[Adding Stereotypes to Elements](http://forge.modelio.org/projects/modelio-user-manual-english-221/wiki/Modeler-_modeler_building_models_add_stereotypes)_
**Noted Crtiticisms (Modelio 2.2.1)**
* Profile modeling and application, in Modelio, is not straightforward.
* The _MDA Designer_ features discussed at the web site (as previously denoted) do not appear to be available as an extenson to Modelio free edition, at this time (are those features only available with the commercially licensed Enterprise edition?)
* Profiles cannot be modeled as stand-alone diagrams, in the Free edition.
* Model element stereotypes can be created, in the Free edition, however stereotype application is unclear. When stereotypes are applied to diagram elements, the user is not given an option to enable display of the typical guillemet notation for stereotypes, e.g. _`<<metaclass>>`_. The diagram does not, by default, display the stereotypes applied to model elements. Stereotype application is only visible by way of the _properties_ view, on a selected diagram element
### ArgoUML
**Noted Features**
* [ArgoUML][argo] implements UML 1.4
* UML profiles can be developed within stand-alone diagrams
* UML profiles can be loaded and applied, relatively easily, within UML diagrams
* Display of Attribute and Operation fields on Class elements can be disabled
* Associations can be illustrated among diagram elements, using convenient "Drag and drop" interaction
* Supports _notation languages_ for UML 1.4, Java, and C++
* Supports _code generation_ for Java and C++
**Noted Criticisms**
* Implements an edition of UML older than the most currently available edition
* Diagram type (diagram, or profile diagram) must be selected at diagram creation time. (Without close integration between the M1 _profile model development_ and M1 _model development_ features, profiles may be more difficult to develop in parallel to the models in which the profiles are applied.)
### Papyrus
(To Do)
### Cubetto Mobile
(To Do)
[modelio]: http://www.modeliosoft.com/en/products/features.html
[argo]: http://argouml.tigris.org/
[papyrus]: www.eclipse.org/papyrus/
[cubetto]: http://www.semture.de/en/cubetto-mobile-en/overview
| 3,523 | Common Lisp | .l | 45 | 76.222222 | 473 | 0.78499 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 00144f3956bf8a5a812a386ce6aef03ac241f8a87414a0577e554fc98de5d54c | 27,657 | [
-1
] |
27,658 | pom.xml | GazeboHub_lupine-m2/module/ucx/pom.xml | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>Project Lupine</name>
<packaging>lisp</packaging>
<parent>
<groupId>ws.gazebo.ghub.lupine</groupId>
<version>1.0.1-SNAPSHOT</version>
<artifactId>lupine</artifactId>
</parent>
<artifactId>ucx</artifactId>
</project>
| 485 | Common Lisp | .l | 12 | 37.5 | 104 | 0.729387 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | ad801d0b663c9646eda66fd7a919e8f1abf53e38f9d520818ff1c8d618e722b2 | 27,658 | [
-1
] |
27,661 | pom.xml | GazeboHub_lupine-m2/module/data-proxy/pom.xml | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>Project Lupine</name>
<packaging>lisp</packaging>
<parent>
<groupId>ws.gazebo.ghub.lupine</groupId>
<version>1.0.1-SNAPSHOT</version>
<artifactId>lupine</artifactId>
</parent>
<artifactId>data-proxy</artifactId>
</project>
| 492 | Common Lisp | .l | 12 | 38.083333 | 104 | 0.73125 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 7b6ca8687f6a4f9d49472bacf3ee0ad5635df3c4a3d3d91efa2732e323f95289 | 27,661 | [
-1
] |
27,662 | uml-infrastructure.di.profile.notation | GazeboHub_lupine-m2/module/data-proxy/doc/Models_Papyrus/uml-infrastructure.di.profile.notation | <?xml version="1.0" encoding="UTF-8"?>
<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_dQ09kC_NEeOM36joGrlgrw" type="PapyrusUMLProfileDiagram" name="UMLInfrastructure" measurementUnit="Pixel">
<children xmi:type="notation:Shape" xmi:id="_6jzdgC_PEeOM36joGrlgrw" type="2007" fontName="Sans" fontHeight="10" lineColor="0">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_6j0EkC_PEeOM36joGrlgrw" source="ShadowFigure">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_6j0EkS_PEeOM36joGrlgrw" key="ShadowFigure_Value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_6j0Eki_PEeOM36joGrlgrw" source="displayNameLabelIcon">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_6j0Eky_PEeOM36joGrlgrw" key="displayNameLabelIcon_value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_6j0ElC_PEeOM36joGrlgrw" source="QualifiedName">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_6j0ElS_PEeOM36joGrlgrw" key="QualifiedNameDepth" value="1000"/>
</eAnnotations>
<children xmi:type="notation:DecorationNode" xmi:id="_6j0roC_PEeOM36joGrlgrw" type="5026"/>
<children xmi:type="notation:DecorationNode" xmi:id="_6j0roS_PEeOM36joGrlgrw" type="1005">
<children xmi:type="notation:Shape" xmi:id="__55YcC_PEeOM36joGrlgrw" type="3026" fontName="Sans" fontHeight="10" lineColor="0">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="__55Yci_PEeOM36joGrlgrw" source="ShadowFigure">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="__55_gC_PEeOM36joGrlgrw" key="ShadowFigure_Value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="__55_gS_PEeOM36joGrlgrw" source="displayNameLabelIcon">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="__55_gi_PEeOM36joGrlgrw" key="displayNameLabelIcon_value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="__55_gy_PEeOM36joGrlgrw" source="QualifiedName">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="__55_hC_PEeOM36joGrlgrw" key="QualifiedNameDepth" value="1000"/>
</eAnnotations>
<children xmi:type="notation:DecorationNode" xmi:id="__55_hS_PEeOM36joGrlgrw" type="5058"/>
<element xmi:type="uml:PrimitiveType" href="uml-infrastructure.di.profile.uml#__5skIC_PEeOM36joGrlgrw"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="__55YcS_PEeOM36joGrlgrw" x="7" y="66" width="133"/>
</children>
<children xmi:type="notation:Shape" xmi:id="_BcS_UC_QEeOM36joGrlgrw" type="3026" fontName="Sans" fontHeight="10" lineColor="0">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_BcTmYC_QEeOM36joGrlgrw" source="ShadowFigure">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_BcTmYS_QEeOM36joGrlgrw" key="ShadowFigure_Value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_BcTmYi_QEeOM36joGrlgrw" source="displayNameLabelIcon">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_BcTmYy_QEeOM36joGrlgrw" key="displayNameLabelIcon_value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_BcTmZC_QEeOM36joGrlgrw" source="QualifiedName">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_BcTmZS_QEeOM36joGrlgrw" key="QualifiedNameDepth" value="1000"/>
</eAnnotations>
<children xmi:type="notation:DecorationNode" xmi:id="_BcTmZi_QEeOM36joGrlgrw" type="5058"/>
<element xmi:type="uml:PrimitiveType" href="uml-infrastructure.di.profile.uml#_BcCgoC_QEeOM36joGrlgrw"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_BcS_US_QEeOM36joGrlgrw" x="7" y="126" width="133"/>
</children>
<children xmi:type="notation:Shape" xmi:id="_CteTUC_QEeOM36joGrlgrw" type="3026" fontName="Sans" fontHeight="10" lineColor="0">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Cte6YC_QEeOM36joGrlgrw" source="ShadowFigure">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Cte6YS_QEeOM36joGrlgrw" key="ShadowFigure_Value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Cte6Yi_QEeOM36joGrlgrw" source="displayNameLabelIcon">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Cte6Yy_QEeOM36joGrlgrw" key="displayNameLabelIcon_value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Cte6ZC_QEeOM36joGrlgrw" source="QualifiedName">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Cte6ZS_QEeOM36joGrlgrw" key="QualifiedNameDepth" value="1000"/>
</eAnnotations>
<children xmi:type="notation:DecorationNode" xmi:id="_Cte6Zi_QEeOM36joGrlgrw" type="5058"/>
<element xmi:type="uml:PrimitiveType" href="uml-infrastructure.di.profile.uml#_CtObsC_QEeOM36joGrlgrw"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_CteTUS_QEeOM36joGrlgrw" x="7" y="186" width="133"/>
</children>
<children xmi:type="notation:Shape" xmi:id="_EVD8MC_QEeOM36joGrlgrw" type="3026" fontName="Sans" fontHeight="10" lineColor="0">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EVEjQC_QEeOM36joGrlgrw" source="ShadowFigure">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EVEjQS_QEeOM36joGrlgrw" key="ShadowFigure_Value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EVEjQi_QEeOM36joGrlgrw" source="displayNameLabelIcon">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EVEjQy_QEeOM36joGrlgrw" key="displayNameLabelIcon_value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EVEjRC_QEeOM36joGrlgrw" source="QualifiedName">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EVEjRS_QEeOM36joGrlgrw" key="QualifiedNameDepth" value="1000"/>
</eAnnotations>
<children xmi:type="notation:DecorationNode" xmi:id="_EVEjRi_QEeOM36joGrlgrw" type="5058"/>
<element xmi:type="uml:PrimitiveType" href="uml-infrastructure.di.profile.uml#_EUvMEC_QEeOM36joGrlgrw"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_EVD8MS_QEeOM36joGrlgrw" x="7" y="246" width="133"/>
</children>
<children xmi:type="notation:Shape" xmi:id="_F05-UC_QEeOM36joGrlgrw" type="3026" fontName="Sans" fontHeight="10" lineColor="0">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_F06lYC_QEeOM36joGrlgrw" source="ShadowFigure">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_F06lYS_QEeOM36joGrlgrw" key="ShadowFigure_Value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_F06lYi_QEeOM36joGrlgrw" source="displayNameLabelIcon">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_F06lYy_QEeOM36joGrlgrw" key="displayNameLabelIcon_value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_F06lZC_QEeOM36joGrlgrw" source="QualifiedName">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_F06lZS_QEeOM36joGrlgrw" key="QualifiedNameDepth" value="1000"/>
</eAnnotations>
<children xmi:type="notation:DecorationNode" xmi:id="_F06lZi_QEeOM36joGrlgrw" type="5058"/>
<element xmi:type="uml:PrimitiveType" href="uml-infrastructure.di.profile.uml#_F0r74C_QEeOM36joGrlgrw"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_F05-US_QEeOM36joGrlgrw" x="7" y="306" width="133"/>
</children>
<children xmi:type="notation:Shape" xmi:id="_SJ2hwC_QEeOM36joGrlgrw" type="1007" fontName="Sans" fontHeight="10" lineColor="0">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_SJ3I0C_QEeOM36joGrlgrw" source="ShadowFigure">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_SJ3I0S_QEeOM36joGrlgrw" key="ShadowFigure_Value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_SJ3I0i_QEeOM36joGrlgrw" source="displayNameLabelIcon">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_SJ3I0y_QEeOM36joGrlgrw" key="displayNameLabelIcon_value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_SJ3I1C_QEeOM36joGrlgrw" source="QualifiedName">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_SJ3I1S_QEeOM36joGrlgrw" key="QualifiedNameDepth" value="1000"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_jGC9IC_QEeOM36joGrlgrw" source="PapyrusHyperLink_Object" references="_6jzdgC_PEeOM36joGrlgrw">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_jGC9IS_QEeOM36joGrlgrw" key="tooltip_text"/>
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_jGC9Ii_QEeOM36joGrlgrw" key="pageName" value="PapyrusHyperLink_Object"/>
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_jGC9Iy_QEeOM36joGrlgrw" key="is_default_navigation" value="false"/>
</eAnnotations>
<children xmi:type="notation:DecorationNode" xmi:id="_SJ3I1i_QEeOM36joGrlgrw" type="1008"/>
<element xmi:type="uml:Comment" href="uml-infrastructure.di.profile.uml#_SJIJAC_QEeOM36joGrlgrw"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_SJ2hwS_QEeOM36joGrlgrw" x="7" y="6" width="133" height="49"/>
</children>
<children xmi:type="notation:Shape" xmi:id="_5HXfQC_QEeOM36joGrlgrw" type="1007" fontName="Sans" fontHeight="10" lineColor="0">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_5HYGUC_QEeOM36joGrlgrw" source="ShadowFigure">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_5HYGUS_QEeOM36joGrlgrw" key="ShadowFigure_Value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_5HYGUi_QEeOM36joGrlgrw" source="displayNameLabelIcon">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_5HYGUy_QEeOM36joGrlgrw" key="displayNameLabelIcon_value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_5HYGVC_QEeOM36joGrlgrw" source="QualifiedName">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_5HYGVS_QEeOM36joGrlgrw" key="QualifiedNameDepth" value="1000"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_CcbxMC_REeOM36joGrlgrw" source="PapyrusHyperLink_Object" references="__55YcC_PEeOM36joGrlgrw">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_CcbxMS_REeOM36joGrlgrw" key="tooltip_text"/>
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_CcbxMi_REeOM36joGrlgrw" key="pageName" value="PapyrusHyperLink_Object"/>
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_CcbxMy_REeOM36joGrlgrw" key="is_default_navigation" value="false"/>
</eAnnotations>
<children xmi:type="notation:DecorationNode" xmi:id="_5HYGVi_QEeOM36joGrlgrw" type="1008"/>
<element xmi:type="uml:Comment" href="uml-infrastructure.di.profile.uml#_5HO8YC_QEeOM36joGrlgrw"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_5HXfQS_QEeOM36joGrlgrw" x="175" y="69" height="35"/>
</children>
<children xmi:type="notation:Shape" xmi:id="_EY-9cC_REeOM36joGrlgrw" type="1007" fontName="Sans" fontHeight="10" lineColor="0">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EY_kgC_REeOM36joGrlgrw" source="ShadowFigure">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EY_kgS_REeOM36joGrlgrw" key="ShadowFigure_Value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EY_kgi_REeOM36joGrlgrw" source="displayNameLabelIcon">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EY_kgy_REeOM36joGrlgrw" key="displayNameLabelIcon_value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EY_khC_REeOM36joGrlgrw" source="QualifiedName">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_EY_khS_REeOM36joGrlgrw" key="QualifiedNameDepth" value="1000"/>
</eAnnotations>
<children xmi:type="notation:DecorationNode" xmi:id="_EY_khi_REeOM36joGrlgrw" type="1008"/>
<element xmi:type="uml:Comment" href="uml-infrastructure.di.profile.uml#_EYvs4C_REeOM36joGrlgrw"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_EY-9cS_REeOM36joGrlgrw" x="175" y="129" height="37"/>
</children>
<children xmi:type="notation:Shape" xmi:id="_HdpoUC_REeOM36joGrlgrw" type="1007" fontName="Sans" fontHeight="10" lineColor="0">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_HdqPYC_REeOM36joGrlgrw" source="ShadowFigure">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HdqPYS_REeOM36joGrlgrw" key="ShadowFigure_Value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_HdqPYi_REeOM36joGrlgrw" source="displayNameLabelIcon">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HdqPYy_REeOM36joGrlgrw" key="displayNameLabelIcon_value" value="false"/>
</eAnnotations>
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_HdqPZC_REeOM36joGrlgrw" source="QualifiedName">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HdqPZS_REeOM36joGrlgrw" key="QualifiedNameDepth" value="1000"/>
</eAnnotations>
<children xmi:type="notation:DecorationNode" xmi:id="_Hdq2cC_REeOM36joGrlgrw" type="1008"/>
<element xmi:type="uml:Comment" href="uml-infrastructure.di.profile.uml#_HddbEC_REeOM36joGrlgrw"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_HdpoUS_REeOM36joGrlgrw" x="175" y="189" height="37"/>
</children>
<styles xmi:type="notation:TitleStyle" xmi:id="_6j0roi_PEeOM36joGrlgrw"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_6j0roy_PEeOM36joGrlgrw"/>
</children>
<element xmi:type="uml:Package" href="uml-infrastructure.di.profile.uml#_6jmpMC_PEeOM36joGrlgrw"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_6jzdgS_PEeOM36joGrlgrw" x="24" width="457" height="397"/>
</children>
<styles xmi:type="notation:DiagramStyle" xmi:id="_dQ09kS_NEeOM36joGrlgrw"/>
<element xmi:type="uml:Profile" href="uml-infrastructure.di.profile.uml#_dQzvcC_NEeOM36joGrlgrw"/>
</notation:Diagram>
| 14,848 | Common Lisp | .l | 159 | 84.836478 | 354 | 0.724488 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 09e261a625f91074d064d1090cc9b3b1fede004cfa1f971c7ca2392ab0bc8124 | 27,662 | [
-1
] |
27,663 | uml-infrastructure.di.profile.uml | GazeboHub_lupine-m2/module/data-proxy/doc/Models_Papyrus/uml-infrastructure.di.profile.uml | <?xml version="1.0" encoding="UTF-8"?>
<uml:Profile xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_dQzvcC_NEeOM36joGrlgrw" name="Profile" metamodelReference="_dQzvcS_NEeOM36joGrlgrw">
<packageImport xmi:type="uml:PackageImport" xmi:id="_dQzvcS_NEeOM36joGrlgrw">
<importedPackage xmi:type="uml:Model" href="pathmap://UML_METAMODELS/UML.metamodel.uml#_0"/>
</packageImport>
<packageImport xmi:type="uml:PackageImport" xmi:id="_dQzvci_NEeOM36joGrlgrw">
<importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
</packageImport>
<packagedElement xmi:type="uml:Package" xmi:id="_VtA78C_PEeOM36joGrlgrw" name="PrimitiveTypes" URI="http://www.omg.org/spec/PrimitiveTypes/20110701"/>
<packagedElement xmi:type="uml:Package" xmi:id="_6jmpMC_PEeOM36joGrlgrw" name="PrimitiveTypes" URI="http://www.omg.org/spec/PrimitiveTypes/20110701">
<ownedComment xmi:type="uml:Comment" xmi:id="_SJIJAC_QEeOM36joGrlgrw">
<body>org.omg.xmi.nsPrefix
primitives</body>
</ownedComment>
<ownedComment xmi:type="uml:Comment" xmi:id="_5HO8YC_QEeOM36joGrlgrw">
<body>http://www.w3.org/2001/XMLSchema#boolean</body>
</ownedComment>
<ownedComment xmi:type="uml:Comment" xmi:id="_EYvs4C_REeOM36joGrlgrw">
<body>http://www.w3.org/2001/XMLSchema#integer</body>
</ownedComment>
<ownedComment xmi:type="uml:Comment" xmi:id="_HddbEC_REeOM36joGrlgrw">
<body>http://www.w3.org/2001/XMLSchema#double</body>
</ownedComment>
<packagedElement xmi:type="uml:PrimitiveType" xmi:id="__5skIC_PEeOM36joGrlgrw" name="Boolean"/>
<packagedElement xmi:type="uml:PrimitiveType" xmi:id="_BcCgoC_QEeOM36joGrlgrw" name="Integer"/>
<packagedElement xmi:type="uml:PrimitiveType" xmi:id="_CtObsC_QEeOM36joGrlgrw" name="Real"/>
<packagedElement xmi:type="uml:PrimitiveType" xmi:id="_EUvMEC_QEeOM36joGrlgrw" name="String"/>
<packagedElement xmi:type="uml:PrimitiveType" xmi:id="_F0r74C_QEeOM36joGrlgrw" name="UnlimitedNatural"/>
</packagedElement>
</uml:Profile>
| 2,127 | Common Lisp | .l | 30 | 66.633333 | 228 | 0.744874 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 5b05128ecd0cd048c3a283535ae9b806e63f35793369785bf695384618abbbaf | 27,663 | [
-1
] |
27,664 | uml-infrastructure.di.profile.di | GazeboHub_lupine-m2/module/data-proxy/doc/Models_Papyrus/uml-infrastructure.di.profile.di | <?xml version="1.0" encoding="UTF-8"?>
<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi">
<pageList>
<availablePage>
<emfPageIdentifier href="uml-infrastructure.di.profile.notation#_dQ09kC_NEeOM36joGrlgrw"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="uml-infrastructure.di.profile.notation#_dQ09kC_NEeOM36joGrlgrw"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
| 721 | Common Lisp | .l | 17 | 37.411765 | 182 | 0.700284 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | a97f9d2f587e82ef86299284cb130590adda746882be9b5ecbe2405ea2d2b18b | 27,664 | [
-1
] |
27,665 | usecase.style | GazeboHub_lupine-m2/module/data-proxy/doc/Models_Modelio/Lupine CORBA/data/.config/styles/usecase.style | #
#Wed Jun 01 15:56:20 CEST 2011
ASSOC_SHOWLABEL=false
ASSOC_SHOWROLES=false
basestyle=default
stylename=use case
ASSOC_SHOWCARD=false
ASSOC_SHOWNAVIGABILITY = false
ASSOC_CONNECTIONROUTER = DIRECT
| 198 | Common Lisp | .l | 9 | 21 | 31 | 0.862434 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | adc18271f1bab8ebde9722e193364b4272debe61c64f2e8773effa7e1d9b513d | 27,665 | [
-1
] |
27,666 | ramc.style | GazeboHub_lupine-m2/module/data-proxy/doc/Models_Modelio/Lupine CORBA/data/.config/styles/ramc.style | #
#Mon Sep 05 14:13:55 CEST 2011
ARTIFACT_LINECOLOR=128 128 128
BPMNSEQUENCEFLOW_TEXTCOLOR=128 128 128
CONNECTIONPOINT_TEXTCOLOR=128 128 128
INFOITEM_LINECOLOR=128 128 128
CLAUSE_TEXTCOLOR=128 128 128
COMMUNICATIONNODE_REPMODE=SIMPLE
USECASE_REPMODE=SIMPLE
SHALLOWHISTORY_FILLCOLOR=255 255 220
PARTITION_FILLCOLOR=255 255 220
INITIAL_TEXTCOLOR=128 128 128
PROVIDEDINTERFACE_TEXTCOLOR=128 128 128
ENTRY_REPMODE=SIMPLE
COLLABORATION_FILLMODE=SOLID
TASK_TEXTCOLOR=128 128 128
COMMUNICATIONNODE_TEXTCOLOR=128 128 128
CONSTRAINT_FILLCOLOR=255 255 220
SHALLOWHISTORY_LINECOLOR=128 128 128
LOOPNODE_FILLCOLOR=255 255 220
PARTITION_LINECOLOR=128 128 128
INSTANCELINK_REPRES_MODE=SIMPLE
ACTION_REPMODE=SIMPLE
COLLABORATIONUSE_REPMODE=SIMPLE
CONDITIONAL_FILLCOLOR=255 255 220
CONSTRAINT_LINECOLOR=128 128 128
INTERACTIONOPERAND_LINECOLOR=128 128 128
DATA_FILLCOLOR=255 255 220
LOOPNODE_LINECOLOR=128 128 128
REQUIREMENT_REPMODE=SIMPLE
INTERMEDIATECATCHEVENT_TEXTCOLOR=128 128 128
CALLBEHAVIOR_FILLCOLOR=255 255 220
USECASEDEPENDENCY_TEXTCOLOR=128 128 128
CHANGEEVENT_LINECOLOR=128 128 128
OUTPUTPIN_FILLCOLOR=255 255 220
INSTANCE_LINECOLOR=128 128 128
RAISEDEXCEPTION_LINECOLOR=128 128 128
DEEPHISTORY_TEXTCOLOR=128 128 128
REQUIREMENT_CONTAINER_REPMODE=SIMPLE
JUNCTION_REPMODE=SIMPLE
REQUIREDINTERFACE_FILLCOLOR=255 255 220
INTERMEDIATTHROWEVENT_REPMODE=SIMPLE
INFOFLOWLINK_LINECOLOR=128 128 128
ENTRY_FILLMODE=SOLID
STRUCTUREDACTIVITY_REPMODE=SIMPLE
SEQUENCEDIAGRAMVIEW_FILLCOLOR=255 255 220
EXECUTIONSPECIFICATION_FILLCOLOR=255 255 220
REQUIREDINTERFACE_LINECOLOR=128 128 128
PACKAGEIMPORT_LINECOLOR=128 128 128
TERMINAL_REPMODE=SIMPLE
GATEWAY_FILLCOLOR=255 255 220
ACCEPTSIGNAL_FILLMODE=SOLID
CONTROLFLOW_LINECOLOR=128 128 128
SEQUENCEDIAGRAMVIEW_LINECOLOR=128 128 128
EXECUTIONSPECIFICATION_LINECOLOR=128 128 128
COLLABORATIONUSE_TEXTCOLOR=128 128 128
DEPENDENCY_TEXTCOLOR=128 128 128
EXPANSIONNODE_TEXTCOLOR=128 128 128
COMPONENT_FILLMODE=SOLID
NAMESPACEUSE_LINECOLOR=128 128 128
STRUCTUREDACTIVITY_FILLMODE=SOLID
INTERACTIONUSE_REPMODE=SIMPLE
COMPONENT_FILLCOLOR=255 255 220
USECASE_FILLCOLOR=255 255 220
IMPORT_LINECOLOR=128 128 128
INFOITEM_FILLMODE=SOLID
SIGNAL_FILLCOLOR=255 255 220
CENTRALBUFFER_REPMODE=SIMPLE
COMBINEDFRAGMENT_FILLCOLOR=255 255 220
REQUIREMENT_FILLCOLOR=255 255 220
CALLEVENT_LINECOLOR=128 128 128
DATA_FILLMODE=SOLID
CALLOPERATION_FILLMODE=SOLID
GATEWAY_REPMODE=SIMPLE
TERM_FILLCOLOR=255 255 220
FLOWFINAL_FILLCOLOR=255 255 220
GOAL_LINECOLOR=128 128 128
ACTIVITYFINAL_FILLMODE=SOLID
CONNECTOR_TEXTCOLOR=128 128 128
ACCEPTSIGNAL_TEXTCOLOR=128 128 128
DATATYPE_TEXTCOLOR=128 128 128
GOAL_CONTAINER_LINECOLOR=128 128 128
STATEINVARIANT_TEXTCOLOR=128 128 128
CONNECTIONPOINT_FILLCOLOR=255 255 220
EXPANSIONNODE_FILLMODE=SOLID
REQUIREDINTERFACE_FILLMODE=SOLID
PORT_REPMODE=SIMPLE
BUSINESSRULE_CONTAINER_LINECOLOR=128 128 128
OUTPUTPIN_REPMODE=SIMPLE
TRANSITION_TEXTCOLOR=128 128 128
DECISIONMERGE_FILLMODE=SOLID
INITIAL_FILLCOLOR=255 255 220
ACTION_FILLMODE=SOLID
TASK_FILLCOLOR=255 255 220
COMMUNICATIONNODE_FILLCOLOR=255 255 220
ENUM_FILLMODE=SOLID
ASSOC_LINECOLOR=128 128 128
FORKJOIN_LINECOLOR=128 128 128
ACTIVITYFINAL_TEXTCOLOR=128 128 128
SENDSIGNALACTION_LINECOLOR=128 128 128
COLLABORATION_TEXTCOLOR=128 128 128
CONNECTOR_FILLMODE=SOLID
DECISIONMERGE_REPMODE=SIMPLE
TERM_REPMODE=SIMPLE
INTERMEDIATECATCHEVENT_FILLCOLOR=255 255 220
MESSAGE_LINECOLOR=128 128 128
EXCEPTIONHANDLER_LINECOLOR=128 128 128
GATE_LINECOLOR=128 128 128
DEEPHISTORY_FILLCOLOR=255 255 220
INTERFACEREALIZATION_LINECOLOR=128 128 128
REGION_FILLMODE=SOLID
TIMEEVENT_FILLMODE=SOLID
STATEDIAGRAMVIEW_TEXTCOLOR=128 128 128
FINALSTATE_FILLMODE=SOLID
CLASSASSOC_LINECOLOR=128 128 128
DECISIONMERGE_LINECOLOR=128 128 128
TEMPLATEBINDING_TEXTCOLOR=128 128 128
BPMNMESSAGEFLOW_TEXTCOLOR=128 128 128
OUTPUTPIN_FILLMODE=SOLID
CALLEVENT_REPMODE=SIMPLE
BPMNLANE_FILLMODE=SOLID
REQUIREMENT_CONTAINER_FILLMODE=SOLID
EXIT_REPMODE=SIMPLE
OBJECTFLOW_LINECOLOR=128 128 128
EXPANSIONNODE_FILLCOLOR=255 255 220
TIMEEVENT_TEXTCOLOR=128 128 128
CALLOPERATION_TEXTCOLOR=128 128 128
BOUNDARYEVENT_LINECOLOR=128 128 128
CONNECTOR_REPRES_MODE=SIMPLE
COLLABORATIONUSE_LINECOLOR=128 128 128
LIFELINE_REPMODE=SIMPLE
DEPENDENCY_LINECOLOR=128 128 128
EXPANSIONNODE_LINECOLOR=128 128 128
BUSINESSRULE_REPMODE=SIMPLE
PARTITION_FILLMODE=SOLID
OBJECTNODE_LINECOLOR=128 128 128
ARTIFACT_REPMODE=SIMPLE
GATEWAY_FILLMODE=SOLID
REGION_FILLCOLOR=255 255 220
STARTEVENT_LINECOLOR=128 128 128
CLASS_TEXTCOLOR=128 128 128
ARTIFACT_FILLMODE=SOLID
JUNCTION_FILLMODE=SOLID
LOOPNODE_FILLMODE=SOLID
SUBPROCESS_LINECOLOR=128 128 128
ACCEPTSIGNAL_FILLCOLOR=255 255 220
BPMNMESSAGE_TEXTCOLOR=128 128 128
DATATYPE_FILLCOLOR=255 255 220
CHOICE_TEXTCOLOR=128 128 128
STATEINVARIANT_FILLCOLOR=255 255 220
VALUEPIN_FILLMODE=SOLID
INPUTPIN_TEXTCOLOR=128 128 128
CONNECTOR_LINECOLOR=128 128 128
OBJECTNODE_FILLMODE=SOLID
DATATYPE_LINECOLOR=128 128 128
DEEPHISTORY_REPMODE=SIMPLE
FLOWFINAL_TEXTCOLOR=128 128 128
CONNECTIONPOINT_FILLMODE=SOLID
STRUCTUREDACTIVITY_TEXTCOLOR=128 128 128
INTERACTIONUSE_FILLMODE=SOLID
TASK_FILLMODE=SOLID
TRANSITION_LINECOLOR=128 128 128
INPUTPIN_REPMODE=SIMPLE
COMMUNICATIONDIAGRAMVIEW_REPRES_MODE=SIMPLE
INSTANCELINK_TEXTCOLOR=128 128 128
ACTIVITYFINAL_FILLCOLOR=255 255 220
INTERNALTRANSITION_TEXTCOLOR=128 128 128
COLLABORATION_FILLCOLOR=255 255 220
STATEINVARIANT_REPMODE=SIMPLE
ACTOR_FILLMODE=SOLID
ACTIVITYFINAL_LINECOLOR=128 128 128
LIFELINE_TEXTCOLOR=128 128 128
PROVIDEDINTERFACE_REPRES_MODE=SIMPLE
DICTIONARY_TEXTCOLOR=128 128 128
GATE_REPMODE=SIMPLE
STATEDIAGRAMVIEW_FILLCOLOR=255 255 220
BPMNLANE_TEXTCOLOR=128 128 128
REQUIREMENT_CONTAINER_TEXTCOLOR=128 128 128
CONDITIONAL_LINECOLOR=128 128 128
NOTE_FILLMODE=SOLID
DATA_LINECOLOR=128 128 128
INTERMEDIATECATCHEVENT_REPMODE=SIMPLE
BPMNMESSAGEFLOW_LINECOLOR=128 128 128
EXPANSIONREGION_REPMODE=SIMPLE
CALLBEHAVIOR_LINECOLOR=128 128 128
FORK_FILLMODE=SOLID
TIMEEVENT_FILLCOLOR=255 255 220
CALLOPERATION_FILLCOLOR=255 255 220
DATATYPE_REPRES_MODE=SIMPLE
OUTPUTPIN_LINECOLOR=128 128 128
EXPANSIONREGION_TEXTCOLOR=128 128 128
GENZ_TEXTCOLOR=128 128 128
TERMINAL_TEXTCOLOR=128 128 128
INTERRUPTIBLE_LINECOLOR=128 128 128
COMPONENT_REPRES_MODE=SIMPLE
NOTE_TEXTCOLOR=128 128 128
TERM_FILLMODE=SOLID
GATEWAY_LINECOLOR=128 128 128
CLASS_FILLCOLOR=255 255 220
DEEPHISTORY_FILLMODE=SOLID
COLLABORATIONUSELINK_LINECOLOR=128 128 128
ENDEVENT_FILLMODE=SOLID
CHOICE_FILLCOLOR=255 255 220
BPMNMESSAGE_FILLCOLOR=255 255 220
STATICDIAGRAMVIEW_TEXTCOLOR=128 128 128
DATASTORE_REPMODE=SIMPLE
INPUTPIN_FILLCOLOR=255 255 220
COMPONENT_LINECOLOR=128 128 128
USECASE_LINECOLOR=128 128 128
JOIN_FILLMODE=SOLID
MANIFESTATION_TEXTCOLOR=128 128 128
SIGNAL_LINECOLOR=128 128 128
BOUNDARYEVENT_REPMODE=SIMPLE
STRUCTUREDACTIVITY_FILLCOLOR=255 255 220
COMBINEDFRAGMENT_LINECOLOR=128 128 128
INSTANCE_FILLMODE=SOLID
REQUIREMENT_LINECOLOR=128 128 128
ENUM_TEXTCOLOR=128 128 128
TERM_LINECOLOR=128 128 128
INTERACTIONUSE_TEXTCOLOR=128 128 128
DATASTORE_TEXTCOLOR=128 128 128
FLOWFINAL_LINECOLOR=128 128 128
LOOPNODE_REPMODE=SIMPLE
INSTANCELINK_FILLCOLOR=255 255 220
CONDITIONAL_FILLMODE=SOLID
SEQUENCEDIAGRAMVIEW_FILLMODE=SOLID
FORKJOIN_REPMODE=SIMPLE
INTERMEDIATTHROWEVENT_FILLMODE=SOLID
BPMNSEQUENCEFLOW_LINECOLOR=128 128 128
SIGNAL_REPMODE=SIMPLE
CONNECTIONPOINT_LINECOLOR=128 128 128
INSTANCELINK_LINECOLOR=128 128 128
LIFELINE_FILLCOLOR=255 255 220
GOAL_REPMODE=SIMPLE
ACTION_TEXTCOLOR=128 128 128
DICTIONARY_FILLCOLOR=255 255 220
ENTRY_TEXTCOLOR=128 128 128
PROVIDEDINTERFACE_LINECOLOR=128 128 128
SUBPROCESS_FILLMODE=SOLID
OBJECTNODE_REPMODE=SIMPLE
TASK_LINECOLOR=128 128 128
CONDITIONAL_REPMODE=SIMPLE
CENTRALBUFFER_TEXTCOLOR=128 128 128
COMMUNICATIONNODE_LINECOLOR=128 128 128
BPMNLANE_FILLCOLOR=255 255 220
REQUIREMENT_CONTAINER_FILLCOLOR=255 255 220
CHOICE_REPMODE=SIMPLE
BUSINESSRULE_FILLMODE=SOLID
REQUIREMENT_CONTAINER_LINECOLOR=128 128 128
ACTOR_TEXTCOLOR=128 128 128
INTERMEDIATECATCHEVENT_LINECOLOR=128 128 128
INSTANCE_REPRES_MODE=SIMPLE
CONNECTIONPOINT_REPMODE=SIMPLE
USECASEDEPENDENCY_LINECOLOR=128 128 128
VALUEPIN_TEXTCOLOR=128 128 128
INPUTPIN_FILLMODE=SOLID
EXPANSIONREGION_FILLCOLOR=255 255 220
GENZ_FILLCOLOR=255 255 220
EXIT_TEXTCOLOR=128 128 128
DEEPHISTORY_LINECOLOR=128 128 128
EXIT_FILLMODE=SOLID
ACCEPTSIGNAL_REPMODE=SIMPLE
INTERMEDIATTHROWEVENT_TEXTCOLOR=128 128 128
NOTE_FILLCOLOR=255 255 220
STATE_REPMODE=SIMPLE
CENTRALBUFFER_FILLMODE=SOLID
PACKAGEMERGE_TEXTCOLOR=128 128 128
COMMUNICATIONCHANNEL_TEXTCOLOR=128 128 128
CHOICE_FILLMODE=SOLID
CHANGEEVENT_FILLMODE=SOLID
NOTE_LINECOLOR=128 128 128
FINALSTATE_REPMODE=SIMPLE
STATICDIAGRAMVIEW_FILLCOLOR=255 255 220
ACTOR_REPMODE=SIMPLE
REQUIREMENT_FILLMODE=SOLID
NODE_TEXTCOLOR=128 128 128
JOIN_FILLCOLOR=255 255 220
SIGNAL_FILLMODE=SOLID
ENUM_FILLCOLOR=255 255 220
CALLEVENT_FILLMODE=SOLID
DATASTORE_FILLCOLOR=255 255 220
INTERACTIONUSE_FILLCOLOR=255 255 220
BUSINESSRULE_CONTAINER_REPMODE=SIMPLE
INTERFACE_REPRES_MODE=SIMPLE
INTERACTIONUSE_LINECOLOR=128 128 128
ACCEPTSIGNAL_LINECOLOR=128 128 128
STATEINVARIANT_LINECOLOR=128 128 128
PORT_FILL_COLOR=255 255 220
CHANGEEVENT_TEXTCOLOR=128 128 128
INITIALSTATE_TEXTCOLOR=128 128 128
SEQUENCEDIAGRAMVIEW_REPRES_MODE=SIMPLE
INSTANCE_TEXTCOLOR=128 128 128
RAISEDEXCEPTION_TEXTCOLOR=128 128 128
ACTION_FILLCOLOR=255 255 220
ENTRY_FILLCOLOR=255 255 220
INFOFLOWLINK_TEXTCOLOR=128 128 128
INITIALSTATE_REPMODE=SIMPLE
CENTRALBUFFER_FILLCOLOR=255 255 220
BUSINESSRULE_CONTAINER_FILLMODE=SOLID
EXPANSIONREGION_FILLMODE=SOLID
ENTRY_LINECOLOR=128 128 128
PACKAGEIMPORT_TEXTCOLOR=128 128 128
PACKAGE_TEXTCOLOR=128 128 128
CENTRALBUFFER_LINECOLOR=128 128 128
COLLABORATION_LINECOLOR=128 128 128
LIFELINE_FILLMODE=SOLID
SENDSIGNALACTION_FILLMODE=SOLID
ACTOR_FILLCOLOR=255 255 220
BUSINESSRULE_TEXTCOLOR=128 128 128
FORKJOIN_FILLMODE=SOLID
VALUEPIN_FILLCOLOR=255 255 220
DATATYPE_FILLMODE=SOLID
NAMESPACEUSE_TEXTCOLOR=128 128 128
EXIT_FILLCOLOR=255 255 220
CLASS_FILLMODE=SOLID
IMPORT_TEXTCOLOR=128 128 128
STARTEVENT_FILLMODE=SOLID
COLLABORATION_REPMODE=SIMPLE
SHALLOWHISTORY_REPMODE=SIMPLE
STATEDIAGRAMVIEW_LINECOLOR=128 128 128
SHALLOWHISTORY_FILLMODE=SOLID
TEMPLATEBINDING_LINECOLOR=128 128 128
NODE_FILLMODE=SOLID
INTERMEDIATTHROWEVENT_FILLCOLOR=255 255 220
FORK_FILLCOLOR=255 255 220
CALLEVENT_TEXTCOLOR=128 128 128
JUNCTION_TEXTCOLOR=128 128 128
FORK_REPMODE=SIMPLE
GOAL_TEXTCOLOR=128 128 128
INTERMEDIATTHROWEVENT_LINECOLOR=128 128 128
ENDEVENT_TEXTCOLOR=128 128 128
COMMUNICATIONDIAGRAMVIEW_TEXTCOLOR=128 128 128
TIMEEVENT_LINECOLOR=128 128 128
STATEDIAGRAMVIEW_REPRES_MODE=SIMPLE
CALLOPERATION_LINECOLOR=128 128 128
GOAL_CONTAINER_TEXTCOLOR=128 128 128
COMMUNICATIONCHANNEL_LINECOLOR=128 128 128
PACKAGE_FILLMODE=SOLID
NODE_FILLCOLOR=255 255 220
BUSINESSRULE_CONTAINER_TEXTCOLOR=128 128 128
INFOITEM_REPRES_MODE=SIMPLE
NODE_LINECOLOR=128 128 128
ASSOC_TEXTCOLOR=128 128 128
CLASS_LINECOLOR=128 128 128
STATE_TEXTCOLOR=128 128 128
FORKJOIN_TEXTCOLOR=128 128 128
PORT_TEXTCOLOR=128 128 128
FINALSTATE_TEXTCOLOR=128 128 128
BPMNDATAASSOCIATION_TEXTCOLOR=128 128 128
INSTANCELINK_FILLMODE=SOLID
stylename=ramc
SENDSIGNALACTION_TEXTCOLOR=128 128 128
JOIN_TEXTCOLOR=128 128 128
CHOICE_LINECOLOR=128 128 128
BPMNMESSAGE_LINECOLOR=128 128 128
CHANGEEVENT_REPMODE=SIMPLE
INPUTPIN_LINECOLOR=128 128 128
DATASTORE_FILLMODE=SOLID
EXCEPTIONHANDLER_TEXTCOLOR=128 128 128
GATE_TEXTCOLOR=128 128 128
CHANGEEVENT_FILLCOLOR=255 255 220
COLLABORATIONUSE_FILLMODE=SOLID
EXPANSIONNODE_REPMODE=SIMPLE
INITIALSTATE_FILLCOLOR=255 255 220
ACTIVITYFINAL_REPMODE=SIMPLE
INTERFACE_TEXTCOLOR=128 128 128
INSTANCE_FILLCOLOR=255 255 220
INTERFACEREALIZATION_TEXTCOLOR=128 128 128
STRUCTUREDACTIVITY_LINECOLOR=128 128 128
CLASS_REPRES_MODE=SIMPLE
basestyle=default
DECISIONMERGE_TEXTCOLOR=128 128 128
PACKAGE_FILLCOLOR=255 255 220
JOIN_REPMODE=SIMPLE
USECASE_FILLMODE=SOLID
PACKAGE_LINECOLOR=128 128 128
NODE_REPMODE=SIMPLE
BUSINESSRULE_FILLCOLOR=255 255 220
OBJECTFLOW_TEXTCOLOR=128 128 128
LIFELINE_LINECOLOR=128 128 128
BOUNDARYEVENT_TEXTCOLOR=128 128 128
DICTIONARY_LINECOLOR=128 128 128
BUSINESSRULE_LINECOLOR=128 128 128
BPMNLANE_LINECOLOR=128 128 128
COMMUNICATIONNODE_FILLMODE=SOLID
ENUM_REPRES_MODE=SIMPLE
OBJECTNODE_TEXTCOLOR=128 128 128
SENDSIGNALACTION_REPMODE=SIMPLE
INITIAL_FILLMODE=SOLID
CALLEVENT_FILLCOLOR=255 255 220
JUNCTION_FILLCOLOR=255 255 220
STARTEVENT_TEXTCOLOR=128 128 128
BOUNDARYEVENT_FILLMODE=SOLID
GOAL_FILLCOLOR=255 255 220
ENDEVENT_FILLCOLOR=255 255 220
PACKAGE_REPMODE=SIMPLE
DICTIONARY_REPMODE=SIMPLE
COMMUNICATIONDIAGRAMVIEW_FILLCOLOR=255 255 220
REQUIREDINTERFACE_REPRES_MODE=SIMPLE
SUBPROCESS_TEXTCOLOR=128 128 128
GOAL_FILLMODE=SOLID
GOAL_CONTAINER_FILLCOLOR=255 255 220
EXPANSIONREGION_LINECOLOR=128 128 128
GENZ_LINECOLOR=128 128 128
ENDEVENT_LINECOLOR=128 128 128
STATICDIAGRAMVIEW_REPRES_MODE=SIMPLE
COMMUNICATIONDIAGRAMVIEW_LINECOLOR=128 128 128
FORK_TEXTCOLOR=128 128 128
ABSTRACT_DIAGRAM_FILLCOLOR=255 255 220
BUSINESSRULE_CONTAINER_FILLCOLOR=255 255 220
GOAL_CONTAINER_FILLMODE=SOLID
TERMINAL_LINECOLOR=128 128 128
FLOWFINAL_FILLMODE=SOLID
GOAL_CONTAINER_REPMODE=SIMPLE
EXECUTIONOCCURENCESPECIFICATION_FILLMODE=SOLID
ASSOC_FILLCOLOR=255 255 220
ARTIFACT_TEXTCOLOR=128 128 128
STATE_FILLCOLOR=255 255 220
FORKJOIN_FILLCOLOR=255 255 220
FINALSTATE_FILLCOLOR=255 255 220
FLOWFINAL_REPMODE=SIMPLE
GATE_FILLMODE=SOLID
INFOITEM_TEXTCOLOR=128 128 128
CALLOPERATION_REPMODE=SIMPLE
SENDSIGNALACTION_FILLCOLOR=255 255 220
INITIAL_REPMODE=SIMPLE
STATE_LINECOLOR=128 128 128
PORT_LINECOLOR=128 128 128
STATICDIAGRAMVIEW_LINECOLOR=128 128 128
BPMNDATAASSOCIATION_LINECOLOR=128 128 128
SUBPROCESS_REPMODE=SIMPLE
GATE_FILLCOLOR=255 255 220
SHALLOWHISTORY_TEXTCOLOR=128 128 128
JOIN_LINECOLOR=128 128 128
MANIFESTATION_LINECOLOR=128 128 128
INTERFACE_FILLCOLOR=255 255 220
PARTITION_TEXTCOLOR=128 128 128
CONSTRAINT_FILLMODE=SOLID
INTERFACEREALIZATION_FILLCOLOR=255 255 220
EXECUTIONOCCURENCESPECIFICATION_FILLCOLOR=255 255 220
ENUM_LINECOLOR=128 128 128
CONSTRAINT_TEXTCOLOR=128 128 128
INTERACTIONOPERAND_TEXTCOLOR=128 128 128
INTERFACE_LINECOLOR=128 128 128
DATASTORE_LINECOLOR=128 128 128
LOOPNODE_TEXTCOLOR=128 128 128
DECISIONMERGE_FILLCOLOR=255 255 220
CONDITIONAL_TEXTCOLOR=128 128 128
DATA_TEXTCOLOR=128 128 128
STATE_FILLMODE=SOLID
TASK_REPMODE=SIMPLE
INTERFACE_FILLMODE=SOLID
CALLBEHAVIOR_TEXTCOLOR=128 128 128
INTERMEDIATECATCHEVENT_FILLMODE=SOLID
OUTPUTPIN_TEXTCOLOR=128 128 128
BOUNDARYEVENT_FILLCOLOR=255 255 220
ACTION_LINECOLOR=128 128 128
COLLABORATIONUSE_FILLCOLOR=255 255 220
REQUIREDINTERFACE_TEXTCOLOR=128 128 128
VALUEPIN_REPMODE=SIMPLE
CONTROLFLOW_TEXTCOLOR=128 128 128
SEQUENCEDIAGRAMVIEW_TEXTCOLOR=128 128 128
COMBINEDFRAGMENT_FILLMODE=SOLID
STATEINVARIANT_FILLMODE=SOLID
OBJECTNODE_FILLCOLOR=255 255 220
GATEWAY_TEXTCOLOR=128 128 128
INITIALSTATE_FILLMODE=SOLID
STARTEVENT_FILLCOLOR=255 255 220
ACTOR_LINECOLOR=128 128 128
COLLABORATIONUSELINK_TEXTCOLOR=128 128 128
SUBPROCESS_FILLCOLOR=255 255 220
VALUEPIN_LINECOLOR=128 128 128
TIMEEVENT_REPMODE=SIMPLE
EXECUTIONSPECIFICATION_FILLMODE=SOLID
CONNECTOR_FILLCOLOR=255 255 220
EXIT_LINECOLOR=128 128 128
STARTEVENT_REPMODE=SIMPLE
COMPONENT_TEXTCOLOR=128 128 128
USECASE_TEXTCOLOR=128 128 128
CALLBEHAVIOR_REPMODE=SIMPLE
SIGNAL_TEXTCOLOR=128 128 128
COMBINEDFRAGMENT_TEXTCOLOR=128 128 128
FORK_LINECOLOR=128 128 128
REQUIREMENT_TEXTCOLOR=128 128 128
DICTIONARY_FILLMODE=SOLID
ARTIFACT_FILLCOLOR=255 255 220
TERM_TEXTCOLOR=128 128 128
ENDEVENT_REPMODE=SIMPLE
CALLBEHAVIOR_FILLMODE=SOLID
PACKAGEMERGE_LINECOLOR=128 128 128
INFOITEM_FILLCOLOR=255 255 220
| 15,445 | Common Lisp | .l | 491 | 30.456212 | 53 | 0.889194 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | cfefc9dea9d2cc07e7af737e6cef4816d8d3ffebd8668238b3c033c851f55cd4 | 27,666 | [
-1
] |
27,667 | default.style | GazeboHub_lupine-m2/module/data-proxy/doc/Models_Modelio/Lupine CORBA/data/.config/styles/default.style | #
#Thu Oct 03 15:42:22 PDT 2013
ASSOC_SHOWSTEREOTYPES=TEXTICON
CLASS_ATT_SHOWTAGS=true
CLASS_ATT_SHOWVISIBILITY=false
CLASS_FEATURES=ALL
CLASS_ATT_GROUPVISIBLE=true
CLASS_SHOWSTEREOTYPES=TEXTICON
CLASS_INNER_SHOWSTEREOTYPES=TEXTICON
CLASS_SHOWTAGS=true
NASSOC_SHOWTAGS=true
ASSOC_SHOWVISIBILITY=false
CLASS_ATT_SHOWSTEREOTYPES=TEXTICON
NASSOC_SHOWSTEREOTYPES=TEXTICON
stylename=default
CLASS_INNER_SHOWVISIBILITY=false
CLASS_INTERNAL_AUTOUNMASK=true
| 450 | Common Lisp | .l | 17 | 25.470588 | 36 | 0.896074 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 877afa94f1387ef149694664c18bb9724ffa8aa76cd342152ea5f4042eb96582 | 27,667 | [
-1
] |
27,668 | metadatas.xml | GazeboHub_lupine-m2/module/data-proxy/doc/Models_Modelio/Lupine CORBA/data/fragments/PredefinedTypes 3.0.01/content/metadatas.xml | <?xml version="1.0" encoding="UTF-8"?>
<ram-component manifest-version="2.0"
name="PredefinedTypes" version="3" release="0" clevel="1">
<description>
<![CDATA[Predefined types model component provides the default types for UML and Analyst models.
3.0.01 - New analyst property types.
3.0.00 - Init.]]>
</description>
<dependencies>
</dependencies>
<contributors>
</contributors>
<roots>
<root metaclass="AnalystProject" name="Analyst Properties" uuid="6a211b4e-e582-4aac-ad12-99aad8194a23"></root>
<root metaclass="Project" name="UML Types" uuid="584f9182-61bd-4a41-a7a0-ae2972311ae1"></root>
</roots>
</ram-component> | 687 | Common Lisp | .l | 17 | 35.470588 | 116 | 0.68806 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | adc6f8362ea79115301ac15769088d062fc5373b46c29bc20a0552b9e1689457 | 27,668 | [
-1
] |
27,669 | 0adbe87d-00b8-435d-8a64-0dc760b4f685.exml | GazeboHub_lupine-m2/module/data-proxy/doc/Models_Modelio/Lupine CORBA/data/fragments/PredefinedTypes 3.0.01/content/model/model/PropertyContainer/0adbe87d-00b8-435d-8a64-0dc760b4f685.exml | <?xml version="1.0" ?>
<!--GENERATED FILE, PLEASE DO NOT EDIT!!!--><EXT object="Analyst Properties" version="3">
<DEPS>
<ID name="Analyst Properties" mc="PropertyContainer" uid="0adbe87d-00b8-435d-8a64-0dc760b4f685"/>
<COMPID name="Acceptance" mc="EnumeratedPropertyType" uid="01ec152c-0000-3152-0000-000000000000"/>
<COMPID name="Benefit" mc="EnumeratedPropertyType" uid="00080cf0-0000-00bc-0000-000000000000"/>
<COMPID name="Boolean" mc="PropertyType" uid="01a40888-0000-002b-0000-000000000000"/>
<COMPID name="BusinessRule Properties" mc="PropertyTableDefinition" uid="00bc470c-0000-0019-0000-000000000000"/>
<COMPID name="Date" mc="PropertyType" uid="136b356c-3951-473b-aa4a-001c0241b996"/>
<COMPID name="Design" mc="PropertyTableDefinition" uid="00080cf0-0000-001f-0000-000000000000"/>
<COMPID name="Dictionary Properties" mc="PropertyTableDefinition" uid="01ec152c-0000-144f-0000-000000000000"/>
<COMPID name="Element" mc="PropertyType" uid="b58969db-144e-4a1f-b946-cd6deacca9bd"/>
<COMPID name="Float" mc="PropertyType" uid="bc36b99e-8470-4aee-ba2a-5012c0a17525"/>
<COMPID name="Functionality" mc="PropertyTableDefinition" uid="00080cf0-0000-001a-0000-000000000000"/>
<COMPID name="Goal Properties" mc="PropertyTableDefinition" uid="00bc470c-0000-0018-0000-000000000000"/>
<COMPID name="Implementation" mc="PropertyTableDefinition" uid="00080cf0-0000-0020-0000-000000000000"/>
<COMPID name="Integer" mc="PropertyType" uid="01a40888-0000-002d-0000-000000000000"/>
<COMPID name="Kind" mc="EnumeratedPropertyType" uid="00bc470c-0000-002a-0000-000000000000"/>
<COMPID name="MultiText" mc="PropertyType" uid="00080cf0-0000-00cf-0000-000000000000"/>
<COMPID name="Performance" mc="PropertyTableDefinition" uid="00080cf0-0000-001d-0000-000000000000"/>
<COMPID name="Reliability" mc="PropertyTableDefinition" uid="00080cf0-0000-001c-0000-000000000000"/>
<COMPID name="RichText" mc="PropertyType" uid="c37f01cf-273e-11e1-b78e-00137282c51b"/>
<COMPID name="Risk" mc="EnumeratedPropertyType" uid="00080cf0-0000-0031-0000-000000000000"/>
<COMPID name="Satisfaction" mc="EnumeratedPropertyType" uid="00bc470c-0000-0035-0000-000000000000"/>
<COMPID name="Scope" mc="EnumeratedPropertyType" uid="00bc470c-0000-001b-0000-000000000000"/>
<COMPID name="Stability" mc="EnumeratedPropertyType" uid="00080cf0-0000-0032-0000-000000000000"/>
<COMPID name="Supportability" mc="PropertyTableDefinition" uid="00080cf0-0000-001e-0000-000000000000"/>
<COMPID name="Text" mc="PropertyType" uid="01a40888-0000-002a-0000-000000000000"/>
<COMPID name="Time" mc="PropertyType" uid="753fc9f9-c136-449c-949c-4fa467511d99"/>
<COMPID name="Unsigned" mc="PropertyType" uid="827950f7-671f-4db7-9374-23df864712ef"/>
<COMPID name="Usability" mc="PropertyTableDefinition" uid="00080cf0-0000-001b-0000-000000000000"/>
<FOREIGNID name="ModelComponentElementAlias" mc="Stereotype" uid="3254be34-c7d8-4018-8a68-5de65c30b773"/>
<FOREIGNID name="uuid" mc="TagType" uid="7ebbd53f-a5f3-433b-872c-4024615af229"/>
</DEPS>
<OBJECT>
<ID name="Analyst Properties" mc="PropertyContainer" uid="0adbe87d-00b8-435d-8a64-0dc760b4f685"/>
<PID name="Analyst Properties" mc="AnalystProject" uid="6a211b4e-e582-4aac-ad12-99aad8194a23"/>
<ATTRIBUTES>
<ATT name="Name"><![CDATA[Analyst Properties]]></ATT>
<ATT name="status">1970354901745664</ATT>
</ATTRIBUTES>
<DEPENDENCIES>
<COMP relation="DefinedTable">
<COMPID name="Implementation" mc="PropertyTableDefinition" uid="00080cf0-0000-0020-0000-000000000000"/>
<COMPID name="Goal Properties" mc="PropertyTableDefinition" uid="00bc470c-0000-0018-0000-000000000000"/>
<COMPID name="BusinessRule Properties" mc="PropertyTableDefinition" uid="00bc470c-0000-0019-0000-000000000000"/>
<COMPID name="Design" mc="PropertyTableDefinition" uid="00080cf0-0000-001f-0000-000000000000"/>
<COMPID name="Supportability" mc="PropertyTableDefinition" uid="00080cf0-0000-001e-0000-000000000000"/>
<COMPID name="Performance" mc="PropertyTableDefinition" uid="00080cf0-0000-001d-0000-000000000000"/>
<COMPID name="Reliability" mc="PropertyTableDefinition" uid="00080cf0-0000-001c-0000-000000000000"/>
<COMPID name="Usability" mc="PropertyTableDefinition" uid="00080cf0-0000-001b-0000-000000000000"/>
<COMPID name="Functionality" mc="PropertyTableDefinition" uid="00080cf0-0000-001a-0000-000000000000"/>
<COMPID name="Dictionary Properties" mc="PropertyTableDefinition" uid="01ec152c-0000-144f-0000-000000000000"/>
</COMP>
<COMP relation="DefinedType">
<COMPID name="Scope" mc="EnumeratedPropertyType" uid="00bc470c-0000-001b-0000-000000000000"/>
<COMPID name="Benefit" mc="EnumeratedPropertyType" uid="00080cf0-0000-00bc-0000-000000000000"/>
<COMPID name="Risk" mc="EnumeratedPropertyType" uid="00080cf0-0000-0031-0000-000000000000"/>
<COMPID name="Stability" mc="EnumeratedPropertyType" uid="00080cf0-0000-0032-0000-000000000000"/>
<COMPID name="Satisfaction" mc="EnumeratedPropertyType" uid="00bc470c-0000-0035-0000-000000000000"/>
<COMPID name="Boolean" mc="PropertyType" uid="01a40888-0000-002b-0000-000000000000"/>
<COMPID name="Date" mc="PropertyType" uid="136b356c-3951-473b-aa4a-001c0241b996"/>
<COMPID name="Element" mc="PropertyType" uid="b58969db-144e-4a1f-b946-cd6deacca9bd"/>
<COMPID name="Float" mc="PropertyType" uid="bc36b99e-8470-4aee-ba2a-5012c0a17525"/>
<COMPID name="Integer" mc="PropertyType" uid="01a40888-0000-002d-0000-000000000000"/>
<COMPID name="MultiText" mc="PropertyType" uid="00080cf0-0000-00cf-0000-000000000000"/>
<COMPID name="RichText" mc="PropertyType" uid="c37f01cf-273e-11e1-b78e-00137282c51b"/>
<COMPID name="Text" mc="PropertyType" uid="01a40888-0000-002a-0000-000000000000"/>
<COMPID name="Time" mc="PropertyType" uid="753fc9f9-c136-449c-949c-4fa467511d99"/>
<COMPID name="Unsigned" mc="PropertyType" uid="827950f7-671f-4db7-9374-23df864712ef"/>
<COMPID name="Acceptance" mc="EnumeratedPropertyType" uid="01ec152c-0000-3152-0000-000000000000"/>
<COMPID name="Kind" mc="EnumeratedPropertyType" uid="00bc470c-0000-002a-0000-000000000000"/>
</COMP>
<LINK relation="Extension">
<FOREIGNID name="ModelComponentElementAlias" mc="Stereotype" uid="3254be34-c7d8-4018-8a68-5de65c30b773"/>
</LINK>
<COMP relation="Tag">
<OBJECT>
<ID name="" mc="TaggedValue" uid="033d8202-2a28-4ae4-93e0-a227abb5dc71"/>
<PID name="Analyst Properties" mc="PropertyContainer" uid="0adbe87d-00b8-435d-8a64-0dc760b4f685"/>
<ATTRIBUTES>
<ATT name="Name"></ATT>
<ATT name="status">1970354901745664</ATT>
</ATTRIBUTES>
<DEPENDENCIES>
<COMP relation="Actual">
<OBJECT>
<ID name="" mc="TagParameter" uid="04905127-f1dd-42b6-a3a5-e4787de43ec7"/>
<PID name="Analyst Properties" mc="PropertyContainer" uid="0adbe87d-00b8-435d-8a64-0dc760b4f685"/>
<ATTRIBUTES>
<ATT name="Value"><![CDATA[a47918cf-d74f-421a-b4c5-d0a1f77c288e]]></ATT>
<ATT name="status">1970354901745664</ATT>
</ATTRIBUTES>
<DEPENDENCIES></DEPENDENCIES>
</OBJECT>
</COMP>
<LINK relation="Definition">
<FOREIGNID name="uuid" mc="TagType" uid="7ebbd53f-a5f3-433b-872c-4024615af229"/>
</LINK>
</DEPENDENCIES>
</OBJECT>
</COMP>
</DEPENDENCIES>
</OBJECT>
</EXT> | 7,737 | Common Lisp | .l | 105 | 65.628571 | 120 | 0.711123 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 8e06ca76fbcd82a99d6b9075cb8521d35e797f62b99999dd9098576daac724e0 | 27,669 | [
-1
] |
27,670 | 00000004-0000-0004-0000-000000000000.exml | GazeboHub_lupine-m2/module/data-proxy/doc/Models_Modelio/Lupine CORBA/data/fragments/PredefinedTypes 3.0.01/content/model/model/Package/00000004-0000-0004-0000-000000000000.exml | <?xml version="1.0" ?>
<!--GENERATED FILE, PLEASE DO NOT EDIT!!!--><EXT object="UML Types" version="3">
<DEPS>
<ID name="UML Types" mc="Package" uid="00000004-0000-0004-0000-000000000000"/>
<COMPID name="PredefinedTypes" mc="Artifact" uid="4bb461ab-1cb8-4e47-ab98-5ab266bd55cb"/>
<COMPID name="boolean" mc="DataType" uid="00000004-0000-0005-0000-000000000000"/>
<COMPID name="byte" mc="DataType" uid="00000004-0000-0013-0000-000000000000"/>
<COMPID name="char" mc="DataType" uid="00000004-0000-0007-0000-000000000000"/>
<COMPID name="date" mc="DataType" uid="00000004-0000-0014-0000-000000000000"/>
<COMPID name="double" mc="DataType" uid="00000004-0000-0010-0000-000000000000"/>
<COMPID name="float" mc="DataType" uid="00000004-0000-000b-0000-000000000000"/>
<COMPID name="integer" mc="DataType" uid="00000004-0000-0009-0000-000000000000"/>
<COMPID name="long" mc="DataType" uid="00000004-0000-0011-0000-000000000000"/>
<COMPID name="short" mc="DataType" uid="00000004-0000-0012-0000-000000000000"/>
<COMPID name="string" mc="DataType" uid="00000004-0000-000d-0000-000000000000"/>
<COMPID name="undefined" mc="DataType" uid="00000004-0000-000f-0000-000000000000"/>
</DEPS>
<OBJECT>
<ID name="UML Types" mc="Package" uid="00000004-0000-0004-0000-000000000000"/>
<PID name="UML Types" mc="Project" uid="584f9182-61bd-4a41-a7a0-ae2972311ae1"/>
<ATTRIBUTES>
<ATT name="IsInstantiable">false</ATT>
<ATT name="IsAbstract">false</ATT>
<ATT name="IsLeaf">false</ATT>
<ATT name="IsRoot">false</ATT>
<ATT name="Visibility">Public</ATT>
<ATT name="Name"><![CDATA[UML Types]]></ATT>
<ATT name="status">1970354901745664</ATT>
</ATTRIBUTES>
<DEPENDENCIES>
<COMP relation="OwnedElement">
<COMPID name="boolean" mc="DataType" uid="00000004-0000-0005-0000-000000000000"/>
<COMPID name="char" mc="DataType" uid="00000004-0000-0007-0000-000000000000"/>
<COMPID name="integer" mc="DataType" uid="00000004-0000-0009-0000-000000000000"/>
<COMPID name="float" mc="DataType" uid="00000004-0000-000b-0000-000000000000"/>
<COMPID name="string" mc="DataType" uid="00000004-0000-000d-0000-000000000000"/>
<COMPID name="undefined" mc="DataType" uid="00000004-0000-000f-0000-000000000000"/>
<COMPID name="double" mc="DataType" uid="00000004-0000-0010-0000-000000000000"/>
<COMPID name="long" mc="DataType" uid="00000004-0000-0011-0000-000000000000"/>
<COMPID name="short" mc="DataType" uid="00000004-0000-0012-0000-000000000000"/>
<COMPID name="byte" mc="DataType" uid="00000004-0000-0013-0000-000000000000"/>
<COMPID name="date" mc="DataType" uid="00000004-0000-0014-0000-000000000000"/>
<COMPID name="PredefinedTypes" mc="Artifact" uid="4bb461ab-1cb8-4e47-ab98-5ab266bd55cb"/>
</COMP>
</DEPENDENCIES>
</OBJECT>
</EXT> | 2,924 | Common Lisp | .l | 47 | 56.255319 | 97 | 0.690757 | GazeboHub/lupine-m2 | 0 | 0 | 0 | EPL-1.0 | 9/19/2024, 11:35:48 AM (Europe/Amsterdam) | 045a81f77503c403bcd54fa1501ffca3ea1716f528d8a753a81ac005372b43fd | 27,670 | [
-1
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.