• 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

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


  • 相关阅读:
    PATA 1071 Speech Patterns.
    PATA 1027 Colors In Mars
    PATB 1038. 统计同成绩学生(20)
    1036. 跟奥巴马一起编程(15)
    PATA 1036. Boys vs Girls (25)
    PATA 1006. Sign In and Sign Out (25)
    读取web工程目录之外的图片并显示
    DOS命令
    java连接oracle集群
    servlet
  • 原文地址:https://www.cnblogs.com/snakevash/p/3007473.html
Copyright © 2020-2023  润新知