sociomantic-tsunami / tangort

Tango D1 runtime library
Other
0 stars 9 forks source link

Provide `core.exception.onRangeError` #27

Closed mihails-strasuns-sociomantic closed 6 years ago

mihails-strasuns-sociomantic commented 6 years ago

See https://github.com/sociomantic-tsunami/dmqnode/pull/5/commits/47a179a052116a19719db399e924ceef050adbdd

mihails-strasuns-sociomantic commented 6 years ago

Code attached

nemanja-boric-sociomantic commented 6 years ago

LGTM. @leandro-lucarella-sociomantic ?

leandro-lucarella-sociomantic commented 6 years ago

I still don't get why is this needed.

Burgos commented 6 years ago

User's code for the array performs the array bounds checking and calls this callback if the invalid access has been performed: https://github.com/sociomantic-tsunami/dmqnode/blob/47a179a052116a19719db399e924ceef050adbdd/src/dmqnode/storage/engine/overflow/file/DataFile.d#L454

However, D2 doesn't have onArrayBoundsError, but onRangeError, so it makes user fix this anomaly in their code, while our intention was always to make switches of the runtime libraries as painless as possible:

https://github.com/sociomantic-tsunami/dmqnode/blob/47a179a052116a19719db399e924ceef050adbdd/src/dmqnode/storage/engine/overflow/file/DataFile.d#L359-L365

mihails-strasuns-sociomantic commented 6 years ago

Which format? We don't have relmotes folder in tangort right now :angel:

leandro-lucarella-sociomantic commented 6 years ago

I added one in my PR, I don't see a reason not to use neptune with tangort. :)

mihails-strasuns-sociomantic commented 6 years ago

Updated