Re: [Pharo-users] MetaLinks for Dynamic Contracts

2020-05-18 Thread Marcus Denker



> On 3 May 2020, at 23:18, Evan Donahue  wrote:
> 
> Hello,
> 
> I am returning to some work in Pharo after about ~2.5 years and reminding 
> myself of what I was working on before I got sidetracked. It appears 
> 
> I had mostly finished for release a dynamic contracts library for run time 
> type checking based on Racket's contract library.[1] However, it relied on 
> some hackery to interact well with the TestCoverage class, since both the 
> contract and the TestCoverage wanted to replace the method during the run of 
> a test. However, since it seems in Pharo 8 the TestCoverage class is no 
> longer present, this seems like a good time to re-evaluate the project before 
> I go in to see what needs to be patched up. I therefore have three questions:
> 
> 1) Are there now any existing libraries for dynamic contracts that I should 
> use instead of patching my old library?
> 
> 2) Is MetaLinks the preferred way to intercept messages, and if so can 
> someone point me to the repo (I can't seem to find it on Github)?
> 

The MetaLinks are in the release, no need to load anything.

> 3) If 2, does MetaLinks play well with whatever is the current TestCoverage 
> alternative that I assume still does some form of message interception, e.g. 
> will the test coverage function still work properly on a MetaLink'ed message, 
> or will that require further hackery (I discovered MetaLinks after the first 
> version, so I used the more basic message replacement apis)?
> 

The test Coverage was re-implemented with MataLink, see the method 
#collectCoverageFor: in TestRunner.

This means that it should compose nicely with any other #before or #after 
MetaLink, without any need to take special care.


Marcus




Re: [Pharo-users] MetaLinks for Dynamic Contracts

2020-05-04 Thread Ben Coman
On Mon, 4 May 2020 at 05:19, Evan Donahue  wrote:

> Hello,
>
> I am returning to some work in Pharo after about ~2.5 years and reminding
> myself of what I was working on before I got sidetracked. It appears
>
> I had mostly finished for release a dynamic contracts library for run time
> type checking based on Racket's contract library.[1] However, it relied on
> some hackery to interact well with the TestCoverage class, since both the
> contract and the TestCoverage wanted to replace the method during the run
> of a test. However, since it seems in Pharo 8 the TestCoverage class is no
> longer present, this seems like a good time to re-evaluate the project
> before I go in to see what needs to be patched up. I therefore have three
> questions:
>
> 1) Are there now any existing libraries for dynamic contracts that I
> should use instead of patching my old library?
>
> 2) Is MetaLinks the preferred way to intercept messages,
>



> and if so can someone point me to the repo (I can't seem to find it on
> Github)?
>

There is no repo for MetaLinks.  It comes batteries installed. (i.e. its in
the image)

cheers -ben


Re: [Pharo-users] MetaLinks for Dynamic Contracts

2020-05-04 Thread Sven Van Caekenberghe
He Evan,

Can't answer your questions, but the contracts concepts sounds interesting !

Sven

> On 3 May 2020, at 23:18, Evan Donahue  wrote:
> 
> Hello,
> 
> I am returning to some work in Pharo after about ~2.5 years and reminding 
> myself of what I was working on before I got sidetracked. It appears 
> 
> I had mostly finished for release a dynamic contracts library for run time 
> type checking based on Racket's contract library.[1] However, it relied on 
> some hackery to interact well with the TestCoverage class, since both the 
> contract and the TestCoverage wanted to replace the method during the run of 
> a test. However, since it seems in Pharo 8 the TestCoverage class is no 
> longer present, this seems like a good time to re-evaluate the project before 
> I go in to see what needs to be patched up. I therefore have three questions:
> 
> 1) Are there now any existing libraries for dynamic contracts that I should 
> use instead of patching my old library?
> 
> 2) Is MetaLinks the preferred way to intercept messages, and if so can 
> someone point me to the repo (I can't seem to find it on Github)?
> 
> 3) If 2, does MetaLinks play well with whatever is the current TestCoverage 
> alternative that I assume still does some form of message interception, e.g. 
> will the test coverage function still work properly on a MetaLink'ed message, 
> or will that require further hackery (I discovered MetaLinks after the first 
> version, so I used the more basic message replacement apis)?
> 
> Thank you,
> Evan
> 
> 
> [1] https://docs.racket-lang.org/reference/contracts.html




[Pharo-users] MetaLinks for Dynamic Contracts

2020-05-03 Thread Evan Donahue
Hello,

I am returning to some work in Pharo after about ~2.5 years and reminding
myself of what I was working on before I got sidetracked. It appears

I had mostly finished for release a dynamic contracts library for run time
type checking based on Racket's contract library.[1] However, it relied on
some hackery to interact well with the TestCoverage class, since both the
contract and the TestCoverage wanted to replace the method during the run
of a test. However, since it seems in Pharo 8 the TestCoverage class is no
longer present, this seems like a good time to re-evaluate the project
before I go in to see what needs to be patched up. I therefore have three
questions:

1) Are there now any existing libraries for dynamic contracts that I should
use instead of patching my old library?

2) Is MetaLinks the preferred way to intercept messages, and if so can
someone point me to the repo (I can't seem to find it on Github)?

3) If 2, does MetaLinks play well with whatever is the current TestCoverage
alternative that I assume still does some form of message interception,
e.g. will the test coverage function still work properly on a MetaLink'ed
message, or will that require further hackery (I discovered MetaLinks after
the first version, so I used the more basic message replacement apis)?

Thank you,
Evan


[1] https://docs.racket-lang.org/reference/contracts.html