[Pharo-dev] FullBlockClosure - How to create one...

2020-04-30 Thread Sean P. DeNigris
What am I not understanding about FullBlockClosure?

I have a clean block that I'd like to turn into a FullBlockClosure so that I
can serialize it without dragging (unneeded methods) into my object graph.
However, documentation and in-image example usages seem severely limited.
Here was one experiment that ended with a primitive failure. It seems like a
receiver is needed and it can't be a dummy value (see commented "receiver:
1"). But what would the receiver be in the absence of an outer context?!

aBlockClosure := [ :a :b  | 1 + a + b ].
fbc := (FullBlockClosure
outerContext: nil
startpc: aBlockClosure startpc
numArgs: aBlockClosure argumentCount
copiedValues: Array new) "receiver: 1; yourself".

fbc value: 2 value: 3. "PrimitiveFailed: primitive #value:value: in
FullBlockClosure failed"



-
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html



Re: [Pharo-dev] FullBlockClosure - How to create one...

2020-04-30 Thread Max Leske
Hi Sean,

You *need* an outer context. See Context>>cleanCopy, which Fuel uses to 
serialize blocks.


Cheers,
Max

On 1 May 2020, at 3:23, Sean P. DeNigris wrote:

> What am I not understanding about FullBlockClosure?
>
> I have a clean block that I'd like to turn into a FullBlockClosure so that I
> can serialize it without dragging (unneeded methods) into my object graph.
> However, documentation and in-image example usages seem severely limited.
> Here was one experiment that ended with a primitive failure. It seems like a
> receiver is needed and it can't be a dummy value (see commented "receiver:
> 1"). But what would the receiver be in the absence of an outer context?!
>
> aBlockClosure := [ :a :b  | 1 + a + b ].
> fbc := (FullBlockClosure
>   outerContext: nil
>   startpc: aBlockClosure startpc
>   numArgs: aBlockClosure argumentCount
>   copiedValues: Array new) "receiver: 1; yourself".
>
> fbc value: 2 value: 3. "PrimitiveFailed: primitive #value:value: in
> FullBlockClosure failed"
>
>
>
> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html


signature.asc
Description: OpenPGP digital signature


[Pharo-dev] [Pharo 9.0] Build #274: Removing classes from ChangeSorter throws DNU

2020-04-30 Thread ci-pharo-ci-jenkins2
There is a new Pharo build available!
  
The status of the build #274 was: FAILURE.

The Pull Request #6261 was integrated: "Removing classes from ChangeSorter 
throws DNU"
Pull request url: https://github.com/pharo-project/pharo/pull/6261

Issue Url: https://github.com/pharo-project/pharo/issues/6260
Build Url: 
https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/Pharo9.0/274/


[Pharo-dev] [Pharo 9.0] Build #271: Fix typo

2020-04-30 Thread ci-pharo-ci-jenkins2
There is a new Pharo build available!
  
The status of the build #271 was: FAILURE.

The Pull Request #6257 was integrated: "Fix typo"
Pull request url: https://github.com/pharo-project/pharo/pull/6257

Issue Url: https://github.com/pharo-project/pharo/issues/6243
Build Url: 
https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/Pharo9.0/271/


[Pharo-dev] [Pharo 9.0] Build #273: Lint cleanup #isZipArchive:

2020-04-30 Thread ci-pharo-ci-jenkins2
There is a new Pharo build available!
  
The status of the build #273 was: FAILURE.

The Pull Request #6263 was integrated: "Lint cleanup #isZipArchive:"
Pull request url: https://github.com/pharo-project/pharo/pull/6263

Issue Url: https://github.com/pharo-project/pharo/issues/6262
Build Url: 
https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/Pharo9.0/273/


[Pharo-dev] [Pharo 9.0] Build #272: Cleanup InspectDebuggerDebugAction

2020-04-30 Thread ci-pharo-ci-jenkins2
There is a new Pharo build available!
  
The status of the build #272 was: FAILURE.

The Pull Request #6265 was integrated: "Cleanup InspectDebuggerDebugAction"
Pull request url: https://github.com/pharo-project/pharo/pull/6265

Issue Url: https://github.com/pharo-project/pharo/issues/6264
Build Url: 
https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/Pharo9.0/272/