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

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


  • 相关阅读:
    Go
    list的基本操作实现
    天梯赛练习题L2-006. 树的遍历
    部署 Fluent Bit ( td-agent-bit )
    elastalert + supervisor
    elastalert搭建
    Docker 部署 kibana( ES开启了密码认证)
    Docker 部署 elasticsearch( ES开启了密码认证)
    Python yaml模块
    Python json和pickle模块
  • 原文地址:https://www.cnblogs.com/snakevash/p/3007473.html
Copyright © 2011-2022 走看看