Talk:Story telling

From LiteratePrograms
Jump to: navigation, search

[edit] The Code

Very good but where's the code ? -- Derek Ross | Talk 20:20, 13 October 2006 (PDT)

It will come, just be patient. I want to rewrite it before putting it here. Lehalle
Excellent ! -- Derek Ross | Talk 16:20, 27 October 2006 (PDT)

[edit] Questions

Also there seems to be a lot of category confusion in the mathematics. In particular it's still very unclear to me whether E is supposed to be a set, or a natural number. In some places it's used as the former in other places as the latter. -- Derek Ross | Talk 20:35, 13 October 2006 (PDT)

E is into the set of of subsets of \mathcal{E}, so it's a subset of \mathcal{E}, where do you think it's used as a natural number? Lehalle
You show E being used as an indexing subscript of τ, which is fair enough. But then further on you show τ with subscripts 1, 2, 3, etc. This implies (to me at any rate) that τ can be indexed by natural numbers and thus that E can be a natural number. Of course this conflicts with the explicit definition of E as a member of the powerset of \mathcal{E} which cannot include natural numbers. Hence my confusion. Can you clarify things ? I'd appreciate it as this looks interesting. -- Derek Ross | Talk 16:20, 27 October 2006 (PDT)

[edit] Scheme pieces of code

Here are some hints about a scheme implementation:

<<story_elements.sc>>=
;; typical element
(define an-element '((properties ((name "Alpha") (type "character") (age 28)))
                     (relations ((knows 
                (lambda (e) (if (prop-equal? e (quote name) "Beta") 3 0)))))))
(define element-2 '((properties ((name "Beta")))))
;; some simple functions
(define (prop-e e key) (cadr (assq key (cadr (assq 'properties e)))))
(define (prop-equal? e key value) (equal? (prop-e e key) value))
(define (prop-rf e key) (cadr (assq key (cadr (assq 'relations e)))))
(define (prop-rel e1 key e2) ((local-eval (prop-rf e1 key) (the-environment)) e2))
;; simple use
; get a property value
(prop-e an-element 'name)
(prop-equal? an-element 'name "Beta")
; get a property relation
(prop-rf an-element 'knows)
(prop-rel an-element 'knows element-2)
hijacker
hijacker
hijacker
hijacker