Hi,

my current shot is to subclass IdentityDictionary with NildentityDictionary. The class checks on indexed access whether the key is nil. If so, storing/retrival uses a singleton Object as key (stored in instance variable NIL := Object new). I needed to override at least:

  >>at:ifAbsent:
  >>associationsAt:ifAbsent:
  >>at:put:
  >>findElementLike:ifAbsent:
  >>initialize
  class>>new
  class>>new:

It works for PP2 (without serious performance impact so far), although the class is yet incomplete wrt. Collection/Dictionary protocol.

Currently, all but the Morphic-related tests are green. \o/ After some cleanup of the bundles, I'll publish an inital version to the Public Store.

@James: If you like, I we could discuss our ports later to double-check an making the future process easier. How about that?
@Jan: I'd be happy to hear your thoughts on the porting matter.

Best, Steffen



Am .10.2018, 16:06 Uhr, schrieb James Foster <smallt...@jgfoster.net>:

We will have the same issue porting PP2 to GemStone and look forward to suggestions.

On Oct 22, 2018, at 4:40 AM, Steffen Märcker <merk...@web.de> wrote:

Hi Jan,

I am trying to port PP2 to VW and managed to get most of the tests green. =) Some of the remaining test failures occur in

PP2DebuggingStrategy>>cacheIfNeeded:debugResult:

where a result of nil is to be stored in an IdentityDictionary. But in VW Dictionaries do not accept nil as a key. If this is indeed intended, I wonder how to circumvent the limitation best. Would it be feasible to use a placeholder object instead of nil (which code would be effected)? Or would it be better to not cache nil at all?

I'd be happy to hear your thoughts.

Best, Steffen





Am .10.2018, 20:58 Uhr, schrieb Jan Kurš <kurs....@gmail.com>:

I run PP2 on travis [1], seems Pharo 6.1 loads all configurations, both on linux and mac. Pharo 5, Pharo 6.0 got broken, why is build configuration so hard :'( I don't know, how can I support you. I myself had to gave up on
some tools, because I failed to load them.

There is no specific reason to use SmallInteger maxVal... and nobody ever
thought it might be too little. 'PP2 min: X' fails if there are less
repetitions that X. 'PP2 max: X' parses at most X repetitions.

($a asPParser min: 2 max: 3) parse: 'a'. -> Failure
($a asPParser min: 2 max: 3) parse: 'aa'.  #($a $a)
($a asPParser min: 2 max: 3) parse: 'aaa'. #($a $a $a)
($a asPParser min: 2 max: 3) parse: 'aaaa'. #($a $a $a)


Use $- asPParser for characters, e.g:
$- asPParser parse: '-'

[1]: https://travis-ci.org/kursjan/petitparser2/builds/438358467

On Thu, Oct 11, 2018 at 8:13 PM Steffen Märcker <merk...@web.de> wrote:

Reading the code of PetitParser, I wonder why PPRepeatingParser
initializes 'max' with SmallInteger maxVal instead of some notion of
infinity, like Float infinity (and PP2RepeatingNode as well). If I
understand the code correctly, PParser>>min: fails if the number of
repetitions exceeds SmallInteger maxVal, doesn't it?

Best, Steffen


Am .10.2018, 17:10 Uhr, schrieb Steffen Märcker <merk...@web.de>:

> I am using MacOS 10.13.6 and the 32bit VM:
>
> Pharo 6.0
> Latest update: #60546
>
> ... the String in about is wrong, it should be 6.1. I installed it via > the launcher as "Official Distribution: Pharo 6.1 - 32Bit (stable)" I > just noticed, that the sources file is missing from vms/private/6521/,
> too.
>
> Am .10.2018, 17:02 Uhr, schrieb Sean P. DeNigris <s...@clipperadams.com
>:
>
>> Steffen Märcker wrote
>>> I did the following:
>>> 1)  Download and start Pharo 6.1 stable via the launcher.
>>> 2b) Attempt to install PP2 via the scripts from GitHub:
>>>      Metacello new
>>>          baseline: 'PetitParser2';
>>>          repository: 'github://kursjan/petitparser2';
>>>          load.
>>>      Metacello new
>>>          baseline: 'PetitParser2Gui';
>>>          repository: 'github://kursjan/petitparser2';
>>>          load.
>>
>> This way worked for me in Pharo #60546 (check in
World->System->About).
>> What
>> exact Pharo version/OS are you on? 32 or 64-bit
>>
>>
>>
>> -----
>> Cheers,
>> Sean
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>
>





Reply via email to