nx::next(3nx)
π nx::next β from the NX API, bestie π
okay so you're deep in the NX API (that's the 3nx manual section, iykyk) and you found nx::next. pop off. let's get you fluent. β¨
β¨ NAME β¨
nx::next β skip to the next most specific method implementation π«Ά
πΈ SYNOPSIS πΈ
next ?arguments?
π¦ DESCRIPTION π¦
π
next ?arguments?
so this one you call inside a method body, and what it does is call the next most specific method implementation in the list of available methods. and that list? it's specific to your current method-call context β like, it's not a global thing, it's this call's thing. π
that context gets set by the usage context of nx::next, which is either method combination or method-call interception (more on both below, don't worry).
the optional arguments are the argument values you're passing into the next most specific method implementation. and here's the tea:
- if you omit them, the arguments of the current method call get automatically forwarded. free delivery, no cap. π
- if you want to call the next most specific method implementation without arguments (or you just want to suppress that argument forwarding), you have to set
argumentsto an empty string. - and if you actually need to pass an empty string as a single argument value, protect it as a list. (yes really, otherwise it reads as "no arguments please" and you'll be so confused. π)
the result of a call to nx::next is the result of the next most specific method implementation. simple. iconic.
but β plot twist β if there are no more further applicable methods, what nx::next returns depends on its usage context:
- π§΅ if
nx::nextis used in a method body for method combination, the result will be an empty string. - π¨ if
nx::nextis used in the body of a filter method for method-call interception, the result will be an error.
lowkey remember this one, bestie. same command, two totally different "there's nothing left" outcomes, depending on where you are. π
π how the list actually gets built
when you execute a method call, the NX dispatch mechanism computes a list of applicable method implementations for the method name requested from a given object receiving the call. it does this in support of method combination and method-call interception. main character energy fr fr.
For method combination, the computed list contains:
- any object-local method implementation, and
- any method implementations the object inherited from the classes in its precedence list.
examples of that second bucket: overloading method implementations in the class hierarchy of the object, plus ones from mixin classes of the object. β
For method-call interception, the computed list contains the applicable filter methods β again ordered by their definition order according to the precedence list of the called object. π
π§ one more thing
to retrieve the next most specific method implementation to be invoked by nx::current from the internally computed list, if any, use nx::current. β¨
π COPYRIGHT π
Copyright (c) 2014-16 Stefan Sobernig <stefan.sobernig@wu.ac.at>, Gustaf Neumann <gustaf.neumann@wu.ac.at>
and that's the whole page, bestie!! version 2.4.0 of the NX API (nx::next(3nx)), go forth and call next responsibly. mwah. πππ¦β¨
π¦ where this page comes from
- debian trixie: nsf 2.4.0-1 Β· MIT
- ubuntu questing: nsf 2.4.0-1
- ubuntu resolute: nsf 2.4.0-1build1 Β· MIT
- ubuntu stonking: nsf 2.4.0-1build1 Β· MIT
- Copyright (c) 2014-16 Stefan Sobernig <stefan\&.sobernig@wu\&.ac\&.at>, Gustaf Neumann <gustaf\&.neumann@wu\&.ac\&.at>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms