Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Distinguish primitive and defined functions inside an operator
Thomas Buchholz wrote:
> I wonder if there is a way in IBM APL2 for Windows to distinguish inside
> a defined operator whether or not the operator was called with some
> primitive function.
>
> Since there is actually no fill function implemeted for the Each
> operator I would like to mimic it using some defined operator E{<-}L(F
> EACH)R. In the monadic case the result of EACH on an empty R would
> therefore be E{<-}({rho}R){rho}{enclose}F{first}R if F is a primitive
> function and E{<-}R if F is a defined one. (BTW: does the Mainframe
> version really behave in that manner?)
>
> Any ideas would be gratefully appreciated.

Taking F as the left operand, look at the result of

'0' {[]}EA '{[]}CR''F'''

I believe this produces a detectable difference between defined and
primitive operands.

Report this thread to moderator Post Follow-up to this message
Old Post
Mike Kent
01-12-05 08:55 AM


Re: Distinguish primitive and defined functions inside an operator
David Liebtag wrote:
> Mike,
>
> I don't know why you used QuadCR inside QuaDEA, but whatever the reason, I
> don't think your example provides you with a way to detect whether the
> operand is primitive or not.  You get the same result for locked defined
> functions as you get for primitives.

OK, but for many of us this is a theoretical limitation rather than
a practical one.  I have not run into any locked code in the past
fifteen years or so.

Do you get the same result for external functions (i.e, are they
treated as locked)?   That might be more of a practical issue.

Report this thread to moderator Post Follow-up to this message
Old Post
Mike Kent
01-13-05 01:57 PM


Re: Distinguish primitive and defined functions inside an operator
David Liebtag wrote:
> Mike,
>
> I don't know why you used QuadCR inside QuaDEA, but whatever the reason,

Because I don't have access to an APL2 system at the moment; the
OS/2 system I keep alive just so I can run APL2 is temporarily
out of service, I could not check that QuadCR won't throw an error
when applied to an operand name (for example, if the operand
is a derived function ...).  So:  I wrapped some exception handling
around the call to QuadCR.

Report this thread to moderator Post Follow-up to this message
Old Post
Mike Kent
01-14-05 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

APL archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:44 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.