ClojureScript

Use different primitives for array access and property/object access

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

In javascript, array access (array[index]) and property access (object["property"]) have the same syntax, hence aget/aset are used for both in the core library.

But this isn't true for every target language. For example in Lua, there are no arrays, so if you want to have an array like container, array access will need to go through a function.

This patch proposes to add new builtins : oget and oset (for obj-get obj-set) and use them where appropriate. The generated code will be the same for javascript, but will enable alternate backend implementers to treat both differently

Activity

Raphaël AMIARD made changes -
Field Original Value New Value
Attachment 0001-CLJS-353-Use-different-primitives-for-array-access-a.patch [ 11416 ]
Raphaël AMIARD made changes -
David Nolen made changes -
Priority Major [ 3 ] Minor [ 4 ]

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated: