Stevie Strickland
66ce493ede
Adding original class field (we'll see what this is for in a sec.)
...
svn: r18234
2010-02-20 21:48:00 +00:00
Stevie Strickland
a0fdeff509
First order checks.
...
svn: r18233
2010-02-20 21:34:57 +00:00
Stevie Strickland
a4d6252d16
Start inherit contracts (which are useful for mixins). Tests, plus parsing.
...
svn: r18232
2010-02-20 21:28:20 +00:00
Stevie Strickland
a169105ed0
Sync up to trunk, because keeping up to date is the right thing to do (and
...
hopefully it'll get rid of the issues in tests/future/future.ss).
svn: r18228
2010-02-20 19:36:15 +00:00
Matthew Flatt
e38e8d88e0
basic set library
...
svn: r18222
2010-02-20 13:00:48 +00:00
Stevie Strickland
c59805ab9e
Syncing up to trunk before I go to bed, so setup-plt can run while I
...
sleep.
svn: r18220
2010-02-20 10:59:49 +00:00
Stevie Strickland
cd4aa4c6f6
Forgot about the no-contract forms, so needed to add tests for those, also.
...
svn: r18218
2010-02-20 10:40:50 +00:00
Stevie Strickland
7830d55b42
Okay, that does it for augment, which means I'm done with coding. Now just
...
documentation and benchmarking, then this can go on trunk.
svn: r18217
2010-02-20 10:09:37 +00:00
Stevie Strickland
67d47e0a1d
Fixes in override ctcs and test suite. I thought I ran it, so I find it
...
weird that I found these on a subsequent run when adding some quick augment
tests to start the next batch. (Oh, those are included also.)
svn: r18215
2010-02-20 09:40:41 +00:00
Stevie Strickland
b5e2d5f93e
Okay, now override contracts are done, so only augments remain.
...
svn: r18214
2010-02-20 09:30:40 +00:00
Stevie Strickland
3c1004fd05
Okay, we should be fixed up in compose-class, now we just need to start
...
handling the projections in class/c-proj.
svn: r18213
2010-02-20 09:14:14 +00:00
Stevie Strickland
28046b832b
Another step towards it -- here we're extending the int-methods vector
...
appropriately on subclassing after a contract boundary. Next is adding
in the projections.
svn: r18211
2010-02-20 08:43:54 +00:00
Stevie Strickland
a7017afe5a
Step 1: Cut a ...
...
Wait, no. Here we add the dynamic idxs, which will get incremented whenever
we pass through a contract boundary with an override (or later, augment)
contract.
svn: r18210
2010-02-20 08:21:09 +00:00
Stevie Strickland
90d8d3763a
Forgot to put this here.
...
svn: r18208
2010-02-20 06:36:28 +00:00
Stevie Strickland
ead01c9232
There's an app... err, function for that.
...
svn: r18207
2010-02-20 05:32:13 +00:00
Stevie Strickland
98e3695a20
Also change some old code to use vector-copy! as appropriate.
...
svn: r18206
2010-02-20 05:25:36 +00:00
Stevie Strickland
7b7d70a993
I should just use vector-copy! where applicable.
...
svn: r18205
2010-02-20 05:20:15 +00:00
Stevie Strickland
aaf9a5aeac
Apply the inherit-field projections appropriately.
...
svn: r18204
2010-02-20 04:18:49 +00:00
Stevie Strickland
fcee6788d7
Parsing and first order checks for internal field access contracts.
...
svn: r18203
2010-02-20 04:02:59 +00:00
Stevie Strickland
d87794a8d2
External field contracts FTW!
...
svn: r18202
2010-02-20 03:52:47 +00:00
Stevie Strickland
1688a6c3f7
Change how fields are accessed in prep for contract wrapping.
...
svn: r18201
2010-02-20 01:35:46 +00:00
Stevie Strickland
30864fc1d0
I dunno why, but this reads much better to me.
...
svn: r18200
2010-02-20 00:08:49 +00:00
Stevie Strickland
95438db40f
Add set-field!. Because it's useful, because we have get-field, so why
...
not it, and because it's an easy way to later test external field contracts.
svn: r18199
2010-02-19 23:55:39 +00:00
Robby Findler
7aa6ea4c76
PR 10645
...
svn: r18193
2010-02-19 19:43:14 +00:00
James Swaine
9170687148
moved futures random tests into /collects/tests/future
...
svn: r18192
2010-02-19 19:26:55 +00:00
Stevie Strickland
e9264b1fac
Syncing up before class.
...
svn merge ^/trunk
svn: r18188
2010-02-19 16:43:03 +00:00
Stevie Strickland
6777fc31a3
Rewrite this a little to make it clear that we're now only checking the
...
super class's beta-methods vector to make sure this is even an overrideable
method.
svn: r18181
2010-02-19 04:59:05 +00:00
Stevie Strickland
55d39b0035
It was a good thing I decided to add some super/inner mixed examples here,
...
because it pointed out a bug in my implementation where we weren't getting
the right version of the super method (which gets the projection).
svn: r18180
2010-02-19 04:40:10 +00:00
Stevie Strickland
5cc68fdd0f
In some ways, I'm still trying to decide exactly what some of these forms mean.
...
For example, if we're in the java part of a beta-java chain, can we still add
an inner contract? If so, it should affect each java-style overriding method
until we reach the next beta-style augmenting method.
It can just be confusing, because one might thing that inner in a
contract => needs an augmenting method in the subclass, super => needs
an overriding method in the subclass. The latter is true, since only
the next immediate method can reach the super class's implementation,
but inner jumps to the next augmenting method, so the former isn't
necessarily true.
svn: r18179
2010-02-19 04:27:44 +00:00
Stevie Strickland
b59955bc01
Ah, that'd be the issue. THE TESTS WERE WRONG. All's well, and I've even
...
added a couple more tests to make sure we apply the projections in the right
order.
svn: r18176
2010-02-19 00:34:27 +00:00
Stevie Strickland
2b92ea9225
Start inner projections work. Next, test cases, then I'll fix the test
...
cases by implementing the rest.
svn: r18174
2010-02-18 23:54:56 +00:00
Stevie Strickland
da7473b867
TEST DRIVEN DEVELOPMENT.
...
svn: r18173
2010-02-18 23:35:58 +00:00
Stevie Strickland
301ac0e5f3
The simplest of all the contract features to handle.
...
svn: r18169
2010-02-18 23:17:48 +00:00
Stevie Strickland
cc52bcd197
Start throwing in higher-order checks.
...
svn: r18168
2010-02-18 23:09:42 +00:00
Ryan Culpepper
b68494250f
scheme/pretty: added quasisyntax reader macro
...
macro-debugger: added change layout menu items
svn: r18166
2010-02-18 22:53:11 +00:00
Stevie Strickland
ce04db35a0
Rename tests to be more specific, start inner tests, fix introduced bug.
...
svn: r18164
2010-02-18 22:27:34 +00:00
Stevie Strickland
a7d8507e3c
Actually, these have slightly different conditions. super contracts require
...
an overrideable method (augride is okay), whereas override contracts require
a method which has never been augmentable (i.e. no pubments or overments).
svn: r18162
2010-02-18 22:11:01 +00:00
Stevie Strickland
87c5e94fc3
Filter out overrideable checks for both super and override contracts, add
...
check against final methods (and change check for augmentable ones).
svn: r18161
2010-02-18 22:06:41 +00:00
Stevie Strickland
126c3958b2
Add in different method tables for super calls and internal dynamic dispatch.
...
Eventually the latter will become a table to vectors of methods instead, but
until I start handling override/augment contracts, we can use the simplified
version.
svn: r18153
2010-02-18 19:50:59 +00:00
Stevie Strickland
b18283b626
Keeping up with trunk.
...
svn merge ^/trunk
svn: r18145
2010-02-18 04:34:09 +00:00
Stevie Strickland
eea685c1cf
I didn't fix object-contract from mzlib/contract, just from scheme/contract.
...
I don't plan on fixing the former at the moment, so I'll just add back these
two accessors so that it's happy.
svn: r18144
2010-02-18 04:22:45 +00:00
Stevie Strickland
43613389a7
Add class/c and object/c forms, including first-order checks and basic
...
projections that only perform first-order checks. To add full projections,
also need to change the class struct.
svn: r18143
2010-02-18 04:02:12 +00:00
Stevie Strickland
fa5ed2c160
Fix object-contract's first-order property to do some reasonable first-order
...
checking, instead of always failing.
svn: r18121
2010-02-17 19:09:49 +00:00
Stevie Strickland
35afebaea3
Change object-contract to use find-method/who (already exported for Typed
...
Scheme) to look for the appropriate method to wrap, which makes Robby's
object-contracts appropriately translucent during contract wrapping.
svn: r18102
2010-02-16 19:58:07 +00:00
Matthew Flatt
6f0d6b28de
some mz and ffi changes from the mr2 branch
...
svn: r18099
2010-02-16 17:55:28 +00:00
Matthew Flatt
aad22e2c3e
restore scheme/future
...
svn: r18032
2010-02-09 17:19:58 +00:00
Robby Findler
e581ac7bfd
made room for some tests in here and added them
...
svn: r18028
2010-02-09 14:53:09 +00:00
Carl Eastlund
fe40d3e888
Merged changes from trunk.
...
svn: r18007
2010-02-06 19:23:24 +00:00
Eli Barzilay
0725ba7608
Reformat
...
svn: r17988
2010-02-05 03:22:26 +00:00
Eli Barzilay
2cc4429c62
When constructing code, use the `object-name' of the input port *only*
...
if it's coming from a file -- not when it's a string. In that case, use
`#f' for the name, so other code (specifically, `input->code') will use
'program.
svn: r17987
2010-02-05 03:22:23 +00:00
Eli Barzilay
a4954b774d
Use optional arguments instead of `case-lambda'.
...
svn: r17986
2010-02-05 03:22:21 +00:00
Eli Barzilay
536d0266df
Use unsafe operations in `sort'. It has been running in safe mode for a
...
while with no errors reported, and this change is done now when there's
time before the next release.
svn: r17985
2010-02-05 03:22:17 +00:00
Eli Barzilay
2368290cdb
Test now that the generator is not in a running state when it's called.
...
The previous problem was just a bug.
svn: r17984
2010-02-05 03:22:15 +00:00
Eli Barzilay
d5822a3ee5
Remove the special case hack for getting zero values at the end of a
...
generator. This will make this:
(generator (yield 1) (yield))
also repeat #<void> when it's done which will be very confusing. Better
just add a note in the docs on (generator (yield 1)) returning no values
when it's done.
Also, remove some of the `case-lambda' optimizations...
svn: r17983
2010-02-05 03:22:12 +00:00
Eli Barzilay
3a08648dab
Added a `running' state, which is visible only from inside the
...
generator. (Also considered making it an error when the generator is
called while it is running, but that doesn't allow (yield (yield X))
fun.)
svn: r17982
2010-02-05 03:22:09 +00:00
Eli Barzilay
2f62cb192e
Allow using `yield' with any number of arguments which will be returned
...
as multiple values. (These `case-lambda's are for making it fast, which
is probably stupid given how slow this is anyway.)
svn: r17981
2010-02-05 03:22:07 +00:00
Eli Barzilay
f1dcf49d38
Added `generator-state', implemented using a local state (which also
...
simplifies the code that raises an error from the last change).
svn: r17980
2010-02-05 03:22:04 +00:00
Eli Barzilay
505034ea26
The generator function can now be used to send values to the generator.
...
For example,
(define g (generator (yield (yield (yield 1)))))
(list (g) (g 2) (g 3) (g 4) (g) (g))
evaluates to '(1 2 3 4 4 4). This is something that Python does (as a
generator.send method), which might be useful for using generators as
co-routines, and it is actually easy to implement since sending values
is exactly what we get when the generator call is actually calling the
saved continuation. So most of the change is dealing with the
technicalities of throwing an error when the generator is called with
some arguments, when that's done after it's terminated (at the stage
where it's repeating the last value for ever).
A few tests added for this.
svn: r17979
2010-02-05 03:22:01 +00:00
Eli Barzilay
18c8e41fac
Make it possible for the last expression in the body of a generator to
...
return any number of values. They will be collected and used as the
repeat-forever result of calling the generator again.
Note: there's an exception for using no values -- instead of returning
no values forever, use void, since no values can be more surprising, and
it can happen when someone uses something like
(generator (yield 1) (yield 2) (yield 3))
since the result of `yield' is (values). (This will change in a
following commit, but even then it will be popular since people will
usually invoke the generator with no arguments which leads to the zero
values. Could be solved if you use (g (void)) -- but that's awkward, I
think.)
svn: r17978
2010-02-05 03:21:59 +00:00
Eli Barzilay
c88a5a6856
A bunch of additional typos
...
svn: r17976
2010-02-05 03:21:52 +00:00
Carl Eastlund
2e64069d14
Re-disabled legacy (contract ...) form.
...
svn: r17960
2010-02-03 17:08:26 +00:00
Carl Eastlund
1d4cdbeb45
Exports from scheme/contract/private/blame: removed constructor; fixed confusing selector names.
...
svn: r17909
2010-01-31 03:03:30 +00:00
Carl Eastlund
d5329eb2a6
Make contract form more permissive; import make-blame.
...
svn: r17908
2010-01-31 01:48:08 +00:00
Carl Eastlund
bf308563d2
Hide make-blame; remove blame-positive and blame-negative; make blame objects transparent (but allow equal?).
...
svn: r17907
2010-01-31 01:47:48 +00:00
Carl Eastlund
f8df3608d4
Hide "make-blame" from normal export.
...
svn: r17906
2010-01-31 01:47:07 +00:00
Carl Eastlund
0e697067cb
Uniformly "unpack" contract blame party names.
...
svn: r17904
2010-01-31 00:30:00 +00:00
Carl Eastlund
29b628cb0a
Fixed legacy projections to allow 4 or 5 arguments.
...
svn: r17903
2010-01-31 00:29:37 +00:00
Carl Eastlund
7d577d9d02
Removed an unnecessary require.
...
svn: r17901
2010-01-30 21:45:52 +00:00
Carl Eastlund
2772ffccba
Restored legacy functions for custom contracts.
...
svn: r17900
2010-01-30 21:14:27 +00:00
Carl Eastlund
2513e7d6e0
Merged changes from the trunk.
...
svn: r17892
2010-01-30 04:59:20 +00:00
Eli Barzilay
4cb01a48b3
only for programs
...
svn: r17835
2010-01-26 15:04:51 +00:00
Eli Barzilay
04725539c7
Propagate path to syntax source of evaluated files when applicable
...
Set `current-load-relative-directory' based on path when it names a directory.
svn: r17826
2010-01-25 21:02:15 +00:00
Carl Eastlund
7f58c26709
Replaced uses of quote-srcloc with quote-syntax.
...
svn: r17757
2010-01-19 23:25:07 +00:00
Carl Eastlund
791178a549
Fixed printing of blame error messages to use display and write appropriately.
...
svn: r17753
2010-01-19 09:28:28 +00:00
Carl Eastlund
51983e3829
Fixed simple-contract stronger check.
...
svn: r17752
2010-01-19 09:28:08 +00:00
Carl Eastlund
6a0469b680
Fixed detection of printable contracts in dependent struct contracts.
...
svn: r17751
2010-01-19 09:27:51 +00:00
Carl Eastlund
9506494416
Fixed a shadowed name
...
svn: r17743
2010-01-19 07:28:06 +00:00
Carl Eastlund
d01e61508f
Fixed a blame assignment typo.
...
svn: r17741
2010-01-19 07:14:00 +00:00
Carl Eastlund
5d7774e7b2
Fixed test for procedure?, which now recognizes flat contracts, and typo for contract-projection.
...
svn: r17738
2010-01-19 05:59:47 +00:00
Carl Eastlund
4b739b5f62
Removed obsolete build-src-loc-string
...
svn: r17734
2010-01-19 03:43:00 +00:00
Carl Eastlund
3921e16aa1
Updated lingering use of old src-info format.
...
svn: r17732
2010-01-19 03:41:30 +00:00
Carl Eastlund
4de3ee3a9e
Re-enabled 4-argument contract macro, and added more output to misuse messages.
...
svn: r17731
2010-01-19 03:41:03 +00:00
Carl Eastlund
2f2068356c
Replaced mistaken #f with srcloc.
...
svn: r17730
2010-01-19 03:39:28 +00:00
Carl Eastlund
9fbf023d90
Took collection path simplification out of this file.
...
svn: r17729
2010-01-19 03:38:55 +00:00
Carl Eastlund
0edd786361
Removed more occurrences of old source info representation.
...
svn: r17724
2010-01-18 23:24:34 +00:00
Carl Eastlund
167c9cb1a8
Changed contract source locations to perform module resolution in advance.
...
svn: r17723
2010-01-18 23:11:12 +00:00
Carl Eastlund
54d5b0ac7f
Updated predicate list in scheme/exists/lang based on contract library changes.
...
svn: r17721
2010-01-18 18:53:06 +00:00
Carl Eastlund
6ac7fe78e6
Ported object contracts to new properties.
...
svn: r17719
2010-01-18 18:32:26 +00:00
Carl Eastlund
1014dd2da4
Converted provide.ss to use new contract form and deference variable-reference.
...
svn: r17716
2010-01-18 17:05:06 +00:00
Carl Eastlund
124050d54e
Converted current-contract-region to dereference variable-reference.
...
svn: r17715
2010-01-18 17:04:44 +00:00
Carl Eastlund
b0c93342d9
Fixed type error in source location conversion.
...
svn: r17714
2010-01-18 17:04:01 +00:00
Carl Eastlund
4d22b7a5f4
Allowed path values in blame s-expressions.
...
svn: r17708
2010-01-17 18:50:55 +00:00
Carl Eastlund
4e3874a1c5
Moved path pretty-printing into blame module.
...
svn: r17707
2010-01-17 18:50:40 +00:00
Carl Eastlund
00d79083e3
Slight changes to new contract protocol.
...
svn: r17705
2010-01-17 18:35:19 +00:00
Carl Eastlund
b24b946155
Added explicit checks for saner contract
protocol.
...
svn: r17704
2010-01-17 18:02:39 +00:00
Carl Eastlund
bb7bd9de51
Typos and type errors in new property stuff.
...
svn: r17700
2010-01-17 07:23:47 +00:00
Carl Eastlund
e408fd464b
Propagated guts exports through scheme/contract/base and scheme/contract.
...
svn: r17698
2010-01-17 06:18:13 +00:00
Carl Eastlund
7716e58f61
Ported basic-opters.ss to new properties.
...
svn: r17697
2010-01-17 06:12:59 +00:00
Carl Eastlund
336dd1b808
Ported ds.ss to new properties.
...
svn: r17696
2010-01-17 06:10:29 +00:00
Carl Eastlund
41bd96f6aa
Made blame objects transparent to allow equal?
...
svn: r17695
2010-01-17 06:10:09 +00:00