四肢麻木是什么原因引起的| 己卯日五行属什么| 顶到子宫是什么感觉| 玫瑰糠疹用什么药| 荨麻疹是什么原因引起| 心什么神什么| 黑便是什么原因| 一个鸟一个衣是什么字| 人生苦短什么意思| 身体出汗是什么原因| 影子虫咬伤后用什么药| 免疫固定电泳查什么的| 高考什么时候恢复| hbcab阳性是什么意思| 米加白念什么| 血府逐瘀片主治什么病| 鼻子经常出血是什么原因| 灰指甲长什么样| 桂枝是什么| 忠武路演员是什么意思| 套牌是什么意思| 胸膜炎有什么症状| 撤侨是什么意思| 什么样的吸尘器比较好| 非分之想什么意思| 丙二醇是什么东西| 牙肿了吃什么消炎药| 行尸走肉是什么动物| 血栓弹力图是查什么的| 还珠格格什么时候上映的| 夏天怕热冬天怕冷是什么体质| 国防部长是什么级别| 伤口换药挂什么科啊| 植物是什么| tab是什么意思| 为什么手脚冰凉还出汗| 早餐有什么| 苏打和小苏打有什么区别| 什么地找| 巴黎世家是什么| 神是什么偏旁| 神的国和神的义指的是什么| 什么是偏印| five是什么意思| 肾功能挂什么科| 乌冬是什么| 吃相难看是什么意思| 鱼油是什么鱼提炼的| 关东煮是什么| 麻疹的症状是什么| 除了胃镜还有什么检查胃的方法吗| 猫一般吃什么| 止语是什么意思| 眼睛酸疼是什么原因| 什么是针灸| 看肠胃挂什么科室| 亚麻籽和什么相克| 女人左手心痒预示什么| 广字五行属什么| 体内湿气重用什么药| 脾虚湿盛吃什么中药| 金匮是什么意思| 血糖低有什么症状| 刷牙时牙酸是什么原因| 什么食物维生素A含量高| 营养过剩会导致什么| 膝盖疼痛吃什么药好| 喉咙不舒服挂什么科| 手腕痛挂什么科| 一九六三年属什么生肖| 甲功七项检查什么| 10周年结婚是什么婚| 农历六月十四是什么星座| 过是什么结构| 鬼最怕什么东西| 异常的异是什么意思| 外耳道炎用什么药| 大黄是什么药| 海王星是什么颜色| 二级医院是什么意思| 榴莲为什么这么贵| 虾片是什么做的| 江小白加雪碧什么意思| 皇太后是皇上的什么人| 宝宝胎动频繁说明什么| 南宁有什么好玩的地方| 护理专业学什么| 佩戴沉香有什么好处| mj什么意思| 六亲不认什么意思| 前列腺增生吃什么药效果最好| 什么植物驱蚊| 用什么泡脚可以脸上祛斑| 晚上7点是什么时辰| 眼角长脂肪粒是什么原因| 做什么能快速赚钱| 当逃兵会有什么后果| bl和bg是什么意思| 白玉菩提是什么材质| 横纹肌溶解什么意思| 园五行属什么| 阳萎是什么| 天珺手表什么档次| 深圳市长是什么级别| 虾黄是虾的什么部位| 支气管扩张什么症状| 婴儿足底采血查什么| 半夜胃反酸水是什么原因| 阳虚和阴虚有什么区别| 嘴角烂了是什么原因| 头发少剪什么发型好看| 小白鼠吃什么| 肝郁脾虚吃什么药| 眼前的苟且是什么意思| 精神科主要看什么病| 纳差什么意思| 咳嗽吃什么好的快偏方| 什么鸟一生只有一个伴侣| 胃寒吃点什么药| 脂肪肝用什么药| 硕的拼音是什么| 6月14号什么星座| 穹窿是什么意思| 嘴角上火是什么原因| 无期是什么意思| 脾大是怎么回事有什么危害| 单核细胞高是什么意思| 聚乙二醇是什么东西| 梦见放烟花是什么征兆| 脚拇指外翻是什么原因造成的| 头痛吃什么| 胆结石吃什么药| 癸水是什么| 碳水化合物是什么食物| 胎监不过关是什么原因| 牛仔裙配什么上衣好看| 糖代谢增高是什么意思| 茶油有什么功效| buy是什么意思| 血常规24项能查出什么病| 粗脖子病是什么原因引起的| 男性生殖长水泡是什么原因| 拉肚子不能吃什么食物| 代言人是什么意思| 男士戴什么手串好| 姨妈血是黑褐色是什么原因| 咒怨讲的是什么故事| 艾灸的原理是什么| 银行支行行长什么级别| 911是什么电话| 人为什么会焦虑| 长息肉是什么原因| 贤惠是什么意思| 赵子龙属什么生肖| 手指指尖发麻是什么原因| 女性排卵期出血是什么原因| 口腔溃疡吃什么药好使| 介质是什么| 一指什么生肖| 乏力是什么意思| 动物园有什么动物| psh是什么意思| 血小板偏高有什么危害| 白天咳嗽晚上不咳嗽是什么原因| 加油站为什么不能打电话| 短发女人吸引什么男人| 暧昧是什么意思| 为什么身上老是痒| 画蛇添足的故事告诉我们什么道理| 食管裂孔疝什么意思| 微信拉黑和删除有什么区别| 备孕不应该吃什么| 浅表性胃炎用什么药| 一什么雪| 诅咒是什么意思| 什么原因导致有幽门杆菌| 吃什么食品减肥| 三个水读什么| 0是什么意思网络语言| 网剧是什么意思| 佐匹克隆是什么药| 生日礼物送什么| cro公司是什么意思| 有缘人什么意思| 芒果不能和什么水果一起吃| 手抖是什么病| 人乳头瘤病毒51型阳性是什么意思| 7朵玫瑰花代表什么意思| 糖尿病吃什么水果比较好| 反犬旁和什么有关| 人工肝是什么意思| 溺水是什么感觉| 58岁属什么生肖| 史莱姆是什么意思| 采字五行属什么| 糖尿病病人吃什么水果| 屌丝是什么| 1658是什么意思| 尿酸高是什么造成的| 智商125是什么水平| 睾丸疼痛吃什么药最好| 宫颈管分离是什么意思| 鹅什么时候开始下蛋| 黄是什么| acr是什么意思| 伏特加兑什么好喝| 梦见吃水饺是什么预兆| 喝什么酒容易醉| 疱疹是什么原因引起| 怀孕吃什么水果| 青鱼吃什么| 肾积水是什么原因造成的怎么治疗| 尿里带血是什么原因| charleskeith什么牌子| 猫肉为什么不能吃| 人为什么会打哈欠| 生理盐水和食用盐水有什么区别| 熟地是什么| 什么相关四字成语| 梦见自己怀孕是什么意思| 一什么村庄| 中将是什么级别| 检查血压挂什么科| 明心见性是什么意思| 鸡血藤有什么功效| 梦见粉条是什么意思| 冰爽丝是什么面料| 谷丙转氨酶偏高是什么意思| 肝内多发钙化灶是什么意思| 早上起来腰疼是什么原因| 彩超无回声是什么意思| 胶原蛋白什么牌子好| 4月18号是什么星座| 美国白宫是干什么的| 梦见四条蛇是什么意思| 文科女生学什么专业好| 章鱼属于什么类动物| 前列腺炎中医叫什么病| 属猪的护身佛是什么佛| 哺乳期发烧吃什么药| 福瑞祥和是什么意思| 梦见别人买房子是什么预兆| 伽蓝菩萨保佑什么| 一岁宝宝吃什么| 井代表什么生肖| oem贴牌是什么意思| 恐惧症吃什么药最好| 1994年属什么| asus是什么牌子| 玉米须煮水喝有什么好处| 良代表什么生肖| 股票杠杆是什么意思| 避孕套是什么| 2100年是什么年| 叶什么什么龙| aoc是什么牌子| elle是什么档次的牌子| 未加一笔是什么字| 射手座男和什么星座最配| 凤是什么意思| 女性什么时候最容易怀孕| 玉米属于什么类食物| 摸胸是什么感觉| 挑疳积挑出来的是什么| 百度

老外深圳买苹果元零件:300美元组装出可充新的iPhone

百度 新办法自2018年4月10日起施行。

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.
拿到offer是什么意思 感染hpv吃什么药 乳头痒是什么原因 颇丰是什么意思 吃什么能补肾
脑梗做什么检查最准确 指甲薄软是什么原因 信子是什么意思 苏州为什么叫姑苏 白羊座是什么星象
隐翅虫皮炎用什么药膏 一根葱十分钟什么意思 饕餮什么意思 一个口一个且念什么字 屈髋是什么姿势
肉桂跟桂皮有什么区别 胸椎退行性变什么意思 潜能什么意思 糖耐量异常是什么意思 糖尿病是什么原因引起的
岍是什么意思hcv9jop4ns9r.cn 胆固醇是什么东西hcv9jop2ns1r.cn 为什么心脏会突然刺痛1949doufunao.com 记录是什么意思luyiluode.com 情人是什么意思hcv8jop7ns3r.cn
cream什么意思hcv9jop7ns4r.cn 褥疮用什么药膏最好hcv8jop9ns4r.cn 啤酒是什么酿造的jingluanji.com 医学ace是什么意思hcv8jop8ns4r.cn 右附件区囊肿是什么意思hcv9jop4ns8r.cn
壁虎怕什么hcv9jop4ns7r.cn 真菌感染用什么药膏dayuxmw.com 星巴克是什么hcv9jop0ns9r.cn 为什么高铁没有e座hcv9jop8ns1r.cn 什么是庞氏骗局hcv9jop2ns7r.cn
ram是什么动物chuanglingweilai.com 臭菜是什么菜hcv9jop3ns3r.cn 咖喱是什么东西hcv9jop3ns0r.cn 甲亢做什么检查travellingsim.com 喜鹊吃什么hcv8jop1ns9r.cn
百度