• R/O
  • SSH

Joypy: Commit

Main interpreter and library.


Commit MetaInfo

Revision1ee655f86008fa70f9ea0cc31547d9cfc4bae380 (tree)
Time2018-07-19 06:55:39
AuthorSimon Forman <sforman@hush...>
CommiterSimon Forman

Log Message

Removing polytypes; some pylint hints.

Change Summary

Incremental Difference

diff -r 0d6ddc806c69 -r 1ee655f86008 joy/library.py
--- a/joy/library.py Tue Jul 17 20:52:57 2018 -0700
+++ b/joy/library.py Wed Jul 18 14:55:39 2018 -0700
@@ -155,6 +155,7 @@
155155 can be defined completely by their stack effects. This means they
156156 can be auto-compiled.
157157 '''
158+ # pylint: disable=unused-variable
158159 cons = ef(a1, s0)((a1, s0))
159160 ccons = compose(cons, cons)
160161 dup = ef(a1)(a1, a1)
@@ -341,7 +342,7 @@
341342
342343 def __call__(self, stack, expression, dictionary):
343344 if self._compiled:
344- return self._compiled(stack, expression, dictionary)
345+ return self._compiled(stack, expression, dictionary) # pylint: disable=E1102
345346 expression = list_to_stack(self._body, expression)
346347 return stack, expression, dictionary
347348
@@ -1088,11 +1089,13 @@
10881089
10891090
10901091 def branch_true(stack, expression, dictionary):
1092+ # pylint: disable=unused-variable
10911093 (then, (else_, (flag, stack))) = stack
10921094 return stack, concat(then, expression), dictionary
10931095
10941096
10951097 def branch_false(stack, expression, dictionary):
1098+ # pylint: disable=unused-variable
10961099 (then, (else_, (flag, stack))) = stack
10971100 return stack, concat(else_, expression), dictionary
10981101
diff -r 0d6ddc806c69 -r 1ee655f86008 joy/utils/polytypes.py
--- a/joy/utils/polytypes.py Tue Jul 17 20:52:57 2018 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
1-# -*- coding: utf_8
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-pop = FUNCTIONS['pop']
14-
15-def loop_true(stack, expression, dictionary):
16- quote, (flag, stack) = stack
17- return stack, CONCAT(quote, (pop, expression)), dictionary
18-
19-def loop_two_true(stack, expression, dictionary):
20- quote, (flag, stack) = stack
21- return stack, CONCAT(quote, (pop, CONCAT(quote, (pop, expression)))), dictionary
22-
23-def loop_false(stack, expression, dictionary):
24- quote, (flag, stack) = stack
25- return stack, expression, dictionary
26-
27-FUNCTIONS['loop'] = CombinatorJoyType('loop', [loop_two_true, loop_true, loop_false], 101)
28-
29-
30-
31-
32-
33-
34-
35-
36-
37-
38-
39-
40-# joy.library.add_aliases(FUNCTIONS, joy.library.ALIASES)
41-
42-
43-# def set_expectations_of_definition(cjt):
44-# if len(cjt.stack_effects) != 1:
45-# raise ValueError
46-# defi = cjt.stack_effects[0]
47-# if not isinstance(defi, joy.library.DefinitionWrapper):
48-# raise ValueError
49-# F = infer_expression(defi.body)
50-# assert len(F) == 1, repr(F)
51-# fi, fo = F[0]
52-# cjt.expect = fi
53-
54-
55-
56-
57- average =
58- loop.expect = s6, (b1, s5)
59- disenstacken.expect = (As[1], s1), s0
60- joy.library._dictionary['disenstacken'],
61-
62-
63-# scope = globals().copy()
64-# scope.update(FUNCTIONS)
65-# eval(set_expectations.func_code, scope)
66-# del scope
67-
68-
Show on old repository browser