Skip to content

Commit

Permalink
remove :as support from use expressions
Browse files Browse the repository at this point in the history
The `:as` keyword in use statements really just confuses the meaning of
`use` and `require` make some interactions surprising. By removing this
`use` always behaves exactly as expected.
  • Loading branch information
ericbmerritt committed Jul 2, 2012
1 parent 1e81e9f commit 636d810
Show file tree
Hide file tree
Showing 8 changed files with 14,358 additions and 14,366 deletions.
6 changes: 1 addition & 5 deletions doc/language.rst
Expand Up @@ -335,8 +335,7 @@ we might want to do.
(use (string :exclude (substr/4 join/2)
:joxify
:rename ((sub-word/3 str-subword) (join/2 str-join)
:as str)))
:rename ((sub-word/3 str-subword) (join/2 str-join))))
Lets break this down into actions.

Expand All @@ -360,9 +359,6 @@ Lets break this down into actions.
imports being carried forward. *NOTE* note the joxification of
`sub-word/3`. Since we specified `joxify` earlier we must must
refer to it as `sub-word/3` instead of `sub_word/3`.
5) As. This has the exact as in `require` in that it provides an alias
for the namespace name specified. This allows you to refer to any
function in that namespace with the alias.

Functions
---------
Expand Down
3 changes: 1 addition & 2 deletions examples/complex_module.jxa
Expand Up @@ -3,8 +3,7 @@
(attr sfoo 123)
(use (lists :only (member/2 append/2)
:rename ((member/2 mbr))))
(use (file :as f
:exclude (delete/1)
(use (file :exclude (delete/1)
:rename ((change_group/2 chgrp)
(change_mode/2 chmod))))
(attr super_duper "Hello World")
Expand Down
3 changes: 1 addition & 2 deletions examples/sieve-of-eratosthenes.jxa
@@ -1,6 +1,6 @@
(ns sieve-of-eratosthenes
(require lists io)
(use (joxa.core :as core :only (!=/2))
(use (joxa.core :only (!=/2))
(erlang :only (rem/2 +/2))))

(defn sieve (v primes)
Expand All @@ -13,4 +13,3 @@

(defn+ sieve (v)
(sieve (lists/seq 2 v) 1))

0 comments on commit 636d810

Please sign in to comment.