Skip to content

Commit

Permalink
Add some more examples, fix the emacs mode again and so on
Browse files Browse the repository at this point in the history
  • Loading branch information
olabini committed Jun 28, 2010
1 parent 10e51f8 commit 5e11e59
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
17 changes: 17 additions & 0 deletions examples/accumulator.sp
@@ -0,0 +1,17 @@

;; mutating version

foo: #(n, #(i, n += i)),

;; actor version

foop = #(n,
receive(
(p, i), val = n + i. p <- val. foop(val))),

foo: #(n,
p = ->(foop(n))
#(i,
p <- (currentProcess, i)
receive(
v, v)))
20 changes: 20 additions & 0 deletions examples/intro.sp
@@ -0,0 +1,20 @@

Seph: LanguageExperiment with(
goal: (:expressiveness, :concurrency),
features: [ :dynamic, :homoiconic,
:functional, :proper_tail_calls,
:prototype_based, :object_orientation,
:light_weight_threads, :parameterized_modules],
inspirations: set(Ioke, Clojure, Erlang, Newspeak)
),

the_greeting = "Avant, "
Greeter = Something with(
greet: #("#{the_greeting} #{subject}" println)
)

Seph inspirations select(
features include?(:object_oriented)
) each(inspiration,
Greeter with(subject: inspiration) greet
)
2 changes: 1 addition & 1 deletion examples/toc_set.sp
Expand Up @@ -10,7 +10,7 @@ Adjoin: IntSet with(

Union: IntSet with(
empty?: #(left empty? && right empty?),
contains?: #(y, obj == y || s contains?(y))
contains?: #(y, left contains?(y) || right contains?(y))
),

Empty: IntSet with(
Expand Down
10 changes: 7 additions & 3 deletions share/emacs/seph-mode.el
Expand Up @@ -237,6 +237,10 @@
;; "list"
;; "dict"
;; "set"
"set"
"list"
"dict"
"vector"

;; "with"
;; "kind"
Expand Down Expand Up @@ -425,9 +429,9 @@
(list
'("\\([[:alnum:]!?_:-]+\\)[[:space:]]*=[^=][[:space:]]*[[:alnum:]_:-]+[[:space:]]+mimic" 1 seph-font-lock-object-mimic-face)
'("\\([[:alnum:]!?_:-]+\\)[[:space:]]*[+*/-]?=[^=]" 1 seph-font-lock-object-assign-face)
'("#/.*?/[oxpniums]*" 0 seph-font-lock-regexp-face)
'("#r\\[.*?\\][oxpniums]*" 0 seph-font-lock-regexp-face)
'("#\\[" 0 seph-font-lock-string-face t)
'("%/.*?/[oxpniums]*" 0 seph-font-lock-regexp-face)
'("%r\\[.*?\\][oxpniums]*" 0 seph-font-lock-regexp-face)
'("%\\[" 0 seph-font-lock-string-face t)
'("\\([^\\\\]\\|\\\\\\\\\\)\\(#{[^}]*}\\)" 2 seph-font-lock-expression-face t)
`(,(regexp-opt seph-prototype-names 'words) . seph-font-lock-known-kind-face)
`(,(regexp-opt seph-standout-names 'words) . font-lock-warning-face)
Expand Down

0 comments on commit 5e11e59

Please sign in to comment.