Skip to content
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

Unicode: assume foldable ccall in category_code #54394

Merged
merged 1 commit into from
May 8, 2024

Conversation

jishnub
Copy link
Contributor

@jishnub jishnub commented May 7, 2024

Following on from #54346, this marks the ccall in category_code as foldable. This lets us compute the results of several functions at compile time, such as:

julia> @code_typed (() -> isletter('C'))()
CodeInfo(
1return true
) => Bool

julia> @code_typed (() -> isnumeric('C'))()
CodeInfo(
1return false
) => Bool

julia> @code_typed (() -> ispunct('C'))()
CodeInfo(
1return false
) => Bool

@jishnub jishnub added the compiler:effects effect analysis label May 7, 2024
@topolarity topolarity added the status:merge me PR is reviewed. Merge when all tests are passing label May 8, 2024
@aviatesk aviatesk merged commit 999dde7 into master May 8, 2024
10 checks passed
@aviatesk aviatesk deleted the jishnub/category_code_foldable branch May 8, 2024 04:10
@oscardssmith oscardssmith removed the status:merge me PR is reviewed. Merge when all tests are passing label May 8, 2024
xlxs4 pushed a commit to xlxs4/julia that referenced this pull request May 9, 2024
Following on from JuliaLang#54346, this
marks the `ccall` in `category_code` as foldable. This lets us compute
the results of several functions at compile time, such as:
```julia
julia> @code_typed (() -> isletter('C'))()
CodeInfo(
1 ─     return true
) => Bool

julia> @code_typed (() -> isnumeric('C'))()
CodeInfo(
1 ─     return false
) => Bool

julia> @code_typed (() -> ispunct('C'))()
CodeInfo(
1 ─     return false
) => Bool
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:effects effect analysis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants