This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

dot notation question


Hi all,

I'm a newbie to Kawa, so excuse me if I'm asking the obvious. here is my code:

(define (get-initial-context class-name url username password)
(let ((props (java.util.Properties:new)))
(begin
(*:put props (javax.naming.InitialContext:.INITIAL_CONTEXT_FACTORY) (->jstring class-name))
;; snip...
(javax.naming.InitialContext:new props)))


returns error message:
<unknown>: no slot `INITIAL_CONTEXT_FACTORY' in javax.naming.InitialContext (i'm using kawa-1.8.jar)


but if I modify the code below it worked.

(define *initial-context* (javax.naming.InitialContext:.INITIAL_CONTEXT_FACTORY))

(define (get-initial-context class-name url username password)
  (let ((props (java.util.Properties:new)))
     (begin
      (*:put props *initial-context* (->jstring class-name))
	;snip
     (javax.naming.InitialContext:new props)))

so, what's the real difference between the two? and why dot notation didn't work in the 1st scenario?

Thanks.

--Li Lin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]