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

Mejoras al manejo de void (y algo de nulls), especialmente para bloques #218

Merged
merged 8 commits into from
Nov 11, 2024

Conversation

fdodino
Copy link
Contributor

@fdodino fdodino commented Oct 27, 2024

Tomando el trabajo de @nmigueles para uqbar-project/wollok-ts#208 , traje de wollok-ts-cli el método que sanitiza un stack trace para de paso resolver

  1. [Pedido] Collection#map debería lanzar un error si el bloque no retorna un valor #226
  2. Errores poco descriptivos en envios de mensajes con valores nullish wollok-ts#268

Una de las cosas que hice fue revisar de paso todos los usos de closures en Set, List, Collection, Range y Dictionary. En general revisé

  • map
  • flatMap
  • sum
  • max
  • maxIfEmpty
  • min
  • minIfEmpty
  • all
  • any
  • find
  • count
  • sum
  • filter

de las implementaciones en Wollok, más otros métodos implementados en TS.

En Range acomodé la implementación de asList que me asegura que todos los métodos de esta clase deleguen en List (así comparten las mismas validaciones).

  1. Agregué también sanity tests para especificar el contrato de lo que nosotros creemos que debería tirar error para implementaciones futuras, incluyendo algunas validaciones que incorporé en TS (como parámetros "void" o "null" que faltaban chequear).

  2. Como en el recorrido del PR surgió la idea de no permitir el uso del wko void, agregué un mensaje para el validador y 3 archivos que chequean que no uses void en un programa, archivo de test o wlk.

@fdodino fdodino marked this pull request as ready for review October 27, 2024 05:27
@fdodino fdodino requested review from PalumboN and ivojawer October 27, 2024 05:27
@fdodino fdodino marked this pull request as draft October 27, 2024 12:55
@fdodino fdodino marked this pull request as ready for review October 28, 2024 02:24
@fdodino fdodino marked this pull request as draft October 29, 2024 00:54
@fdodino fdodino marked this pull request as ready for review October 29, 2024 01:47
@fdodino fdodino changed the title Fix issue 274 in wollok-ts Mejoras al manejo de void (y algo de nulls), especialmente para bloques Oct 29, 2024
@fdodino
Copy link
Contributor Author

fdodino commented Oct 29, 2024

Listo el pollo, final final versión posta postín!

Copy link
Contributor

@PalumboN PalumboN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GROSSOOOO! 👍 💯 🚦

@fdodino
Copy link
Contributor Author

fdodino commented Nov 5, 2024

@ivojawer , @PalumboN si quieren pueden pegarle una mirada en estos días, ya está lista la parte de language

Copy link
Contributor

@PalumboN PalumboN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo joya! 💎

Me quedé pensando si no podemos evitar tener definido el objeto void en lang y que lo maneje internamente la VM (como se hace con null).

Comment on lines -413 to +425
const valueFound = numbers.findOrElse({ elem => elem > 100 }, { encontro = false })
numbers.findOrElse({ elem => elem > 100 }, { encontro = false })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sí, dale, se puede hacer en un próximo PR

@fdodino fdodino merged commit f09e1a8 into master Nov 11, 2024
@fdodino fdodino deleted the error-handling branch November 11, 2024 23:21
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 this pull request may close these issues.

2 participants