Commit Graph

421 Commits

Author SHA1 Message Date
Stevie Strickland
11b8fd4204 Fix vector creation for internal field access.
svn: r18269
2010-02-22 20:57:36 +00:00
Stevie Strickland
c2fcdbba65 Class Contracts Phase 2: Object/c Boogaloo
This isn't just a copy of trunk r18264 -- it has a slight difference in how
local field accessors and mutators are handled that will eventually play a
larger role.

svn: r18265
2010-02-22 19:09:42 +00:00
Stevie Strickland
a0769da5ea Add the contract shorthands for -> and ->* to use for methods where we don't
care about properties of this.

svn: r18248
2010-02-21 02:54:06 +00:00
Stevie Strickland
ffa34e1f7d Add augride, which is like augment but enables the contract writer to give
subclasses an idea of whether a method can be augmented (augment) or whether
a method augmentation can be overridden (augride).

svn: r18240
2010-02-21 00:17:42 +00:00
Stevie Strickland
f72ca7bb1b Now inherit works (and tests!)
svn: r18237
2010-02-20 22:54:11 +00:00
Stevie Strickland
370792b881 Refactoring done, and I think that's actually cleaned up things a bit. Now
to handle inherit.

svn: r18236
2010-02-20 22:44:53 +00:00
Stevie Strickland
b589c3c230 More preparation to move all the int-method/dynamic-proj expansion into
class/c-proj instead of compose-class.

svn: r18235
2010-02-20 22:00:45 +00:00
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
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
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
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
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
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
c88a5a6856 A bunch of additional typos
svn: r17976
2010-02-05 03:21:52 +00:00
Eli Barzilay
39595d2d05 faster version of the code
svn: r17525
2010-01-07 03:38:23 +00:00
Robby Findler
ccacf5a651 svn: r17509 2010-01-06 21:25:00 +00:00
Robby Findler
d014e0d0d8 improved along the lines of Eli's suggestions
svn: r17507
2010-01-06 21:22:29 +00:00
Robby Findler
c8410ef36d svn: r17506 2010-01-06 21:16:49 +00:00
Robby Findler
68efb4008a normalized the results of procedure-arity
svn: r17504
2010-01-06 19:34:29 +00:00
Matthew Flatt
1dec25d99d remove stx-cert transparency on scheme/base lambda expansion
svn: r17471
2010-01-03 18:06:52 +00:00
Matthew Flatt
38d7e8fea2 built-in fixnum ops; bug fix related to misuse of flonum ops; questionable attempt to improve inlining algorithm
svn: r17461
2010-01-02 16:33:28 +00:00
Matthew Flatt
2200ef17f5 fix problem with expansion to lambda in class form; better certficate transparency in splicing-let forms
svn: r17436
2009-12-30 12:35:21 +00:00
Stevie Strickland
fb85388288 Add this%, which is the class counterpart of the object reference "this".
svn: r17359
2009-12-19 20:56:40 +00:00
Matthew Flatt
294e593dd2 fix overly pessimistic 'in-naturals' when an argument is supplied
svn: r17292
2009-12-14 17:51:36 +00:00
Sam Tobin-Hochstadt
c8c9bd0556 Add `in-bytes-lines'
svn: r17261
2009-12-10 17:01:53 +00:00
Jay McCarthy
b26bdba77d Found a small error in in-port's handling of default arguments
svn: r17244
2009-12-08 22:50:43 +00:00
Eli Barzilay
1a12497bc1 optimize insertionsort: one less loop variable, one more addition, unconditional first step
svn: r17227
2009-12-06 09:11:47 +00:00
Eli Barzilay
9cc6cd0db4 moved extra promise types back to scheme/promise
svn: r17207
2009-12-05 09:28:41 +00:00
Eli Barzilay
4df0d11db5 promise code moved to scheme/private
svn: r17205
2009-12-05 09:07:17 +00:00
Ryan Culpepper
d42a6f1582 replaced at-syntax with syntax-local-eval
svn: r17168
2009-12-02 23:39:55 +00:00
Eli Barzilay
7c24f19675 what used to not work now works
svn: r17157
2009-12-02 04:57:25 +00:00
Eli Barzilay
4977e6bd6c Switch off unsafe operations for now, better to turn it on after the
code was used for a while.

svn: r17008
2009-11-23 18:53:13 +00:00
Eli Barzilay
0b6ae05e9b Use unsafe operations for dealing with the vectors and indexes.
svn: r17007
2009-11-23 18:51:03 +00:00
Eli Barzilay
ea94f5dea5 Added `copying-insertionsort' for small blocks, some fixes.
svn: r17006
2009-11-23 18:50:12 +00:00
Eli Barzilay
ab832a3b4d Optimize copying-quicksort by passing around only two indexes and the
length of the block.

svn: r17005
2009-11-23 18:49:38 +00:00
Eli Barzilay
d46beb2325 Works on lists of any size now.
svn: r17004
2009-11-23 18:48:46 +00:00
Eli Barzilay
c68eeb97ca Further optimizations to `merge'.
svn: r17003
2009-11-23 18:48:06 +00:00
Eli Barzilay
ebfdbe4bb0 Combined the two merge functions into one macro, and improved it a little.
svn: r17002
2009-11-23 18:47:32 +00:00
Eli Barzilay
a272c479a6 First version of a vector-based "half-copying" merge sort, which will end up
being more than twice faster than the current version.

[Currently works only with 2^n lists, and otherwise broken -- committed
to keep the development history in svn.]

svn: r17001
2009-11-23 18:46:40 +00:00
Eli Barzilay
e2cd7a51e5 Fixed a comparison that was too strict, making the code go to the
general case on lists of length 3.  (Didn't have much effect since it's
only the toplevel comparison).

svn: r16899
2009-11-19 21:58:44 +00:00
Stevie Strickland
c993533814 Change from (module ...) -> #lang and also move any mzscheme -> scheme/base.
svn: r16563
2009-11-05 17:18:54 +00:00
Matthew Flatt
4edc044cb6 source locations for 'for' loops in stack traces
svn: r16545
2009-11-04 19:17:31 +00:00
Jon Rafkind
f99c5f276c print value of the super class in error messages
svn: r16482
2009-10-30 17:50:15 +00:00
Eli Barzilay
cf91b7c254 Use in-producer' for in-input-port-chars' and `in-input-port-bytes'.
(The non-macro version of `in-input-port-bytes' still uses
`:input-port-gen', since it's needed anyway.)

svn: r16475
2009-10-30 13:34:33 +00:00
Eli Barzilay
4f002bb7bb Redo in-port' and in-lines' using `in-producer', since this gives us a
faster macro version for the loops.

svn: r16474
2009-10-30 11:10:05 +00:00
Eli Barzilay
c049ccca3a minor fixes
svn: r16473
2009-10-30 10:48:38 +00:00
Eli Barzilay
52ac79406b some reformatting
svn: r16472
2009-10-30 10:46:18 +00:00
Eli Barzilay
87a5092c82 added error checking for the reader, some shuffling
svn: r16471
2009-10-30 08:24:57 +00:00
Sam Tobin-Hochstadt
653d0ccd66 Add in-port', port->list', `file->list'.
Add documentation, tests for above.
Allow procedure argument to `fold-files' to return 2 values in all cases.
Document, test.

svn: r16453
2009-10-29 18:49:34 +00:00
Matthew Flatt
4e35bda756 add some missing prefixes for static struct info
svn: r16219
2009-10-02 17:38:15 +00:00
Kevin Tew
a25ddaae54 kernstruct.ss in scheme/private, makeexn generates kernstruct.ss
svn: r16215
2009-10-02 14:31:45 +00:00
Matthew Flatt
95235a4522 fix problem with regexp-match*, etc. and byte regexps (merge to 4.2.2)
svn: r16133
2009-09-26 18:50:41 +00:00
Stevie Strickland
636adcc142 Refactoring all the private contract stuff into its own playpen.
svn: r16052
2009-09-17 20:55:37 +00:00
Stevie Strickland
70e8f21ba2 Refactoring scheme/private/contract into reasonably sized pieces.
svn: r16049
2009-09-17 19:45:56 +00:00
Stevie Strickland
aca0bcf82e First moving private/contract.ss to a different name. The diaspora from
that file into others will happen next.

svn: r16048
2009-09-17 17:42:45 +00:00
Jon Rafkind
bba25510ea define-struct/contract:
fix looping over keywords
  allow #:property keyword
  cleanup syntax errors

svn: r15973
2009-09-11 17:37:40 +00:00
Matthew Flatt
8ae0ea9d14 unsafe ops (v4.2.1.8)
svn: r15899
2009-09-06 18:24:46 +00:00
Stevie Strickland
3c5511e5b0 We shouldn't blame the context for both positive and negative here -- the
positive blame should be the struct itself.  We'll get that blame via
(current-contract-region), since the expression is within the with-contract.

svn: r15890
2009-09-05 17:33:28 +00:00
Jon Rafkind
e9e1d4b5b7 define-struct/contract can handle sub-typing now
svn: r15887
2009-09-05 16:47:59 +00:00
Robby Findler
5f688d1144 added scheme/exists lang and some docs in the guide about #:exists contracts
svn: r15879
2009-09-04 17:58:08 +00:00
Robby Findler
937d2efab3 added exists to provide/contract
svn: r15871
2009-09-04 04:52:02 +00:00
Robby Findler
4532602b5a svn: r15854 2009-09-01 21:43:41 +00:00
Robby Findler
5c73253e03 changed the low-level api for contracts so the projections accept an extra argument indicating if the contract is being used positively or negatively
svn: r15850
2009-09-01 16:25:08 +00:00
Ryan Culpepper
38fc6c8e67 fixed PR 10418 (keyword args in procedure contracts)
svn: r15847
2009-09-01 15:08:06 +00:00
Eli Barzilay
ec9fc2571a Added `in-producer'.
(Note that `test-generator' tests use quasiquote for the expected result).

svn: r15811
2009-08-27 09:15:52 +00:00
Stevie Strickland
8ae58f1244 Primarily this is a change so that the negative party entering into
with-contract based contracts is the syntactic context of the with-contract
expression.  Also, there's some code cleanup.

svn: r15665
2009-08-03 21:15:44 +00:00
Robby Findler
b5b32d1d8e added automatic compilation to the module language, plus various other tweaks (contract library enhancement, bug fixes here and there)
svn: r15635
2009-07-30 05:17:40 +00:00
Matthew Flatt
a47d94f75f add file-or-directory-identity (4.1.2.5)
svn: r15623
2009-07-29 17:39:03 +00:00
Eli Barzilay
3b194ff070 error typo
svn: r15593
2009-07-28 06:18:28 +00:00