Clojure

GC Issue 115: Document that #^chars works

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.2
  • Component/s: None
  • Labels:
    None

Description

Reported by hlship, May 05, 2009

In the Java Interop documentation, it identifies a number of special tags
that can be used to identify parameters of primitive arrays.

It does not list #^chars (equivalent to char[]) but this appears to (at
least partially) work.

On a related note, for this code:

(def #^StringBuilder *buffer*)

(defn- add-text
  "Adds text to the buffer and manages the *text-location* var."
  [#^chars ch start length]
  (.append *buffer* ch start length)  ;;;; line 98
  (when (nil? *text-location*)
        (set! *text-location* (current-location))))


I still get 

Reflection warning,
com/howardlewisship/cascade/internal/xmltokenizer.clj:98 - call to append
can't be resolved.

Activity

Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - Converted from http://www.assembla.com/spaces/clojure/tickets/119
Hide
Assembla Importer added a comment -

richhickey said: Updating tickets (#8, #19, #30, #31, #126, #17, #42, #47, #50, #61, #64, #69, #71, #77, #79, #84, #87, #89, #96, #99, #103, #107, #112, #113, #114, #115, #118, #119, #121, #122, #124)

Show
Assembla Importer added a comment - richhickey said: Updating tickets (#8, #19, #30, #31, #126, #17, #42, #47, #50, #61, #64, #69, #71, #77, #79, #84, #87, #89, #96, #99, #103, #107, #112, #113, #114, #115, #118, #119, #121, #122, #124)
Hide
Assembla Importer added a comment -

troussan said: The reflection warning in the example code is caused by start and length parameters. If you replace the line 98 with:
(.append buffer ch (int start) (int length)) ;;;; line 98
the call to append is resolved.

Show
Assembla Importer added a comment - troussan said: The reflection warning in the example code is caused by start and length parameters. If you replace the line 98 with: (.append buffer ch (int start) (int length)) ;;;; line 98 the call to append is resolved.
Hide
Assembla Importer added a comment -

richhickey said: Updating tickets (#8, #42, #113, #2, #20, #94, #96, #104, #119, #124, #127, #149, #162)

Show
Assembla Importer added a comment - richhickey said: Updating tickets (#8, #42, #113, #2, #20, #94, #96, #104, #119, #124, #127, #149, #162)
Hide
Assembla Importer added a comment -

richhickey said: Updating tickets (#94, #96, #104, #119, #163)

Show
Assembla Importer added a comment - richhickey said: Updating tickets (#94, #96, #104, #119, #163)
Hide
Assembla Importer added a comment -

stu said: To prevent the reflection warning, use primitive coercions as needed:

(.append *buffer* ch start length)

I have update the docs on clojure.org.

Show
Assembla Importer added a comment - stu said: To prevent the reflection warning, use primitive coercions as needed:
(.append *buffer* ch start length)
I have update the docs on clojure.org.
Hide
Assembla Importer added a comment -

stu said: repeating the previous comment, with the coercions this time.

(.append *buffer* ch (int start) (int length))
Show
Assembla Importer added a comment - stu said: repeating the previous comment, with the coercions this time.
(.append *buffer* ch (int start) (int length))

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: