Vairant within a defined operator

General APL language issues

Vairant within a defined operator

Postby crishog on Sun Jul 22, 2018 1:03 pm

I have a defined operator which has the line

r←opts function ⍠ variant⊣FILENAME

"function" is the left operand and is always a quad function (It's a bit complicated to explain what I'm up to: this is DFS), but I get

DOMAIN ERROR: Invalid use of variant

Is this a failure to notice that it is a system function being called (which requires a variant in this case), or is it intentional to prevent "function" being a user-defined function?
crishog
 
Posts: 53
Joined: Mon Jan 25, 2010 9:52 am

Re: Vairant within a defined operator

Postby Jay|Dyalog on Mon Jul 30, 2018 12:46 pm

It works for me. In version 17.0:

Code: Select all
      ⎕VR'op'
     ∇ r←(fn op)arg
[1]    r←fn⍠1⊢arg
     ∇
      ⎕NINFO op 'ws/d*.dws'
  ws/display.dws  ws/ddb.dws  ws/dfns.dws

Can you give an example that does not work?
Jay|Dyalog
 
Posts: 22
Joined: Mon Aug 09, 2010 10:45 am

Re: Vairant within a defined operator

Postby crishog on Wed Aug 01, 2018 10:06 am

If I do something similar directly in the workspace it works for me too. This happens in the DFS QA tests

I'll try to isolate an example. In the meantime, when I got the crash I typed:

opts ⎕NDELETE ⎕OPT variant⊣FILENAME ⍝ This works
opts function ⎕OPT variant⊣FILENAME ⍝ This doesn't
DOMAIN ERROR: Invalid use of variant
opts function ⎕OPT variant⊣FILENAME ⍝ This doesn't

function
#.DFSTest.[DFCTest] . ⎕NDELETE . #.DFC

So the "raw" NDELETE worked, but not passing in the quad function.

This operator is to allow NEXISTS, NDELETE, MKDIR, etc. to handle multiple file names locally or pass it up to a DFS service to do the work, hence the need for the operator to do the low level choice between local and remote calls.
crishog
 
Posts: 53
Joined: Mon Jan 25, 2010 9:52 am


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest