Liste des Groupes | Revenir à c arch |
George Neuner <gneuner2@comcast.net> writes:
>On Mon, 6 Jan 2025 20:10:13 +0000, mitchalsup@aol.com (MitchAlsup1)>
wrote:
>I looked high and low for codes using more than 8 arguments and>
returning aggregates larger than 8 double words, and about the
only things I found were a handful of []print[]() calls.
Large numbers of parameters may be generated either by closure
conversion or by lambda lifting. These are FP language
transformations that are analogous to, but potentially more complex
than, the rewriting of object methods and their call sites to pass the
current object in an OO language.
>
[The difference between closure conversion and lambda lifting is the
scope of the tranformation: conversion limits code transformations to
within the defining call chain, whereas lifting pulls the closure to
top level making it (at least potentially) globally available.]
>
In either case the original function is rewritten such that non-local
variables can be passed as parameters. The function's code must be
altered to access the non-locals - either directly as explicit
individual parameters, or by indexing from a pointer to an environment
data structure.
>
While in a simple case this could look exactly like the OO method
transformation, recall that a general closure may require access to
non-local variables spread through multiple environments. Even if
whole environments are passed via single pointers, there still may
need to be multiple parameters added.
Isn't it the case that access to all of the enclosing environments
can be provided by passing a single pointer? I'm pretty sure it
is.
Les messages affichés proviennent d'usenet.