multiline locals definition with assignment?

No need to worry about going "off topic" here
Forum rules
This forum is for general chit-chat, not necessarily APL-related. However, it's not for spam or for offensive or illegal comments.

multiline locals definition with assignment?

Postby norbertjurkiewicz84 on Thu Jul 25, 2019 2:18 pm

Any reason not to allow default values like Classes do?

      testFoo rArg
;one;two
;three
;default ← 0
;notDefault ← 1

⎕← 'output'
User avatar
norbertjurkiewicz84
 
Posts: 62
Joined: Mon Nov 01, 2010 7:26 pm

Re: multiline locals definition with assignment?

Postby ArrayMac227 on Mon Sep 09, 2019 2:31 pm

Does the monadic ; work like ⎕shadow?

Can you pare down the example:
. remove rarg,
. pass output as a result,
ArrayMac227
 
Posts: 62
Joined: Sat Sep 12, 2015 1:40 pm

Re: multiline locals definition with assignment?

Postby Adam|Dyalog on Sun Sep 15, 2019 12:06 pm

There is no primitive called monadic ;. It is just that functions can "continue" the header line [0] on subsequent lines before any actual code.

This means that all locals, even those declared after line [0] are localised upon entry into the function, unlike ⎕SHADOW which dynamically localises when executed, adding an additional stack frame to do so.

Full documentation is available at https://help.dyalog.com/17.1/Content/La ... 0Lines.htm
User avatar
Adam|Dyalog
 
Posts: 135
Joined: Thu Jun 25, 2015 1:13 pm


Return to Chat

Who is online

Users browsing this forum: Bing [Bot] and 1 guest