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
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.
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).
Hide
Fogus added a comment -

Ready for screening.

Show
Fogus added a comment - Ready for screening.
Hide
Fogus added a comment -

Tests for prop lookup.

Show
Fogus added a comment - Tests for prop lookup.
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.

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: