Empty frame, or more accurately zero frames, if it is said to be for
anything, is to allow edge cases, the case where the frame contains a 0, to
work without a lot of exceptions, without the programmer having to write
extra code. An example hopefully illustrates this point.
x ,"1 y=: i.3 4
10 20 30 0 1 2 3
10 20 30 4 5 6 7
10 20 30 8 9 10 11
In this case the left frame is '' and the right frame is }:$y, (,3) in this
case.
x ,"1 y=: i.2 4
10 20 30 0 1 2 3
10 20 30 4 5 6 7
x ,"1 y=: i.1 4
10 20 30 0 1 2 3
x ,"1 y=: i.0 4
The right frames in the successive examples are (,2), (,1), and (,0). The
last is an example of a zero frame, and the example worked with no fuss.
The following sequence makes more salient the consistent treatment of
frames, including zero frames.
$ x,"1 y=: i.3 4
3 7
$ x,"1 y=: i.2 4
2 7
$ x,"1 y=: i.1 4
1 7
$ x,"1 y=: i.0 4
0 7
The reason why zero frames requires extra discussion is because ordinarily
you have argument cell(s) for the verb to apply to, and the result cells
and hence the result is not in question. With zero frames, there are no
argument cells, so the system needs to do something extra (so that you
don't have to). (x,"1 y appends vectors to vectors, but when y is i.0 4 it
does not have any vectors.)
On Thu, Jan 14, 2016 at 10:35 PM, Matthew Baulch <[email protected]>
wrote:
And the dictionary defines frame.... such that it may be empty? I'm most
interested in whether, supposing this is the case, allowing empty frames
serve (an)other purpose(s) in the structure of the language.
Apologies if my original phrasing was unclear.
Every decision in the design of J seems very deliberate—which I really
appreciate. It just seems that empty frames must serve a purpose. Trying
to
work it out.
On 15 Jan 2016 4:21 pm, "bill lam" <[email protected]> wrote:
The J dictionary is always correct.
Пт, 15 янв 2016, Matthew Baulch написал(а):
Fair enough, though I can't work out whether the dictionary agrees
with
NuVoc here or not. Either way, which definition of frame is correct?
On 15 Jan 2016 3:48 pm, "bill lam" <[email protected]> wrote:
For J implemention, the only authority is the J dictionary since
it defines the J language. You need not worry anything else.
http://www.jsoftware.com/help/dictionary/dictb.htm
Пт, 15 янв 2016, Matthew Baulch написал(а):
I assume the intended definition of 'frame', in relation to verb
arguments,
is that given on
http://code.jsoftware.com/wiki/Vocabulary/FramingFill
I'm just trying to understand verb/argument combinations with
empty
frame--the most common case, I suppose.
From the wording "each argument is ... an array of [r-cells]. The
frame
...
is the shape of this array of [r-cells]", it seems that a frame
should
never be empty, but in fact have a minimum shape of '1'. Of
course,
this
ties into the wording of many other statements. In the case of
dyadic
verbs, for instance,
"frames must agree ... they must be identical or one must be a
prefix of
the other" (stated in link above)
as opposed to
"frames must agree ... one must have shape 1 or be a prefix of
the
other"
(the way I see it, assuming equality implies prefix-of)
Can anyone shed some light on this? Is there an important reason
for
this
convention that I'm missing, or is it of little consequence?
I'm implementing (or trying to...) a subset of J for the JVM, and
this is
one little detail that's bothering me.
Thanks.
Matt Baulch
----------------------------------------------------------------------
For information about J forums see
http://www.jsoftware.com/forums.htm
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
----------------------------------------------------------------------
For information about J forums see
http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see
http://www.jsoftware.com/forums.htm
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm