Skip to content

Docs: Add Range.size, update exavmlib deps #1505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: release-0.6
Choose a base branch
from

Conversation

petermm
Copy link
Contributor

@petermm petermm commented Feb 1, 2025

And a small fix to Base.ex adding @compile {:autoload, false}.

This enables running mix docs on exavmlib.
mix docs --version 0.6.5

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

@petermm petermm changed the title Add Range.size, update exavmlib deps Docs: Add Range.size, update exavmlib deps Feb 1, 2025
Copy link
Collaborator

@UncleGrumpy UncleGrumpy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me. This gets us one step closer to using ex_doc to create the documentation, and not be constrained to building documentation with OTP-26.0.2 or prior versions.

@petermm
Copy link
Contributor Author

petermm commented Feb 5, 2025

turns out Range.size was only added elixir 1.12 - so blocked for now:/

@petermm petermm marked this pull request as draft February 5, 2025 18:21
@UncleGrumpy
Copy link
Collaborator

UncleGrumpy commented Feb 5, 2025

Maybe it can be conditionally included, we don't have Version.match? or we could do something similar to what is done here:

https://github.com/elixir-cldr/cldr_utils/blob/44a530f17c3a7265339c3104304f0abfb2eb4687/lib/cldr/decimal/decimal.ex#L24

but maybe there is another clever way to check if the Elixir version is high enough for it to be included.

Also for reference:
https://elixirforum.com/t/how-to-assign-a-function-to-a-specific-version-of-elixir/42113

And a small fix to Base.ex adding @compile {:autoload, false}.

This enables running mix docs on exexavmlib.
mix docs --version 0.6.5

Signed-off-by: Peter M <[email protected]>
@petermm
Copy link
Contributor Author

petermm commented Feb 5, 2025

Thanks for the pointers, added if Version.match?(System.version(), "~> 1.12") do - and the CI seems happy..

I don't like having to do this - but I like future ex_doc support - hmm.

@UncleGrumpy
Copy link
Collaborator

I can see it leading to some confusion, since the function will appear in the documentation, but won't be available on VMs complied with an older version of Elixir. We should keep the @since pointing at the AtomVM version, but maybe in the doc text it should mention the minimum Elixir version that is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants