Skip to content

^^= is not implemented #23238

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

Closed
pjcj opened this issue May 1, 2025 · 3 comments · Fixed by #23242
Closed

^^= is not implemented #23238

pjcj opened this issue May 1, 2025 · 3 comments · Fixed by #23242
Assignees

Comments

@pjcj
Copy link
Contributor

pjcj commented May 1, 2025

This is a bug report for perl from [email protected],
generated with the help of perlbug 1.43 running under perl 5.40.2.


Description

We now have the high-precedence xor operator ^^

For a long time we have had the ^ operator.

We have ^= but we do not have ^^= and this appears to be an oversight.

Steps to Reproduce

$ perl5.40.2 -e '$x = 1; $x ^^= 2'
syntax error at -e line 1, near "^^="
Execution of -e aborted due to compilation errors.

Expected behavior

The operator should be implemented.


Flags

  • category=core
  • severity=low

Perl configuration

Site configuration information for perl 5.40.2:

Configured by root at Mon Apr 14 15:48:30 CEST 2025.

Summary of my perl5 (revision 5 version 40 subversion 2) configuration:
   
  Platform:
    osname=darwin
    osvers=24.4.0
    archname=darwin-2level
    uname='darwin mbp3.pjcj.net 24.4.0 darwin kernel version 24.4.0: wed mar 19 21:17:37 pdt 2025; root:xnu-11417.101.15~1release_arm64_t6031 arm64 arm darwin '
    config_args='-Dprefix=/Users/pjcj/.plenv/versions/dc-dev -de -Dversiononly -Dusedevel -Dman1dir=none -Dman3dir=none -A'eval:scriptdir=/Users/pjcj/.plenv/versions/dc-dev/bin''
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='cc'
    ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=15.4 -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong'
    optimize='-O3'
    cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=15.4 -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong'
    ccversion=''
    gccversion='Apple LLVM 17.0.0 (clang-1700.0.13.3)'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=8
    longdblkind=0
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -mmacosx-version-min=15.4 -fstack-protector-strong'
    libpth=/Library/Developer/CommandLineTools/usr/lib/clang/17/lib /Library/Developer/CommandLineTools/SDKs/MacOSX15.4.sdk/usr/lib /Library/Developer/CommandLineTools/usr/lib /usr/lib
    libs= 
    perllibs=
    libc=
    so=dylib
    useshrplib=false
    libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=bundle
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags=' -mmacosx-version-min=15.4 -bundle -undefined dynamic_lookup -fstack-protector-strong'


---
@INC for perl 5.40.2:
    /Users/pjcj/.plenv/versions/dc-dev/lib/perl5/site_perl/5.40.2/darwin-2level
    /Users/pjcj/.plenv/versions/dc-dev/lib/perl5/site_perl/5.40.2
    /Users/pjcj/.plenv/versions/dc-dev/lib/perl5/5.40.2/darwin-2level
    /Users/pjcj/.plenv/versions/dc-dev/lib/perl5/5.40.2

---
Environment for perl 5.40.2:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/pjcj
    LANG=en_US.UTF-8
    LANGUAGE=en_US.UTF-8
    LC_ALL=en_US.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=
    PERLBREW_ROOT=/Users/pjcj/perl5/perlbrew
    PERL_BADLANG (unset)
    SHELL=/opt/homebrew/bin/zsh
@leonerd leonerd self-assigned this May 1, 2025
@leonerd
Copy link
Contributor

leonerd commented May 1, 2025

Yeah, oops. Seems I forgot to consider this case when implementing the rest of it.

A bit late to think about it for 5.42 now but I'll work on a fix for 5.43.x

@pjcj
Copy link
Contributor Author

pjcj commented May 1, 2025

To be fair, it's not documented to work:

  Assignment Operators
    "=" is the ordinary assignment operator.

    Assignment operators work as in C. That is,

        $x += 2;

    is equivalent to

        $x = $x + 2;

    although without duplicating any side effects that dereferencing the
    lvalue might trigger, such as from tie(). Other assignment operators
    work similarly. The following are recognized:

        **=    +=    *=    &=    &.=    <<=    &&=
               -=    /=    |=    |.=    >>=    ||=
               .=    %=    ^=    ^.=           //=
                     x=

So we'll want to update the docs along with the implementation.

@ap
Copy link
Contributor

ap commented May 1, 2025

@leonerd Please produce a patch ASAP; on that basis we may decide to give it a shot with the smokers and then possibly ship it this cycle. If we see any smoke at all we’re not going to, or depending on the patch for whatever other reason maybe not either; but without a patch we have nothing to assess.

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 a pull request may close this issue.

4 participants