Clojure

Add support for property lookup

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.4
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

Add support for property lookups to match functionality introduced in ClojureScript with CLJS-89.

This is a breaking change for Clojure with record/type fields that start with "-".

Activity

Hide
Alan Dipert added a comment - - edited

Attached 872-add-prop-lookup.patch. It's a first cut that Fogus and I worked on. It needs tests.

Show
Alan Dipert added a comment - - edited Attached 872-add-prop-lookup.patch. It's a first cut that Fogus and I worked on. It needs tests.
Alan Dipert made changes -
Field Original Value New Value
Attachment 872-add-prop-lookup.patch [ 10598 ]
Hide
Fogus added a comment -

Tests for prop lookup.

Show
Fogus added a comment - Tests for prop lookup.
Fogus made changes -
Attachment CLJ-872-prop-lookup-tests.patch [ 10691 ]
Hide
Fogus added a comment -

Ready for screening.

Show
Fogus added a comment - Ready for screening.
Fogus made changes -
Patch Code and Test [ 10002 ]
Approval Test [ 10013 ]
Hide
Stuart Halloway added a comment -

Can you explain the compiler change? It appears to implement the desired functionality, but also to disable a code path that allows keywords for field lookup (the block at line 892 can no longer be reached by a keyword).

Show
Stuart Halloway added a comment - Can you explain the compiler change? It appears to implement the desired functionality, but also to disable a code path that allows keywords for field lookup (the block at line 892 can no longer be reached by a keyword).
Stuart Halloway made changes -
Waiting On fogus
Approval Test [ 10013 ] Incomplete [ 10006 ]
Hide
Fogus added a comment -

Clojure has for a while secretly allowed kw lookup for field access. However, in the discussions with Rich and Clojure/dev at http://dev.clojure.org/display/design/Unified+ClojureScript+and+Clojure+field+access+syntax it was decided to use -prop across CLJ and CLJS thus obviating the need for kw access.

Show
Fogus added a comment - Clojure has for a while secretly allowed kw lookup for field access. However, in the discussions with Rich and Clojure/dev at http://dev.clojure.org/display/design/Unified+ClojureScript+and+Clojure+field+access+syntax it was decided to use -prop across CLJ and CLJS thus obviating the need for kw access.
Fogus made changes -
Waiting On fogus stu
Stuart Halloway made changes -
Approval Incomplete [ 10006 ] Screened [ 10004 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Stuart Sierra made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Stuart Halloway made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: