-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, August 08, 2007 10:16 AM
To: [email protected]
Subject: Programming Digest, Vol 23, Issue 21

Send Programming mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.jsoftware.com/cgi-bin/mailman/listinfo/programming
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Programming digest..."


Today's Topics:

   1. Re: Standalone Error wdhandler_base_ (Roger Hui)
   2. Sharing mapped file between 64bit and 32bit J (Anssi Seppälä)
   3. Re: Standalone Error wdhandler_base_ (Don Guinn)
   4. Re: Web Service Client? (Yuvaraj Athur Raghuvir)
   5. pcre question (bill lam)
   6. Re: pcre question (bill lam)
   7. Re: Standalone Error wdhandler_base_ (Roger Hui)


----------------------------------------------------------------------

Message: 1
Date: Tue, 07 Aug 2007 22:42:22 -0700
From: Roger Hui <[EMAIL PROTECTED]>
Subject: Re: [Jprogramming] Standalone Error wdhandler_base_
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii

> Could be mentioned or referenced in H. Frets and Scripts
>    http://www.jsoftware.com/help/dictionary/dicth.htm
> or in Scripts Foreign Conjunction (where it also does not
> say about boxed and unboxed argument differences)
>    http://www.jsoftware.com/help/dictionary/dx000.htm

Regarding the parenthetical remark:  vide file vs. noun.



----- Original Message -----
From: Oleg Kobchenko <[EMAIL PROTECTED]>
Date: Tuesday, August 7, 2007 20:16
Subject: Re: [Jprogramming] Standalone Error wdhandler_base_
To: Programming forum <[email protected]>

> I wasn't positive that there would be a written
> misstatement, more an insufficiency of written statement.
> 
> To start, here are a few informative references,
> where it is prominent and well-explained.
> 
> Eric Iverson, J Primer, When they aren't
>   http://www.jsoftware.com/help/primer/when_not_same.htm
> (script locals are in scope of "load")
> 
> Roger Stokes, Learning J, 26.5 Local Definitions in Scripts
>   http://www.jsoftware.com/help/learning/26.htm#04
> (detailed account of script locals with 3 : ' ')
> 
> Henry Rich, J For C Programmers, 29. Modular Code, Assignment
>   
> http://www.jsoftware.com/help/jforc/modular_code.htm#_Toc141158126(a small 
> note about load in context of so-called "private" assignments.)
> 
> 
> But I was not able to find anything in normative
> references: Dictionary or User Manual, etc.
> Could be mentioned or referenced in H. Frets and Scripts
>    http://www.jsoftware.com/help/dictionary/dicth.htm
> or in Scripts Foreign Conjunction (where it also does not
> say about boxed and unboxed argument differences)
>    http://www.jsoftware.com/help/dictionary/dx000.htm
> 
> 
> Here are a few places from the forum using random search,
> that hint at some confusion or vagueness.
> 
> [Jprogramming] Standalone Error wdhandler_base_
> http://www.jsoftware.com/pipermail/programming/2007-August/007715.html
> http://www.jsoftware.com/pipermail/programming/2007-August/007720.html
> 
> [Jprogramming] local and global assignment in different locales
> http://www.jsoftware.com/pipermail/programming/2007-August/007712.html
> 
> [Jprogramming] Standalone Error wdhandler_base
> http://www.jsoftware.com/pipermail/programming/2007-August/007702.html
> 
> [Jgeneral] unexpected result
> http://www.jsoftware.com/pipermail/general/2007-March/029247.html
> [Jprogramming] Fix local names
> http://www.jsoftware.com/pipermail/programming/2007-
> January/004649.html(emphasis on "script", not explicit scope)
> 
> [Jprogramming] Something almost cool - maybe a bug
> http://www.jsoftware.com/pipermail/programming/2006-March/001573.html
> 
> [Jbeta] Global Assignment Error outside an Explicit Definition
> http://www.jsoftware.com/pipermail/beta/2006-February/000505.html
> http://www.jsoftware.com/pipermail/beta/2006-February/000503.html
> 
> [Jforum] Scripts Won't Run
> http://www.jsoftware.com/pipermail/general/2005-April/021472.html
> (explained in terms of "script" not explicit scope)
> 
> [Jforum] Running a Script
> http://www.jsoftware.com/pipermail/general/2005-March/021224.html
> (not knowing about explicit origin script scope)
> 
> Jforum: =. vs =: in scripts
> http://www.jsoftware.com/pipermail/general/2002-May/009466.html
> http://www.jsoftware.com/pipermail/general/2002-May/009849.html
> (older "loads" were tacit leaving script local in global scope)
> 
> 
> 
> --- Roger Hui <[EMAIL PROTECTED]> wrote:
> 
> > Do you have any evidence that this misconception
> > (a script having its own locals) is universal?
> > 
> > Perhaps the extent of the misconception is due
> > to the fact that the J IDE itself uses "load"
> > and other explicitly defined tools like "script"
> > (e.g. to implement "Run|Window"), and 0!:n 
> > are seldom used on their own.
> > 
> > I do not think that the documentation that I am 
> > responsible for (dictionary, release notes) would 
> > say that a script has its own locals.
> > 
> > 
> > 
> > ----- Original Message -----
> > From: Oleg Kobchenko <[EMAIL PROTECTED]>
> > Date: Tuesday, August 7, 2007 16:10
> > Subject: Re: [Jprogramming] Standalone Error wdhandler_base_
> > To: Programming forum <[email protected]>
> > 
> > > --- Raul Miller <[EMAIL PROTECTED]> wrote:
> > > 
> > > > On 8/7/07, Roger Hui <[EMAIL PROTECTED]> wrote:
> > > > > There have not been any changes in the interpreter
> > > > > in this regard.  Perhaps the defn of "load" was changed
> > > > > and that could have changed the behaviour.  Or perhaps
> > > > > you did your experiments using "load", thinking that
> > > > > it was equivalent to 0!:0@< .
> > > > 
> > > > On reflection, I have realized that this latter is the case:
> > > > 
> > > > I was thinking that the local context I saw when using
> > > > 'load' was a property of 0!:0 rather than being a consequence
> > > > of load having an explicit (rather than tacit) definition.
> > > 
> > > And this realization is what I referred to as unveiling the
> > > misconception about the 0!:0 context.
> > > 
> > > It might have been rooted in some written documentation,
> > > because this misconception is universal. We need to look at
> > > various places where 0!:0 and scripts are mentioned.
> > > Or probably, the truth is not straight and clear enough.
> > > The reality turns out to be much simpler.
> > > 
> > > 
> > > This mechanism of local script variables visible to
> > > the scope of the loading function may have some interesting
> > > applications, such as custom loaders which can be
> > > parameterized with temporary local variables defined
> > > in the script(s).
> > > 
> > > Or it could be thought of functions mutating their bodies
> > > at run time with code from nouns or even script files.


------------------------------

Message: 2
Date: Wed, 08 Aug 2007 09:19:27 +0300
From: Anssi Seppälä <[EMAIL PROTECTED]>
Subject: [Jprogramming] Sharing mapped file between 64bit and 32bit J
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"; format=flowed

I am studying methods to share data between 32 and 64 bit J. The 
jfiles seem to work fine, but mapped files are different because the 
intergers are 4 and 8 bytes. I wonder it is possible to  convert in a 
64 bit J integers to 32 bit representation and write to a mapped file 
and vice versa. I wonder if this reasonable idea and how the 
conversion is best to do?

Thanks,
Anssi



------------------------------

Message: 3
Date: Wed, 8 Aug 2007 08:03:27 -0500
From: "Don Guinn" <[EMAIL PROTECTED]>
Subject: Re: [Jprogramming] Standalone Error wdhandler_base_
To: "Programming forum" <[email protected]>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=UTF-8

A script saved under the name 'ntest.ijs':
NB. Start of script______________

cocurrent 'labc'
a=:'In locale labc'
b=.'A temporary created while in locale labc'
b_labc_=.'Another global'
a;b;b_labc_

cocurrent 'ldef'
a=:'In locale ldef'
a;b

NB. End of Script________________

Running the script with an explicit verb:

   loadd 'ntest.ijs'
   NB. Start of script______________

   cocurrent 'labc'
   a=:'In locale labc'
   b=.'A temporary created while in locale labc'
   b_labc_=.'Another global'
   a;b;b_labc_
+--------------+----------------------------------------+--------------+
|In locale labc|A temporary created while in locale labc|Another global|
+--------------+----------------------------------------+--------------+

   cocurrent 'ldef'
   a=:'In locale ldef'
   a;b
+--------------+----------------------------------------+
|In locale ldef|A temporary created while in locale labc|
+--------------+----------------------------------------+

   NB. End of Script________________

Running the script tacitly:

   0!:001 <'ntest.ijs'
   NB. Start of script______________

   cocurrent 'labc'
   a=:'In locale labc'
   b=.'A temporary created while in locale labc'
   b_labc_=.'Another global'
   a;b;b_labc_
+--------------+--------------+--------------+
|In locale labc|Another global|Another global|
+--------------+--------------+--------------+

   cocurrent 'ldef'
   a=:'In locale ldef'
   a;b
+--------------+-+-+
|In locale ldef|;|b|
+--------------+-+-+

   NB. End of Script________________

   coname''
+----+
|ldef|
+----+

___________________

The name b is a local name and persists over the switch of locales when run
under loadd but not when run under a tacit verb. It is a global name even
though it is defined using a local copula.



Notice that the second definition of b is defined with a local copula but
produced a global definition and it got around the error of creating a
global name which is also a local.


------------------------------

Message: 4
Date: Wed, 8 Aug 2007 19:09:11 +0530
From: "Yuvaraj Athur Raghuvir" <[EMAIL PROTECTED]>
Subject: [Jprogramming] Re: Web Service Client?
To: "Programming forum" <[email protected]>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

Hello,

I started the implementation of my own wrapper. Now, almost all the calls
are going fine. At the critical point when I have to establish the
connection and send the message, there is an  Access Violation that brings
down J environment. I am able to execute the same sequence of calls from a
simple client application.

Now, how to debug this access violation?

1) I have done a simple mapping of pointers to structures as integers. This
seems to work because all I do is manage the various pointers - get it from
one call and pass it to the other. But is this the right way?

2) I built the engine in the VC++ Express edition. However, all I get to
understand if that a certain call causes a access violation in j.exe and the
second time J crashes. This is related to invoking a function pointer buried
deep in the various pointers I manage from J.

Any clues?

Regards,
Yuva

p.s: If you need more info on the code I have written, just let me know and
I shall paste the code into the mail (the C/C++ working version & my J
translation)

On 7/18/07, Yuvaraj Athur Raghuvir <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I recently came across Axis2C - a C implementation for Web Service
> Consumption - developed by Apache (http://ws.apache.org/axis2/c/)
>
> Looking at the example clients that comes with the installation, I think
> it would be quite straight forward to provide a web service client facility
> in J via an addon.
>
> Being a novice at DLL integration into J, I was wondering if someone else
> is looking into this.
>
> I think adding this as another package under JAL would be quite useful.
>
> Let me know.
>
> Thanks,
> Yuva
>
>


------------------------------

Message: 5
Date: Wed, 08 Aug 2007 23:18:15 +0800
From: bill lam <[EMAIL PROTECTED]>
Subject: [Jprogramming] pcre question
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=UTF-8; format=flowed

I want to find&replace using regular expression for the pattern
\((.+?)&\([EMAIL PROTECTED]) flag

('cat'&[EMAIL PROTECTED]) flag
  'cat'
it match this line and back reference is correct

('dog', 'mouse'), ('cat'&[EMAIL PROTECTED]) flag
  'dog', 'mouse'), ('cat'
it also match this line however the back reference is not that I wanted.
how can I get the true smallest group (in this case 'cat')?

-- 
regards,
bill


------------------------------

Message: 6
Date: Wed, 08 Aug 2007 23:29:31 +0800
From: bill lam <[EMAIL PROTECTED]>
Subject: Re: [Jprogramming] pcre question
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=UTF-8; format=flowed

sorry, typo. the examples should be

('cat'&([EMAIL PROTECTED]) flag
  'cat'

('dog', 'mouse'), ('cat'&([EMAIL PROTECTED]) flag
  'dog', 'mouse'), ('cat'

My workaround is by limiting the length of back reference group
\((.{1,8}?)&\([EMAIL PROTECTED]) flag

and I am looking for better solutions.

bill lam wrote:
> I want to find&replace using regular expression for the pattern
> \((.+?)&\([EMAIL PROTECTED]) flag
> 
> ('cat'&[EMAIL PROTECTED]) flag
>  'cat'
> it match this line and back reference is correct
> 
> ('dog', 'mouse'), ('cat'&[EMAIL PROTECTED]) flag
>  'dog', 'mouse'), ('cat'
> it also match this line however the back reference is not that I wanted.
> how can I get the true smallest group (in this case 'cat')?
> 


-- 
regards,
bill


------------------------------

Message: 7
Date: Wed, 08 Aug 2007 08:30:18 -0700
From: Roger Hui <[EMAIL PROTECTED]>
Subject: Re: [Jprogramming] Standalone Error wdhandler_base_
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii

The interpreter works as expected.

a. Only an explicit definition can have local names.
b. =. outside of explicit definition is the same as =:
c. Locatives are always global (whether assigned
using =. or =:).



----- Original Message -----
From: Don Guinn <[EMAIL PROTECTED]>
Date: Wednesday, August 8, 2007 6:03
Subject: Re: [Jprogramming] Standalone Error wdhandler_base_
To: Programming forum <[email protected]>

> A script saved under the name 'ntest.ijs':
> NB. Start of script______________
> 
> cocurrent 'labc'
> a=:'In locale labc'
> b=.'A temporary created while in locale labc'
> b_labc_=.'Another global'
> a;b;b_labc_
> 
> cocurrent 'ldef'
> a=:'In locale ldef'
> a;b
> 
> NB. End of Script________________
> 
> Running the script with an explicit verb:
> 
>    loadd 'ntest.ijs'
>    NB. Start of script______________
> 
>    cocurrent 'labc'
>    a=:'In locale labc'
>    b=.'A temporary created while in locale labc'
>    b_labc_=.'Another global'
>    a;b;b_labc_
> +--------------+----------------------------------------+--------
> ------+
> |In locale labc|A temporary created while in locale labc|Another 
> global|+--------------+----------------------------------------+-
> -------------+
> 
>    cocurrent 'ldef'
>    a=:'In locale ldef'
>    a;b
> +--------------+----------------------------------------+
> |In locale ldef|A temporary created while in locale labc|
> +--------------+----------------------------------------+
> 
>    NB. End of Script________________
> 
> Running the script tacitly:
> 
>    0!:001 <'ntest.ijs'
>    NB. Start of script______________
> 
>    cocurrent 'labc'
>    a=:'In locale labc'
>    b=.'A temporary created while in locale labc'
>    b_labc_=.'Another global'
>    a;b;b_labc_
> +--------------+--------------+--------------+
> |In locale labc|Another global|Another global|
> +--------------+--------------+--------------+
> 
>    cocurrent 'ldef'
>    a=:'In locale ldef'
>    a;b
> +--------------+-+-+
> |In locale ldef|;|b|
> +--------------+-+-+
> 
>    NB. End of Script________________
> 
>    coname''
> +----+
> |ldef|
> +----+
> 
> ___________________
> 
> The name b is a local name and persists over the switch of 
> locales when run
> under loadd but not when run under a tacit verb. It is a global 
> name even
> though it is defined using a local copula.
> 
> 
> 
> Notice that the second definition of b is defined with a local 
> copula but
> produced a global definition and it got around the error of 
> creating a
> global name which is also a local.


------------------------------

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

End of Programming Digest, Vol 23, Issue 21
*******************************************
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to