Can someone explain this?

General APL language issues

Can someone explain this?

Postby crishog on Wed Aug 24, 2016 11:24 am

'string...' 'UTF-8' ⎕NPUT'd:\puttest2' 1
'string...' 'UTF-8'⍬ ⎕NPUT'd:\puttest2' 1
'string...' 'UTF-8' Q.NPUT1'd:\puttest2' 1
'string...' 'UTF-8'⍬ Q.NPUT1'd:\puttest2' 1
SYNTAX ERROR
'string...' 'UTF-8'⍬ Q.NPUT1'd:\puttest2' 1


Attempting to isolate the problem, I've pared down the method in the script to:

∇ {result}←data NPUT1 args
:Access Public
result←data ⎕NPUT args


The put runs correctly & the file is updated. If I use, say, 13 as the newline element it works. The syntax error only occurs when I use ⍬

/Chris
crishog
 
Posts: 61
Joined: Mon Jan 25, 2010 9:52 am

Re: Can someone explain this?

Postby AndyS|Dyalog on Thu Aug 25, 2016 9:29 am

Umm .. no !

I've logged this as issue 13799 and will ask the developers to take a look. Once we've got to the bottom of this I'll update this note.
User avatar
AndyS|Dyalog
 
Posts: 257
Joined: Tue May 12, 2009 6:06 pm

Re: Can someone explain this?

Postby crishog on Thu Aug 25, 2016 2:06 pm

It's also OK when in a function call, the error only applies to a method in a script

Interestingly it propagates upwards in that:

∇ r←a FRED n
:Access Public
r←a NPUT1 n
⎕←'hello'


Called with the arguments to NPUT1 gives the Syntax error on Q.FRED in the function which calls it:

fn
hello
SYNTAX ERROR
fn[1] 'string...' 'UTF-8'⍬ Q.FRED'd:\puttest2' 1
crishog
 
Posts: 61
Joined: Mon Jan 25, 2010 9:52 am

Re: Can someone explain this?

Postby AndyS|Dyalog on Thu Aug 25, 2016 2:23 pm

We've got to the bottom of this one; the fix will be included in the next set of DSS patches (13799: Spurious SYNTAX ERROR when a method returns the result of ⎕NPUT).
User avatar
AndyS|Dyalog
 
Posts: 257
Joined: Tue May 12, 2009 6:06 pm


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest