zoukankan      html  css  js  c++  java
  • ClojureScript 点访问格式

    这份资料找的我想吐,赶快来收藏一下。让你写出无与伦比的代码的葵花宝典。
    当前提供的格式

    (.p o) ;=> 属性访问 (.m o <args>) ;=> 方法调用 带参数 (. o p) ;=> 属性访问 (. o p <args>) ;=> 方法调用 带参数 (. o (m)) ;=> 方法调用 (. o (m <args>)) ;=> 方法调用 带参数

    将来可能支持的:

    (.p o)           ;=> 属性访问 p是属性
    
    (.p o)           ;=> 方法调用 p是方法
    
    (.m o <args>)    ;=> 方法调用
    
    (. o p)          ;=> 属性访问 p是属性
    
    (. o p)          ;=> 方法调用 p是方法
    
    (. o p <args>)   ;=> 方法调用
    
    (. o (m))        ;=> 方法调用
    
    (. o (m <args>)) ;=> 方法调用

    The divergence between the Clojure and ClojureScript way is due to first-class functions. That is, in JavaScript a property can be a field or a function or a method. There is currently no way to distinguish between the desire to call a method and retrieve a function as a property except through syntax. This ticket would shorten the gap between Clojure and ClojureScript in the following way (ClojureScript proposal below)(原话就这样了,我也不翻译了。):

    (.m o)           ;=> a method call
    
    (.m o <args>)    ;=> a method call
    
    (. o m)          ;=> a method call
    
    (. o m <args>)   ;=> a method call
    
    (. o (m))        ;=> a method call
    
    (. o (m <args>)) ;=> a method call
    
    (.-p o)          ;=> a property access
    
    (. o -p)         ;=> a property access

    说实话,看的我有点晕,附上原文地址:
    网页
    
    


  • 相关阅读:
    hdu 1754
    hdu 1166
    poj 1193
    如何由XSD自动生成XML和实体类
    WinForm(C#)CheckedlistBox绑定数据,并获得选中的值(ValueMember)和显示文本(DisplayMember)
    C#读写共享文件夹
    去除TFS版本控制信息
    SQL 触发器
    C#中操作WMI的类库-实现远程登录共享
    VS 制作安装包小窥
  • 原文地址:https://www.cnblogs.com/snakevash/p/3007473.html
Copyright © 2011-2022 走看看