[cells-devel] kickstart

momerath michael at guildsoftware.com
Wed Mar 15 23:40:25 UTC 2006


*Thanks for getting back to me.  I was beginning to wonder which of the 5
ways to interpret the silence :) I think it must be in the genes: (
http://en.wikipedia.org/wiki/Warnock's_Dilemma)

Anyway, here is what I've got:

(defmodel cargo-hold ()
  (ship-owner capacity
   ;; a set of cargo-types
   (types :cell t :initarg :types
          :initform nil)
   ;; cargo-type -> quantity
   (quantities :cell t :initarg :quantities
               :initform (make-hash-table))))

(defmodel cargo ()
  ;; a type-id, name and the number of
  ;; cargo-hold units it takes up (1-3)
  (type name volume
   ;; the character-id of the owner of
   ;; the cargo-hold unless cargo is spaced
   (holder :cell t :initarg :holder
           :initform (c-in nil) :accessor holder)

   (auth-list :cell t :initarg :auth-list
              :initform nil :accessor auth-list)
   (recipient :cell t :initarg :recipient
              :initform nil :accessor recipient)
   (stolen :cell t :initarg :stolen
           :initform (c? (when (member (^holder)
                                       (^auth-list))
                           t))
           :accessor stolen)
   (spaced :cell t :initarg :spaced
           :initform (c? (when holder
t))

           :accessor spaced)
   (delivered :cell t :initarg :delivered
              :initform (c? (when (eql (^holder)
                                       (^recipient))
                              t))
              :accessor delivered)))


The first thing you'll probably notice is that there is no mechanism for the
cargo-holds to actually "contain" cargo objects.  I know I could do as the
"summer" example of the cell-basics doc does, and push them onto a list, and
recalculate based on the whole list every time it changes, but I was hoping
for something more elegant and efficient.  Only one entry in the quantities
hash needs to change when an item is added for instance.  I thought of
having in and out slots (set the slot to a cargo object to add or remove;
the other slots do their thing and then clear the in/out slot), but that
seems ugly and I wasn't even sure how to pull it off.

And then there is the whole thing with cargo-sets which is closer to what
I'd like to do with Cells on the larger scale.  Basically what I want is to
have a large number of sets and their unions/intersections efficiently
accessible anywhere in my code- stuff like "all characters of faction X in
sector Y carrying at least one Z in their cargo hold.

I hope this makes my level of understanding more clear.  I think I'm
probably more prepared for the paradigm shift than most, owing, no doubt, to
my long infatuation with Ted Nelson's ZigZag.

~Michael Warnock
Guild Software Inc.
*I've
Ive
Iver
Ivie
IV
Edit...
Revert to "i've"
def model
def-model
defamed
daffodil
deformed
Edit...
Ignore all
Add to dictionary
unitary
intake
interj
Anitra
Unitas
Edit...
Ignore all
Add to dictionary
uniform
inform
infirm
uniformer
interim
Edit...
Ignore all
Add to dictionary
unitary
intake
interj
Anitra
Unitas
Edit...
Ignore all
Add to dictionary
uniform
inform
infirm
uniformer
interim
Edit...
Ignore all
Add to dictionary
def model
def-model
defamed
daffodil
deformed
Edit...
Ignore all
Add to dictionary
unitary
intake
interj
Anitra
Unitas
Edit...
Ignore all
Add to dictionary
uniform
inform
infirm
uniformer
interim
Edit...
Ignore all
Add to dictionary
accessory
access or
access-or
access
access's
Edit...
Ignore all
Add to dictionary
ACTH
Ruth
auto
Edit...
Ignore all
Add to dictionary
unitary
intake
interj
Anitra
Unitas
Edit...
Ignore all
Add to dictionary
ACTH
Ruth
auto
Edit...
Ignore all
Add to dictionary
uniform
inform
infirm
uniformer
interim
Edit...
Ignore all
Add to dictionary
assessor
access or
access-or
accessory
access
Edit...
Ignore all
Add to dictionary
ACTH
Ruth
auto
Edit...
Ignore all
Add to dictionary
unitary
intake
interj
Anitra
Unitas
Edit...
Ignore all
Add to dictionary
uniform
inform
infirm
uniformer
interim
Edit...
Ignore all
Add to dictionary
assessor
access or
access-or
accessory
access
Edit...
Ignore all
Add to dictionary
unitary
intake
interj
Anitra
Unitas
Edit...
Ignore all
Add to dictionary
uniform
inform
infirm
uniformer
interim
Edit...
Ignore all
Add to dictionary
ACTH
Ruth
auto
Edit...
Ignore all
Add to dictionary
assessor
access or
access-or
accessory
access
Edit...
Ignore all
Add to dictionary
unitary
intake
interj
Anitra
Unitas
Edit...
Ignore all
Add to dictionary
uniform
inform
infirm
uniformer
interim
Edit...
Ignore all
Add to dictionary
assessor
access or
access-or
accessory
access
Edit...
Ignore all
Add to dictionary
unitary
intake
interj
Anitra
Unitas
Edit...
Ignore all
Add to dictionary
uniform
inform
infirm
uniformer
interim
Edit...
Ignore all
Add to dictionary
El
Eal
Erl
eel
ell
Edit...
Ignore all
Add to dictionary
assessor
access or
access-or
accessory
access
Edit...
Ignore all
Add to dictionary
Zigzag
Zigzags
Zigzag's
Edit...
Ignore all
Add to dictionary
Warlock
Wank
Warwick
Wonk
Bannock
Edit...
Ignore all
Add to dictionary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cells-devel/attachments/20060315/3fd44a3b/attachment.html>


More information about the cells-devel mailing list