MyGit

eduardoejp/heimdallr

Fork: 2 Star: 4 (更新于 2024-10-16 20:45:29)

license: 暂无

Language: Clojure .

Small lib for Context-Oriented Programming.

GitHub网址

Heimdallr

heimdallr is a library for Context-Oriented Programming in Clojure.

Usage

Simply add this to your leiningen deps: [heimdallr "0.2.0"]

Documentation

The documentation can be found here: http://eduardoejp.github.com/heimdallr/

Examples

(use 'heimdallr)
(def employer {:name "Q-Box Technologies"})
(def person {:name "Eduardo Julián", :employer employer, :address "c/ Manuel Rodriguez Objío, Santo Domingo"})

(deflayer employer-layer)
(deflayer address-layer)

(deflayered to-str [person] (str "Name: " (:name person) "\n"))
(deflayered to-str employer-layer [person] (str (proceed person) "Employer: " (:name (:employer person)) "\n"))
(deflayered to-str address-layer [person] (str (proceed person) "Address: " (:address person) "\n"))

(println (to-str person))

(with-layer address-layer
  (with-layer employer-layer
    (println (to-str person))))

; The above code is the same as the following.

(with-layer [address-layer employer-layer]
  (println (to-str person)))

Further Information

For more information about Context-Oriented Programming, please visit the following websites:

  1. http://www.jot.fm/issues/issue_2008_03/article4/

  2. http://www.swa.hpi.uni-potsdam.de/cop/

最近版本更新:(数据更新于 1970-01-01 00:00:00)

eduardoejp/heimdallr同语言 Clojure最近更新仓库

2024-11-04 23:45:19 penpot/penpot

2024-11-04 22:29:17 logseq/logseq

2024-10-03 02:18:04 metabase/metabase

2023-02-20 20:09:25 adamtornhill/code-maat

2021-12-07 04:58:58 tonsky/FiraCode

2018-04-17 22:19:15 emanjavacas/cosycat