Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Partial Operator Precedence

The language Zig has recently implemented partial operator precedence, effective as of February 8, 2016. Prior to this change, certain combinations of operators lacked a defined precedence, leading the compiler to require parentheses for clarification. However, common cases remain parenthesis-free. This new rule aims to reduce the number of rules programmers need to remember, as the evaluation order of expressions should be clear without needing to reference precedence rules.

For instance, the expression `a orelse b() catch c` would previously be interpreted as `(a orelse b()) catch c`. With the new rule, it would become `a orelse (b() catch c)`, which may be clearer but less intuitive. Only a small number of lines in the Zig codebase (353 out of millions) required these changes. Going forward, programmers will only need to remember the rules for operator combinations that still have a defined precedence.

For example, the precedence table for arithmetic operators remains unchanged. The updated precedence tables for other operators can be found in the language reference. CMDRZero contributed the implementation, while Isaac Freund provided assistance with grammar changes. Naked packages, which do not include a build manifest, previously had a hash based solely on the URL.

Now, users can provide a version and paths, and the dependency name is also included in the package hash. The --print-tree CLI option for zig build provides an easier-to-read color output and exits before configuration errors.

Rewritten by urgent.news; may contain errors — check the original.

Source: ziglang.org

Read the original at ziglang.org →

Report a problem with this story

More in Tech

New Payment System for Traders Announced

Importers and exporters could soon pay customs duties, taxes and other trade charges through a pre-funded digital wallet, as Pakistan … Read More The post New Payment System for Traders Announced appeared first on ProPakistani .

GJA must make capacity building a Priority from 2027 – Laryea Sowah

By Osei -Tutu Esther Kumah Veteran Journalist and former Executive Secretary for Prinpag, Kenteman Nii Laryea Sowah has called on the Ghana Journalists Association (GJA) to intensify capacity-building programmes for young journalists and online publishers to improve professional and ethical standards in Ghana’s media industry. Mr.

  • GJA urged to prioritize capacity-building for young journalists in 2027
  • Concern over quality of online publications and sentence structure
  • Mentoring encouraged to elevate professional journalism standards

More from Monday 2 November →