jckarter / clay

The Clay programming language
http://claylabs.com/clay
Other
404 stars 34 forks source link

Protocols #304

Closed stepancheg closed 12 years ago

stepancheg commented 12 years ago

Add "define" function signatures to core.operators.

I think this makes code easier to read and to maintain.

As part of this refactoring other parts of standard library were tweaked:

jckarter commented 12 years ago

Looks good, but does it work? Sequence? is defined in terms of iterator, and iterator for coordinate sequences in terms of begin and end, so having Sequence? in the signatures of these functions seems like it could cause a circularity.

stepancheg commented 12 years ago

I ran all tests, and tests pass. So if there is circularity, it is not revealed by Clay tests.

You must be talking about CoordinateRange. Iterator for CoordinateRange uses 'begin' and 'end' fields, and does not call 'begin' or end 'functions'.

I could also drop Sequence? condition from guards, and restrict only parameter count.

jckarter commented 12 years ago

OK, if the tests pass, it should be fine. Thanks.