Beginner's J question #12 - locales 
Author Message
 Beginner's J question #12 - locales

I just got J Release 2.02 for Sparc.  It's great - some bug fixes and
much faster (lots of changes from J7, though).  Now, something funny is
going on with name spaces, and once again the Dictionary does not provide
complete information.

I have the function:

ldobj =. 3 : 0
0!:11 <'obj.js'
)

which is defined in my profile.js (it doesn't matter if I execute
the definition from the keyboard).  When I type

   ldobj ''

I see my script file 'obj.js' whizzing by, as if it is being processed,
but when it is finished, none of the (tacit) function names defined
in obj.js is defined.  If I execute

   0!:11 <'obj.js'

from the keyboard, everything is defined.

So somehow by defining ldobj, I must have created another name space.
I suspect locales have something to do with it, but I thought that
if I shunned _xxx_ names, everything would be part of one big name space.

The dictionary says 'a script file can be used to populate a locale',
but I don't know whether that applies.  (and what is a "full" name - one with
a locative?).

Henry Rich



Tue, 15 Apr 1997 22:52:58 GMT  
 Beginner's J question #12 - locales
Henry Rich:
. I see my script file 'obj.js' whizzing by, as if it is being
. processed, but when it is finished, none of the (tacit) function
. names defined in obj.js is defined.

Try defining your names using =: rather than =. and see if that makes
a difference?

--
Raul D. Miller           n =: p*q             NB. 9<##:##:n [.large prime p, q

                         NB.  public e, n, y
                         x -: n&|&(*&y)^:d 1  NB. 1=(d*e)+.p*&<:q



Wed, 16 Apr 1997 00:12:40 GMT  
 Beginner's J question #12 - locales


Quote:
>Henry Rich:
>. I see my script file 'obj.js' whizzing by, as if it is being
>. processed, but when it is finished, none of the (tacit) function
>. names defined in obj.js is defined.

>Try defining your names using =: rather than =. and see if that makes
>a difference?

Well, yes, that works, but it's hardly a solution.  That would mean I
forgo =. and have only 1 name space.  If that's the best I can
do I'm sorry anyone dreamed up the idea of locales.

Henry Rich



Fri, 18 Apr 1997 23:26:05 GMT  
 Beginner's J question #12 - locales
Henry Rich:
. >. I see my script file 'obj.js' whizzing by, as if it is being
. >. processed, but when it is finished, none of the (tacit) function
. >. names defined in obj.js is defined.

Raul Miller:
. >Try defining your names using =: rather than =. and see if that
. >makes a difference?

Henry Rich:
. Well, yes, that works, but it's hardly a solution.  That would mean
. I forgo =. and have only 1 name space.  If that's the best I can do
. I'm sorry anyone dreamed up the idea of locales.

Ah.. I see... [I don't have J release 2, so I'm a bit in the dark
about some of these things.]

In the documentation on locales, there should be some mention of how
to execute a name in a particular locale.  For example, it may be that
you have to define the load routine as a name in your target locale so
you can execute it there.

It sounds, perhaps, like ISI has considered the possibility that
someone may want a temporary locale without considering that someone
may also want a temporary "name" in a permanent locale.

Locale's are still a new feature -- it sometimes takes some experience
to get this sort of thing designed properly.

--
Raul D. Miller           n =: p*q             NB. 9<##:##:n [.large prime p, q

                         NB.  public e, n, y
                         x -: n&|&(*&y)^:d 1  NB. 1=(d*e)+.p*&<:q



Sat, 19 Apr 1997 00:38:30 GMT  
 Beginner's J question #12 - locales

: I have the function:

: ldobj =. 3 : 0
: 0!:11 <'obj.js'
: )

: which is defined in my profile.js (it doesn't matter if I execute
: the definition from the keyboard).  When I type

:    ldobj ''

: I see my script file 'obj.js' whizzing by, as if it is being processed,
: but when it is finished, none of the (tacit) function names defined
: in obj.js is defined.  If I execute

:    0!:11 <'obj.js'

: from the keyboard, everything is defined.

Problem is not related to namespaces.  Any name defined within
obj.js by '=.' will be local to ldobj.  Suggest changing to '=:'.

--
Harvey Davies,                              Home: +61 3 772 5199
CSIRO Division of Atmospheric Research,     Work: +61 3 586 7574
Private Bag No. 1, Mordialloc,               Fax: +61 3 586 7600



Tue, 29 Apr 1997 06:13:51 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. C-Prolog question - construct atom '12'

2. Beginner's 'enum' question

3. JS-EAI with *JS*-callback

4. Sorry it's beginner's question..

5. TK beginners question - how to 'beep'

6. js.exception 3279.js

7. #(#feet 1/12) give me (#feet 1 $/ 12)

8. US-NY-NYC - Smalltalk technical lead - 12 + 12 month contract

9. US-NYC-d'town - Smalltalk VisualWorks consultant - 12 mth contract - major brokerage

10. Smalltalk VM + Sybase OCS 12 dll's probplem

11. Cobb's 12 rules of RDBMS

12. Problem with Novell Netware 3.12+win'95 station+funcion disksize(funcky)

 

 
Powered by phpBB® Forum Software