Skip to content

Conversation

@jishnub
Copy link
Member

@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 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
@aviatesk aviatesk deleted the jishnub/category_code_foldable branch May 8, 2024 04:10
@oscardssmith oscardssmith removed the 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
```
lazarusA pushed a commit to lazarusA/julia that referenced this pull request Jul 12, 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.

6 participants