[PPC0021] - more clarification for the short circuit behavior

Abierto
#63 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
perl
Área
compilers

Línea de trabajo

Start with the Perl expression in the issue and compare its proposed behavior with the short-circuit behavior of an equivalent chain. Resolve whether the final slice is skipped when $possibly_undef is undef, then document the agreed semantics clearly in the PPC proposal. No implementation file or test is named, so the scope must be established before coding.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Given the following code

@{ $possibly_undef?->[0] }[0..10]

What should happen if $possibly_undef is undef? had it been a chain, then it's obvious that the final slice operation would be skipped. Do we want this behavior also in the event that an equivalent expression has been made that just so happens to not be in a "chain"?

I vote yes, b/c the logic for skipping deeper parts of the chain (ostensibly) is "given that i'm trying to fetch some value deep inside this thingy, all fetching of values will be obviously undef, so let's just return undef now". That would apply to this use case also.

I'll happily submit a PR including this as a more peculiar case once i get the feeling that this I am correct that this behavior is correct

Lenguaje dominante
Perl
Estrellas
81
Forks
28
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Perl/PPCs

Todos los issues de Perl/PPCs

Issues similares

Más issues de Perl

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.