Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

new compile-time typeof operator #122

Open
rurban opened this issue Mar 30, 2016 · 6 comments
Open

new compile-time typeof operator #122

rurban opened this issue Mar 30, 2016 · 6 comments

Comments

@rurban
Copy link
Member

rurban commented Mar 30, 2016

returns the type(s) at compile-time. which is string or list of strings or a list of type expressions.
currently the string comes from the stash name, but in the future a type can also be an object (as in perl6), not a stash. the return value of typeof must be parsable as valid type declaration. so it should honor list context to listify | alternations.

similar to ref, which returns one run-time string, the current type. (but even if the value contains multiple types, only one is returned with ref).
but typeof gets the type from the OP*, not the attached SV*.

@vendethiel
Copy link
Contributor

can it be indexed again i.e. in a variable declaration?

@rurban
Copy link
Member Author

rurban commented Mar 30, 2016

@vendethiel can you reformulate your question?

@vendethiel
Copy link
Contributor

can you use typeof as the type of a variable?

@rurban
Copy link
Member Author

rurban commented Mar 31, 2016

Sure, that's the idea when using it with eval.

Note that you cannot do that with ref, but ref is only for introspection and was
not really carefully planned

On Mar 30, 2016 16:39, "ven" [email protected] wrote:

can you use typeof as the type of a variable?

@vendethiel
Copy link
Contributor

this ticket was wrongly closed

@rurban rurban reopened this Dec 3, 2017
@rurban
Copy link
Member Author

rurban commented Dec 3, 2017

Oops, thanks. I really should add support for functions also.

rurban added a commit that referenced this issue Oct 16, 2018
fixed some -Wsign-compare
See L<https://metacpan.org/changes/distribution/Encode>

Skip the flapping test F<t/Aliases.t> on threaded smokers, with random
segfaults.  This is a long standing core bug, with PMOP aliases or
clone. First observed at L<rurban/perl-compiler#73>
(since 5.6)

Stop directory tweaking C<$Encode::Encoding{utf8}>

Fix gcc warnings for older gcc < 4.0

Where possible do not depend on value of $@, instead use return value
of eval

Fix more XS problems in Encode.xs file

Load modules Encode::MIME::Name and Storable normally

Remove no warnings redefine; and correctly loaddependences

Remove PP stubs and reformat predefine_encodings()

Run Encode XS BOOT code at compile time

Use Encode::define_encoding and propagate carp/croak message

cperl fixes: encoding undeprecated, no strict hashpairs

Cleanup code for handling fallback/replacement characters

lib/Encode/MIME/Name.pm t/mime-name.t
Pulled: Add "euc-cn" => "EUC-CN" alias to Encode::MIME::Name
dankogai/p5-encode#124

lib/Encode/CN/HZ.pm lib/Encode/JP/JIS7.pm lib/Encode/MIME/Header.pm
t/decode.t
Pulled: Uninitialized value fixes #122
dankogai/p5-encode#122

Makefile.PL
Pulled: Fix -Werror=declaration-after-statement for gcc 4.1.2
dankogai/p5-encode#121

Fixed deep recursion in Encode::find_encoding when decoding.
rurban added a commit that referenced this issue Feb 15, 2019
Silence Gconvert -Wunused-result.

Add unblessed_bool property (PR #118 by Pali)

Add seperate allow_dupkeys property, in relaxed (#122),
Fixed allow_dupkeys for the XS slow path,
Silence 2 -Wunused-value warnings,
Fix ->unblessed_bool to produce modifiable perl structures (PR #121 by Pali).
rurban added a commit that referenced this issue Feb 15, 2019
Silence Gconvert -Wunused-result.

Add unblessed_bool property (PR #118 by Pali)

Add seperate allow_dupkeys property, in relaxed (#122),
Fixed allow_dupkeys for the XS slow path,
Silence 2 -Wunused-value warnings,
Fix ->unblessed_bool to produce modifiable perl structures (PR #121 by Pali).
rurban added a commit that referenced this issue Feb 17, 2019
Silence Gconvert -Wunused-result.

Add unblessed_bool property (PR #118 by Pali)

Add seperate allow_dupkeys property, in relaxed (#122),
Fixed allow_dupkeys for the XS slow path,
Silence 2 -Wunused-value warnings,
Fix ->unblessed_bool to produce modifiable perl structures (PR #121 by Pali).
rurban added a commit that referenced this issue Feb 28, 2019
Silence Gconvert -Wunused-result.

Add unblessed_bool property (PR #118 by Pali)

Add seperate allow_dupkeys property, in relaxed (#122),
Fixed allow_dupkeys for the XS slow path,
Silence 2 -Wunused-value warnings,
Fix ->unblessed_bool to produce modifiable perl structures (PR #121 by Pali).
rurban added a commit that referenced this issue Mar 1, 2019
Silence Gconvert -Wunused-result.

Add unblessed_bool property (PR #118 by Pali)

Add seperate allow_dupkeys property, in relaxed (#122),
Fixed allow_dupkeys for the XS slow path,
Silence 2 -Wunused-value warnings,
Fix ->unblessed_bool to produce modifiable perl structures (PR #121 by Pali).
rurban added a commit that referenced this issue Mar 1, 2019
Silence Gconvert -Wunused-result.

Add unblessed_bool property (PR #118 by Pali)

Add seperate allow_dupkeys property, in relaxed (#122),
Fixed allow_dupkeys for the XS slow path,
Silence 2 -Wunused-value warnings,
Fix ->unblessed_bool to produce modifiable perl structures (PR #121 by Pali).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants