火龙果什么时候开花| 98年的属什么| 绿豆芽炒什么好吃| 1997年出生的属什么| 编者按是什么| 总是掉头发是什么原因| 小月子可以吃什么水果| 输卵管堵塞吃什么药能打通| 为什么会突然耳鸣| 包皮炎看什么科| 5月31日是什么星座| 血虚吃什么中成药| 95年什么生肖| 牛和什么属相最配| 一月30号是什么星座| 为什么糙米越吃血糖越高| 颈部淋巴结肿大挂什么科| 粘米粉是什么米做的| 张嘴睡觉有什么危害| 毛囊炎用什么药最有效| 粘鞋子用什么胶水最好| 月子里头疼是什么原因| 眩晕是什么原因引起的| 农历7月28日是什么星座| 什么是中成药| 手为什么会长水泡| 来例假喝什么好| 性格什么意思| 腰椎间盘突出吃什么好| 什么什么不已| 菌群异常是什么意思| 6月29日什么星座| 舌息心念什么| 珊五行属什么| 虾皮不能和什么一起吃| 血钾低会有什么症状| 三三两两是什么生肖| 肾结石有什么症状| 做造影对身体有什么伤害| 农历六月初三是什么星座| 手抖挂什么科室| 扬州瘦马什么意思| 一个牙一个合是什么字| kissme什么意思| 荣耀是什么品牌| 肾综合征是什么病严重吗| 航班是什么意思| 核磁共振是什么| nilm是什么意思| 值神天刑是什么意思| 血液粘稠是什么原因| 丙型肝炎吃什么药最好| 爱吃甜食是缺乏什么| 豌豆淀粉可以做什么| 妈妈的妹妹叫什么| 猕猴桃不能和什么一起吃| 骨密度是查什么的| 瑶字五行属什么| 早起的鸟儿有虫吃是什么意思| 广角是什么| 呼吸内镜检查什么| 磷高有什么症状和危害| 男生被口是什么感觉| 肛肠科属于什么科| 天之骄子是什么意思| 抠鼻表情什么意思| 甲减对胎儿有什么影响| 路演是什么意思| 白细胞十一是什么意思| 营养过剩会导致什么| 金牛女喜欢什么样的男生| 血脂高吃什么食物好| 独具一格是什么意思| 人为什么要工作| positive是什么意思| 畏寒是什么意思| 怀孕后吃避孕药有什么后果| 衣带渐宽终不悔是什么意思| 新农合是什么| 吃什么头发能变黑| 病人出院送什么花| 卫青为什么被灭九族| 什么的身子| 男人喜欢什么礼物| 李知恩为什么叫iu| 脾疼是什么原因| 什么时候排卵| 儿童流鼻涕吃什么药| 什么样的女人不能娶| 兔跟什么生肖配对最好| 杰五行属性是什么| 花白鲢喂养什么长得快| 明矾和白矾有什么区别| 一什么帽子| 钱代表什么生肖| butter是什么意思| mr平扫是什么检查| 蚊子最喜欢什么血型| 五十八岁属什么生肖| 三醋酯纤维是什么面料| chase是什么意思| 逍遥丸的功效和作用是什么| 胃痛吃什么药| 气短吃什么药立马见效| 复合面料是什么面料| 做梦梦见猪是什么意思| 阿玛尼手表算什么档次| 胎儿为什么会喜欢臀位| 耕的左边读什么| 是的什么意思| 金字旁加各念什么| 胎心胎芽是什么意思| 为什么肚子老是胀气| 三叉神经痛吃什么药效果最好| 月经前有褐色分泌物是什么原因| 立是什么意思| 耳闷耳堵是什么原因引起的| 至加秦是什么字| 看望病人送什么东西| 酒精对皮肤有什么伤害| 头疼吃什么药| 肠梗阻吃什么药| 什么汤是清热去火的| 线上考试是什么意思| lancome是什么牌子的| 发飙是什么意思| 盐酸左氧氟沙星片治什么病| 封豕长蛇是什么意思| 间质性肺炎是什么意思| 胎儿畸形是什么原因造成的| 身上长扁平疣是什么原因| 杰克琼斯属于什么档次| 白茶和绿茶有什么区别| 夜尿增多是什么原因| 污蔑是什么意思| 头发少是什么原因| 鸡飞狗跳的意思是什么| 胃息肉吃什么药治疗| 什么病会导致不来月经| 舌头有裂痕是什么原因| 出汗少的人是什么原因| 为什么会得近视眼| 八字桃花是什么意思| 射精是什么感觉| 零和博弈是什么意思| 紫苏叶有什么作用| abs是什么意思| 尕尕是什么意思| 梦见蝉是什么意思| 什么是树脂材料| 先心病是什么病| 玉米蛇吃什么| 白天不咳嗽晚上咳嗽是什么原因| 基友是什么关系| 什么树最值钱| 喝小分子肽有什么好处| 闹乌龙是什么意思| 沙字五行属什么| 寻常疣是什么原因造成的| 上火便秘吃什么最快排便| 坎是什么意思| 梦见和老公结婚是什么意思| 什么是碳水食物有哪些| 妈妈桑是什么意思| 今天冲什么生肖| 银行支行行长什么级别| 痔疮有什么症状表现| 吃什么可以瘦肚子| 白芷泡水喝有什么功效| 羊肚菌是什么| 胆囊壁胆固醇结晶是什么意思| 二氧化碳低是什么原因| 吃什么疏通血管最快| 2岁打什么疫苗| 见路不走是什么意思| 什么前什么后| 开颌是什么意思| 为什么会有鼻屎| 阿司匹林肠溶片什么时候吃最好| 耳鸣吃什么药好| 九月五日是什么节日| 偏头疼是什么原因引起| 兰花用什么土栽培最好| 补钙吃什么食物| 六爻小说讲的什么| 红参有什么作用| 肠胃不好吃什么药| 属狗女和什么属相最配| 孕妇梦到老公出轨什么意思| 羊水少吃什么| 惊为天人是什么意思| 眼科属于什么科| 刘邦为什么要杀张良| 什么肉最好吃| 87属什么生肖| 上传下达什么意思| 妄想症是什么意思| 女人阳虚吃什么药效果最好| 善变是什么意思| 七月份适合种什么蔬菜| 心脏不好吃什么| 痔疮很痒是什么原因| 宗旨是什么意思| 手足是什么意思| n标志的鞋子是什么牌子| 日十组成什么字| 什么是尖锐湿疣| 手麻吃什么药| 肝实质回声欠均匀是什么意思| 什么是甲减病| 中的反义词是什么| 手指甲发紫是什么原因| 猫怕什么声音| 白带异常是什么原因| 什么叫蛋白质| 中性粒细胞高是什么原因| 过敏不能吃什么| 骶髂关节炎吃什么药| 嘴巴里长血泡是什么原因| 睡觉总是做梦是什么原因| 经常想吐恶心是什么原因| 文雅什么意思| 头发变棕色是什么原因| 高反吃什么药| 孩子睡觉出汗多是什么原因| 多吃西瓜有什么好处| 控销药品什么意思| 老子是什么时期的人| 婴儿肥是什么意思| 内膜薄吃什么增长最快| 为什么第一次进不去| 11月1日是什么星座| 什么弓什么箭| 亢进是什么意思| 尿道炎看什么科室好| yw是什么| 金戈铁马是什么生肖| 肺部肿瘤吃什么好| 真菌感染有什么症状| 风疟病是什么意思| 慈悲是什么意思| 桃花什么季节开| 小囊性灶是什么意思| 为什么会心肌梗死| 摆摊卖什么好| 7月14日什么节日| 治痛风吃什么药| 什么是适度水解奶粉| 参保是什么意思| daogrs是什么牌子| 黄精什么人不能吃| 回归线是什么| 胃肠炎可以吃什么水果| 妈妈过生日送什么礼物好| 血压偏低吃什么| 长白头发了吃什么才能把头发变黑| 截根疗法是什么| 湿疹是长什么样的| 7点是什么时辰| 天运子什么修为| 红底白杠是什么标志| 吃什么水果减肥最快减肚子| 白油是什么油| 吃什么提神醒脑抗疲劳| 百度Jump to content

三亚助学活动启动 贫困本科生最高资助八千元

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Fragglet (talk | contribs) at 02:23, 22 May 2025 (C++ proposal). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
百度   用什么样的立场和观点来解读中国共产党领导中国人民进行社会主义建设和改革的历史,解读这两大历史阶段的联系与区别,始终是这一时期中共党史研究和中华人民共和国历史研究的重大问题。

Uniform function call syntax (UFCS) or uniform call syntax (UCS) or sometimes universal function call syntax is a programming language feature in D,[1] Nim,[2] Koka,[3] and Effekt[4] that allows any function to be called using the syntax for method calls (as in object-oriented programming), by using the receiver as the first parameter and the given arguments as the remaining parameters.[5] The same technique is used in the AviSynth scripting language under the name "OOP notation".[6]

UFCS is particularly useful when function calls are chained[1] (behaving similar to pipes, or the various dedicated operators available in functional languages for passing values through a series of expressions). It allows free functions to fill a role similar to extension methods in some other languages. Another benefit of the syntax is related to completion systems in IDEs, which use type information to show a list of available functions, dependent on the context. When the programmer starts with an argument, the set of potentially applicable functions is greatly narrowed down,[7] aiding discoverability.

Examples

[edit]

D programming language

[edit]
int first(int[] arr)
{
    return arr[0];
}

int[] addone(int[] arr)
{
    int[] result;
    foreach (value; arr) {
        result ~= value + 1;
    }
    return result;
}

void main()
{
    auto a = [0, 1, 2, 3];

    // all the following are correct and equivalent
    int b = first(a);
    int c = a.first;

    // chaining
    int[] e = a.addone().addone();
}

Nim programming language

[edit]
type Vector = tuple[x, y: int]

proc add(a, b: Vector): Vector =
  (a.x + b.x, a.y + b.y)

let
  v1 = (x: -1, y: 4)
  v2 = (x: 5, y: -2)

  # all the following are correct
  v3 = add(v1, v2)
  v4 = v1.add(v2)
  v5 = v1.add(v2).add(v4)

C++ proposal

[edit]

Proposals for a unification of member function and free function calling syntax have been discussed from the early years of C++ standardization. Glassborow (2004) proposed a uniform calling syntax (UCS), allowing specially annotated free functions to be called with member function notation.[8] In 2016 it was proposed a second time for addition to C++ by Bjarne Stroustrup[9] and Herb Sutter,[7] to reduce the ambiguous decision between writing free functions and member functions, to simplify the writing of templated code. Many programmers are tempted to write member functions to get the benefits of the member function syntax (e.g. "dot-autocomplete" to list member functions);[10] however, this leads to excessive coupling between classes.[11] This was again, in 2023, proposed by Herb Sutter[12] claiming new information and insights, as well as an experimental implementation in the cppfront compiler.

Rust usage of the term

[edit]

Until 2018, it was common[13] to use this term when actually referring to qualified/explicit path syntax and most commonly the fully qualified path syntax: because it is possible to have several traits defining the same method implemented on the same struct, a mechanism is needed to disambiguate which trait should be used. Member functions can also be used as free functions through a qualified (namespaced) path. The term UFCS is incorrect for these uses, as it allows using methods as (namespaced) free functions, but not using free functions as methods.

See also

[edit]

References

[edit]
  1. ^ a b "Universal Function Call Syntax (UFCS)". Programming in D. Retrieved 1 October 2017.
  2. ^ "Nim by Example - Procs". nim-by-example.github.io. Retrieved 2025-08-06.
  3. ^ "The Koka Programming Language". koka-lang.github.io. Retrieved 2025-08-06.
  4. ^ "Functions". Effekt Language. Retrieved 2025-08-06.
  5. ^ "Functions". D Programming Language. Retrieved 1 October 2017.
  6. ^ "Operators". Avisynth wiki. a.function(b) is equivalent to function(a, b)
  7. ^ a b "Unified Call Syntax" (PDF). Isocpp.org. Retrieved 1 October 2017.
  8. ^ Francis Glassborow (2 May 2004). "N1585: Uniform Calling Syntax (Re-opening public interfaces)" (PDF). Retrieved 17 December 2018.
  9. ^ "UFCS proposal" (PDF). Open-std.org. Retrieved 1 October 2017.
  10. ^ "Using IntelliSense". MSDN. Retrieved 1 October 2017.
  11. ^ "How Non-Member Functions Improve Encapsulation". Drdobbs.com. Retrieved 1 October 2017.
  12. ^ Sutter, Herb (13 October 2023). "Unified function call syntax (UFCS)" (PDF).
  13. ^ "Rename UFCS to accurately reflect its functionality. · Issue #1140 · rust-lang/rfcs". GitHub. Retrieved 2025-08-06.
五四运动是什么 阑尾切除后有什么影响和后遗症 的近义词是什么 七六年属什么 倾尽所有什么意思
胃气上逆是什么原因 卡波姆是什么 脑胀是什么原因 什么有作为 什么鱼最好养
胃反酸烧心吃什么药 旭日是什么意思 energy是什么牌子 56个民族都有什么族 慢性萎缩性胃炎吃什么药
阳萎是什么意思 黄皮适合什么颜色的衣服 乱花渐欲迷人眼是什么意思 手指缝里长水泡还痒是什么原因 上火有什么症状
体检前一天晚上吃什么hcv9jop6ns0r.cn 女性尿频尿急吃什么药zhiyanzhang.com 肚脐眼上方是什么器官hcv9jop3ns3r.cn 山竹什么人不能吃hcv8jop5ns6r.cn 中午喜鹊叫有什么预兆hcv7jop5ns4r.cn
酸溜溜的什么hcv8jop1ns2r.cn 肚子咕咕叫吃什么药hcv9jop5ns5r.cn bmi指数是什么hlguo.com 肿瘤标志物高说明什么hcv9jop0ns6r.cn 命理是什么意思hcv9jop7ns1r.cn
纯色是什么颜色hcv8jop6ns9r.cn 内分泌代谢科是看什么病的hcv7jop4ns6r.cn 金黄的什么tiangongnft.com 美缝什么时候做hcv8jop2ns4r.cn 梦见老公回来了是什么征兆hcv9jop3ns3r.cn
导是什么意思hcv9jop3ns4r.cn 玫瑰红是什么颜色hcv7jop6ns2r.cn 间皮瘤是什么病hcv8jop6ns6r.cn 白羊和什么星座最配hcv8jop0ns2r.cn 泡泡尿是什么毛病hcv9jop1ns5r.cn
百度