How about "once" In objective-c, the singleton pattern revolves around the dispatch_once function.
> On Jul 13, 2016, at 3:46 PM, Brad Chamberlain <[email protected]> wrote: > > > Hi Chapel Users and Developers -- > > In recent months, we've been talking about adding support for > function-local "static" variables in the C sense: ones that are allocated > and initialized once, and whose values are retained across multiple calls > to the function. However, we're not crazy about using the keyword > 'static', so are soliciting alternatives from the community. > > In more detail (and using 'static' as a placeholder keyword for now): > > Variables like the following... > > proc foo() { > static var x = 1, > var A: [1..100] real; > > ...x... > ...A[i]... > } > > could be considered to be equivalent to: > > private var chpl_foo_x = 1, > chpl_foo_A: [1..100] real; > > proc foo() { > ...chpl_foo_x... > ...chpl_foo_A[i]... > } > > where no procedures other than foo() would have any means of referring to > 'chpl_foo_x' or 'chpl_foo_A'. > > The historical opposition to using 'static' for this purpose is that it's > too compiler-/CS-centric and not particularly intuitive to computational > scientists (particularly those who don't come from a C background). > OTOH, C is not the worst precedent to follow. In any case, it seemed > worthwhile to poll the community for alternative suggestions and opinions. > > Please send any proposed keywords to me, optionally with a short > rationale. In a few days, I'll send out a summary of responses received > (including our own brainstorming, which I don't want to influence you with > at the outset). > > Thanks! > -Brad > > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity planning > reports.http://sdm.link/zohodev2dev > _______________________________________________ > Chapel-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/chapel-developers ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev _______________________________________________ Chapel-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/chapel-users
