Permalink
Browse files

Remove extra parens in obj syntax.

  • Loading branch information...
1 parent abcd085 commit 411d1bd0ca1647126160b7c284241c95d5e208c1 @kr committed Mar 17, 2009
Showing with 45 additions and 45 deletions.
  1. +1 −1 ad-hoc-tests/closure.na
  2. +1 −1 ad-hoc-tests/promise.lx
  3. +4 −4 ad-hoc-tests/sample.lx
  4. +2 −2 bytes.na
  5. +4 −4 file-io.na
  6. +2 −2 fin.na
  7. +1 −1 lib/pm.lx
  8. +2 −2 lx.py
  9. +4 −4 module.na
  10. +16 −16 prelude.na
  11. +3 −3 re.na
  12. +2 −2 sh-tests/assoc.na
  13. +1 −1 sh-tests/ind.na
  14. +1 −1 sh-tests/insp.na
  15. +1 −1 sh-tests/methods.na
View
2 ad-hoc-tests/closure.na
@@ -1 +1 @@
-pr (obj ())
+pr (obj)
View
2 ad-hoc-tests/promise.lx
@@ -7,7 +7,7 @@ def f (p:a)
f.wait [pr x]
-s (obj () ((a.) 5))
+s (obj ((a.) 5))
#def p (load-module pm)
View
8 ad-hoc-tests/sample.lx
@@ -2,10 +2,10 @@
# This is a sample LX file
-def a: obj ():
+def a: obj:
(m.) 5
-def b: obj ():
+def b: obj:
(n.) a
def x b:n
@@ -21,7 +21,7 @@ y.wait:
def x 7
pr x# this is a comment
-def x: obj ():
+def x: obj:
(run p1 p2):
pr p1
pr p2
@@ -43,7 +43,7 @@ pr (8 - 3)
pr (8 :- 3)
fn (x.) (* x x)
-def o: obj ():
+def o: obj:
(run.) "yess"
pr (o.)
View
4 bytes.na
@@ -176,12 +176,12 @@ def bytes: sobj:
end
(decode.):
- def alloc-str: obj ():
+ def alloc-str: obj:
inline C (run b) <<end
return make_str(datum_size(n_b));
end
- def decode-into: obj ():
+ def decode-into: obj:
inline C (run b s) <<end
decode_utf8(datum_size(n_b), (unsigned char *) n_b, (char *) n_s);
return n_s;
View
8 file-io.na
@@ -25,16 +25,16 @@ fsize(int f)
end
-def intern-syms: obj ():
+def intern-syms: obj:
inline C (run.) <<end
read_sym = intern("read");
write_sym = intern("write");
return ok_sym;
end
-def file: obj ():
+def file: obj:
(run name flags):
- def prepare: obj ():
+ def prepare: obj:
inline C (run.) <<end
int f;
int flags = O_RDONLY;
@@ -65,7 +65,7 @@ def file: obj ():
def pbox (prepare.)
- def f: obj ():
+ def f: obj:
inline C (read.) <<end
int r;
uint len;
View
4 fin.na
@@ -17,11 +17,11 @@ fin_test_fn(void *i)
end
def (f.):
- def make-box: obj ():
+ def make-box: obj:
inline C (run.) <<end
return make_pbox((void *) 3, fin_test_fn);
end
make-box.
#def pbox (make-box.)
- #obj ()
+ #obj
View
2 lib/pm.lx
@@ -1,2 +1,2 @@
-obj () ((m.) 5)
+obj ((m.) 5)
View
4 lx.py
@@ -300,7 +300,7 @@ def compile_sobj(exp, target, linkage, cenv, pop_all_symbol, tag=None):
after_obj)
def exp_methods(exp):
- return exp.cddr()
+ return exp.cdr()
def sobj_methods(exp):
return exp.cdr()
@@ -609,7 +609,7 @@ def definition_value(exp):
return make_fn(exp.cdadr(), exp.cddr())
def make_obj(tos):
- return cons(obj_s, cons(nil, tos))
+ return cons(obj_s, tos)
def make_fn(parameters, body):
return cons(fn_s, cons(parameters, body))
View
8 module.na
@@ -29,7 +29,7 @@ end
def *modules* '()
-def loader: obj ():
+def loader: obj:
(run name):
def ent (*modules*.assq name)
if ent: return ent.cdr
@@ -53,19 +53,19 @@ def (find-file name):
name = ("lib/"./ (name.str ./ ".lxc"))
name.encode
-def find-builtin: obj ():
+def find-builtin: obj:
inline C (run name) <<end
return find_builtin_module(n_name);
end
-def read-file: obj ():
+def read-file: obj:
inline C (run path) <<end
char name[datum_size(n_path) + 1];
copy_bytes_contents0(name, n_path, datum_size(n_path) + 1);
return read_module_file(name);
end
-def (make-placeholder.) (obj ())
+def (make-placeholder.) (obj.)
def module: sobj:
inline C (run.) <<end
View
32 prelude.na
@@ -8,12 +8,12 @@ end
def false '()
-def cons: obj ():
+def cons: obj:
inline C (run x y) <<end
return cons(n_x, n_y);
end
-def become: obj ():
+def become: obj:
inline C (run x y keep_y) <<end
datum x, y;
x = n_x;
@@ -22,25 +22,25 @@ def become: obj ():
return nil;
end
-def is?: obj ():
+def is?: obj:
inline C (run x y) <<end
if (n_x == n_y) return int2datum(1);
return nil;
end
# Define a trampoline for loading modules.
-def module: obj (): inline C (run name) "return lxc_module_module.instrs;"
+def module: obj: inline C (run name) "return lxc_module_module.instrs;"
# Now load the real module module so we can load any module.
module = module.run.run
-def pr: obj ():
+def pr: obj:
inline C (run x) <<end
pr(n_x);
return ok_sym;
end
-def prx: obj ():
+def prx: obj:
inline C (run x) <<end
prx(n_x);
return ok_sym;
@@ -52,17 +52,17 @@ def true 1
def (not x) (? x false true)
-def call: obj ():
+def call: obj:
inline C (run d msg argl) <<end
return call(n_d, n_msg, n_argl);
end
-def error: obj ():
+def error: obj:
inline C run <<end
return report_error(args);
end
-def inspect: obj ():
+def inspect: obj:
(has-method? c m):
def (scan x):
if (is? x '()): return false
@@ -104,12 +104,12 @@ def (map f a):
def x (f a.car) # evaluate x before the rest
cons x (map f a.cdr)
-def list: obj ():
+def list: obj:
inline C run <<end
return args;
end
-def bytes: obj ():
+def bytes: obj:
inline C run <<end
datum x;
uint n = 0;
@@ -133,7 +133,7 @@ def (assq x a):
def (make-dict.):
def items '()
- def dict: obj ():
+ def dict: obj:
(set key value):
def pair (assq key items)
if pair:
@@ -151,7 +151,7 @@ import (file-io as open)
def (make-queue.):
def front '()
def rear '()
- def queue: obj ():
+ def queue: obj:
(empty?.): is? front '()
(front.):
if (queue.empty?): error "front called on an empty queue"
@@ -213,7 +213,7 @@ def (make-promise.):
success-queue = '()
err-queue = '()
- def promise: obj ():
+ def promise: obj:
# This is the fully general wait function.
# f is a unary function to filter the value upon fulfillment
# h is a binary function to filter the error notice upon breakage
@@ -250,7 +250,7 @@ def (make-promise.):
(send msg args): promise.wait [call x msg args]
- def sink: obj ():
+ def sink: obj:
(run val):
if (resolved?.): error "already resolved"
status = 'resolved
@@ -283,7 +283,7 @@ def (make-task f):
cons promise task
# expects a thunk and a sink, returns a task
-def (make-task+ f sink): obj ():
+def (make-task+ f sink): obj:
(run.): sink (f.)
(break! x): sink.break! 'error x
View
6 re.na
@@ -13,15 +13,15 @@ datum mtab = 0;
end
-def re: obj ():
+def re: obj:
inline C dotall <<end
return int2datum(PCRE_DOTALL);
end
(run pat) (re.make pat (re.dotall))
(make pat opts):
- def compile: obj ():
+ def compile: obj:
inline C (run.) <<end
pcre *re;
const char *error;
@@ -36,7 +36,7 @@ def re: obj ():
def compiled (compile.)
- def r: obj ():
+ def r: obj:
(run subj) (r.match subj (r.runopts))
(find subj) (r.match subj (r.findopts))
View
4 sh-tests/assoc.na
@@ -26,8 +26,8 @@ pr 3 * 2 + 1
pr x
pr ""
-def o: obj ():
- (a.): obj ():
+def o: obj:
+ (a.): obj:
(b.) 3
pr 5
View
2 sh-tests/ind.na
@@ -1,6 +1,6 @@
def (y.) 5
-def x: obj (): (run.):
+def x: obj: (run.):
y.
pr: x.
View
2 sh-tests/insp.na
@@ -1,5 +1,5 @@
-def o: obj ():
+def o: obj:
(a.) 3
pr (inspect .has-method? o 'a)
View
2 sh-tests/methods.na
@@ -3,7 +3,7 @@ pr (inspect .methods '())
pr (inspect .methods '(a b))
pr (inspect .methods 'x)
pr (inspect .methods 45)
-pr (inspect .methods (obj () ((hi.) 4) ((there.) 7)))
+pr (inspect .methods (obj ((hi.) 4) ((there.) 7)))
pr ('(a b c) .filter (fn (x.) 1))

0 comments on commit 411d1bd

Please sign in to comment.