Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use `=` rather than `::` for assignment.

  • Loading branch information...
commit c7270a409a1d02e32408ca664b1e6f1aebe75ab0 1 parent ff84bd6
@kr authored
View
6 TODO
@@ -39,11 +39,11 @@
[+] rename "begin" to "do"
[ ] cond exprs
[+] new import and export source transformations
-[ ] re-arrange punctuation ops: use == for equality, and = for assignment
-[ ] let set! (aka =, nee ::) implicitly define, without shadowing
+[+] re-arrange punctuation ops: use == for equality, and = for assignment
+[ ] let set! (aka =) implicitly define, without shadowing
[ ] have set! return the new value
[ ] make a bigint type for arbitrary precision
-[ ] (x y z) :: 3-list
+[ ] (x y z) = 3-list
[ ] overloading by number of args
[ ] var args
[ ] fix handling of unassigned variables
View
2  ad-hoc-tests/inf2.lx
@@ -4,7 +4,7 @@ def (report.):
pr ("reached depth %d" % n)
def (count.):
- n :: (n + 1)
+ n = (n + 1)
? ((n % 100000) == 0) (pr n)
count.
View
2  ad-hoc-tests/sample.lx
@@ -29,7 +29,7 @@ x:run 9 5
pr "about to print '(x y)"
pr '(x
y)
-x :: 3
+x = 3
pr "about to print x, which should equal 3"
pr x
? x:
View
2  count.lx
@@ -1,7 +1,7 @@
def n 0
def (count.):
- n :: (n + 1)
+ n = (n + 1)
? ((n % 100000) == 0) (pr n)
? (n < 5000000) (count.)
View
2  lexer.py
@@ -118,7 +118,7 @@ def filter(seq):
(INT, r'-?[0-9]+', ),
(UNOP, r'\.' + name_pat + r'|\.' + non_name_pat + '|' +
':' + name_pat + '|' + ':' + non_name_pat, ),
- (BINOP, non_name_pat + '|' + '::'),
+ (BINOP, non_name_pat),
(NAME, name_pat, ),
(DOT, r'\.', ),
(DOTS, r':', ),
View
12 lib/unit-test.lx
@@ -121,25 +121,25 @@ def (make-collector suite):
def pass-count 0
def collector ():
- (start.) (start-time :: (time .now))
+ (start.) (start-time = (time .now))
- (stop.) (stop-time :: (time .now))
+ (stop.) (stop-time = (time .now))
(error-in ex case):
errors (make-result .error ex case)
- total-run :: (total-run + 1)
+ total-run = (total-run + 1)
pr "E"
#STDOUT .flush
(failure-in ex case):
failures (make-result .failure ex case)
- total-run :: (total-run + 1)
+ total-run = (total-run + 1)
pr "F"
#STDOUT .flush
(pass-in case):
- pass-count :: (pass-count + 1)
- total-run :: (total-run + 1)
+ pass-count = (pass-count + 1)
+ total-run = (total-run + 1)
pr "."
#STDOUT .flush
View
2  lx.py
@@ -44,7 +44,7 @@ def annotate_or_report(self, exp):
sobj_s = S('sobj')
do_s = S('do')
inline_s = S('inline')
-assign_s = S('::')
+assign_s = S('=')
def compile(exp, target, linkage, cenv, pop_all_symbol, **kwargs):
try:
if self_evaluatingp(exp):
View
4 module.na
@@ -34,7 +34,7 @@ def loader ():
def ent (*modules*.assq name)
if ent: return ent.cdr
def new-module (make-placeholder.)
- *modules* :: (cons (cons name new-module) *modules*)
+ *modules* = (cons (cons name new-module) *modules*)
become new-module (load-module name) 1
. new-module
@@ -50,7 +50,7 @@ def (make-module name):
read-file (find-file name)
def (find-file name):
- name :: ("lib/"./ (name.str ./ ".lxc"))
+ name = ("lib/"./ (name.str ./ ".lxc"))
name.encode
def find-builtin: obj ():
View
28 prelude.na
@@ -32,7 +32,7 @@ def is? ():
def module (): 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
+module = module.run.run
def pr ():
inline C (run x) <<end
@@ -139,7 +139,7 @@ def (make-dict.):
if pair:
pair.set-cdr! value
else:
- items :: (cons (cons key value) items)
+ items = (cons (cons key value) items)
(run key):
def pair (assq key items)
if pair: return pair.cdr
@@ -159,11 +159,11 @@ def (make-queue.):
(run item):
def new (cons item '())
if (queue.empty?):
- front :: new
- rear :: new
+ front = new
+ rear = new
else:
rear.set-cdr! new
- rear :: new
+ rear = new
. queue
(remove!.):
def item queue.front
@@ -171,7 +171,7 @@ def (make-queue.):
. item
(delete!.):
if (queue.empty?): error "delete! called on an empty queue"
- front :: front.cdr
+ front = front.cdr
. queue
(consume! f):
if (queue.empty?):
@@ -209,9 +209,9 @@ def (make-promise.):
if (broken?.) (f err-name err-val)
def (process state err):
- status :: state
- success-queue :: '()
- err-queue :: '()
+ status = state
+ success-queue = '()
+ err-queue = '()
def promise ():
# This is the fully general wait function.
@@ -253,15 +253,15 @@ def (make-promise.):
def sink ():
(run val):
if (resolved?.): error "already resolved"
- status :: 'resolved
- value :: val
+ status = 'resolved
+ value = val
success-queue.consume! [x val]
process 'resolved
(break! name val):
if (broken?.): error "already broken"
- status :: 'broken
- err-name :: name
- err-val :: val
+ status = 'broken
+ err-name = name
+ err-val = val
err-queue.consume! [x name val]
process 'broken
View
2  sh-tests/assoc.na
@@ -18,7 +18,7 @@ pr (1 + 2 * 3)
pr 1 + 2 * 3
pr x
-x :: 9
+x = 9
pr ""
pr 9
pr (3 * 2 + 1)
View
4 tests/list.lx
@@ -7,8 +7,8 @@ def (make-tester.):
obj ():
(set-up.):
- empty :: '()
- single :: '(4.)
+ empty = '()
+ single = '(4.)
(test-car.):
#should [4 == (single.car)]
Please sign in to comment.
Something went wrong with that request. Please try again.