[erlang-questions] [ANN] otp_vsn 1.0.0 - ?OTP_VSN

Loïc Hoguin essen@REDACTED
Fri Apr 20 16:32:06 CEST 2018


The problem with *_AND_BELOW is not that it's inclusive of the OTP 
version. It's that it only contains said OTP version. There's no 
-define(OTP_19_AND_BELOW, 1) for OTP-18 for example.

On 04/20/2018 04:29 PM, Pierre Fenoll wrote:
> @Marc Worrell
> Thanks for the kind words! The end goal is exactly that and I am working 
> on defining the expected macros in a way that makes sense.
> Any input appreciated, notable edge cases, ...
> 
> @Loïc Hoguin
> Thanks for taking a look! So I think I have pushed a v1 too early: 
> *_AND_ABOVE and *_AND_BELOW are both inclusive of the current OTP version.
> I'm thinking of dropping the *_AND_BELOW and using a common macro prefix 
> anyway... It's already time for a v2!
> 
> 
> 
> Cheers,
> -- 
> Pierre Fenoll
> 
> 
> On 20 April 2018 at 13:08, Marc Worrell <marc@REDACTED 
> <mailto:marc@REDACTED>> wrote:
> 
> 
>     > On 20 Apr 2018, at 12:51, Pierre Fenoll <pierrefenoll@REDACTED <mailto:pierrefenoll@REDACTED>> wrote:
>     > 
>     > I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases.
>     > 
>     > For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE).
> 
>     Nice work, I especially like that it is only a header file.
> 
>     I have an idea, might be somethiing to add.
>     Instead of relying on the OTP version for some features.
>     Maybe add a macro like ‘OTP_SUPPORT_MAPS’ ?
> 
>     Another we often define is for the changes in the dict() type, which
>     became dict:dict() at some point.
> 
>     In our rebar files we currently have definitions for this kind of
>     defines.
>     Would be very convenient to have those at a more central place, and
>     one that is consistent between projects.
> 
>     Thank you for your library!
> 
>     Marc Worrell
> 
> 
> 
> 
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
> 

-- 
Loïc Hoguin
https://ninenines.eu



More information about the erlang-questions mailing list