The hook
'see?' ]# 1 2 3 4
4
works fine...
greg
~krsnadas.org
--
from: 'Pascal Jasmin' via Programming
to: "programm...@jsoftware.com"
date: 19 May 2014 22:01
subject: Re: [Jprogramming] Understandable J
is that special code? because its not supposed to work ie:
'see?' # 1 2 3 4
|domain
This is standard J.
Here's how it works:
'see?' (] +/ % #) 2 3 5 7
The verb here is a hook. The above is equivalent to:
X=: 'see?'
U=: ]
V=: +/%#
Y=: 2 3 5 7
X (U V) Y
And this gets evaluated as:
X U (V Y)
Here, V Y evaluates as 4.25
So we can simplify to
X U 4.25
Substituting
is that special code? because its not supposed to work ie:
'see?' # 1 2 3 4
|domain error
The above (] +/ % #) is even a special parsing rule?
At any rate, the conventions I use help the one who will read my code the most,
but I'd still recommend to anyone to avoid long hooks.
- Origin
That's an interesting line of thought.
Note that we can take a fork and ensure that we always use its monadic
definition by prefixing it with the verb ]
Here's a mean example:
mean=: ] +/ % #
mean 2 3 5 7
4.25
'see?' mean 2 3 5 7
4.25
Now obviously there isn't a lot of need for this kind
Here are some ways to improve readability for me:
lets take,
quicksort=: (($:@(<#[),(=#[),$:@(>#[))({~ ?@#))^:(1<#)
the first step is spacing out the train:
quicksort=: (($:@(<#[) , (=#[) , $:@(>#[)) ({~ ?@#)) ^: (1<#)
the next step is avoiding the hook that takes a while to find due to all th
Agreed but both need attention- often the most refined program may be
the hardest to read.
Don
On 17/05/2014 9:31 PM, 'Bo Jacoby' via Programming wrote:
Improve the program rather than the documentation.
Den 4:49 søndag den 18. maj 2014 skrev Don Kelly :
I find that putting code with lo
Those of us fortunate enough to be using emacs for J have a "code-folding
mode" available to us - http://www.emacswiki.org/emacs/FoldingMode - though
I have not used it (and it requires tagging the source with indicators to
show the start and end of folding regions). Also, the J-mode in emacs has
>More terseness is always great for our weary eyes;-)
>For me the single biggest piece of help when looking at a large .ijs file
>would be code-folding. Are there any patches that would avail this in Kate?
>There is a nice color coding addon for it, but i have been unable to find a
>code folder
For me the single biggest piece of help when looking at a large .ijs
file would be code-folding. Are there any patches that would avail
this in Kate? There is a nice color coding addon for it, but i have
been unable to find a code folder.
greg
~krsnadas.org
--
from: Eldon Eller
to: programm...@
Doesn't a paragraph of explanation vitiate the terseness of J?
On 05/19/2014 11:21 AM, Brian Schott wrote:
Below is an example of monadic Note.
I have no sense of how dyadic Note would help.
Note 'How Note works'
Note works likes this.
Enter any text for a comment
and when you are done, jus
Don,
I just don't understand.
Could you give an example, please?
On Mon, May 19, 2014 at 2:25 PM, Don Guinn wrote:
> The left argument could be a definition name or controls for adding to
> help.
>
> --
(B=)
--
For information
The left argument could be a definition name or controls for adding to
help.
On May 19, 2014 12:21 PM, "Brian Schott" wrote:
> Below is an example of monadic Note.
> I have no sense of how dyadic Note would help.
>
>Note 'How Note works'
> Note works likes this.
> Enter any text for a comment
Below is an example of monadic Note.
I have no sense of how dyadic Note would help.
Note 'How Note works'
Note works likes this.
Enter any text for a comment
and when you are done, just
type a right paren on a line
by itself.
)
On Mon, May 19, 2014 at 11:33 AM, Don Guinn wrote:
> Don't forg
Also, depending on which frontend you're using, there's also a menu item to
"Toggle ASCII Box Drawing" in the QT frontend for J8, it's under the
"View" menu. Not sure about JHS or any of the other frontends.
-Dan
- Original Message ---
Subject: Re: [Jprogramming] box character to
The problem is that I can't possibly think of all the fun-ruining "cheats"
in advance. Use your best judgement, and I'll do the same when it comes
to evaluating submissions.
I don't want to rule out string literals or undefined names or even based
constants entirely, because judicious use of th
I wrote:
> Solutions which are overreliant on character literals (e.g.
> #'abcdef..!@$...') or undefined names (e.g. abc`def`ghi etc) will be
> considered cop-outs and be disqualified. If there is more than one
> shortest program, the first to be posted (based on Forum timestamp) will
> be dec
Note that there are multiple concepts of "use". You might want to be more
specific about that.
For example, here's an expression which uses every ascii character:
128{a.
You might have meant where every printable ascii character appears in the
script of the program. But that raises another qu
Write the shortest valid J program that uses all printable ASCII
characters. More specifically, write a J program which:
- Doesn't raise an error
- Returns something other than itself (e.g. 'abcde...!@$%' doesn't count;
a ;: c / @ e. i: .. doesn't count, etc).
- Uses each of the following char
Don't forget about "Note". I like to use the right argument as a title or a
one line description. Then put the detailed description below. This gives
the possibility to provide self-documenting by redefining "Note" to extract
information for help. And we still have the left argument to play with.
FYI there is a verb boxdraw_j_ in stdlib.
Пн, 19 май 2014, David Lambert писал(а):
> My email system peppers j forum mail with question marks. 40% of the j
> session characters in a recent post came to me as question marks. As has
> been previously mentioned, changing the box drawing characters mi
My email system peppers j forum mail with question marks. 40% of the j
session characters in a recent post came to me as question marks. As has
been previously mentioned, changing the box drawing characters might
help to alleviate the problem. Hence I offer this box character toggling
verb, whi
Time and again I find an example of correct usage to be the most helpful
starting point for figuring out how something works. All too often we see
people post requests for help with J code in these forums without providing
any working example of what they have so far or an example of what they
exp
Joe Bogner wrote:
> Here's a hack for enabling tab name completion in jhs:
Thanks, this is interesting hack.
I had to use
var current = rows[rows.length-1].innerHTML.replace(/ | /g,'').trim();
in my browser, and i still want it to complete partial names in the middle of J
sentence, but this
Bo,
I don't quite understand ordinal fractions, but my intuition suggest that
22 would be correct for Inställningar. Would you explain why you say 21?
But more importantly, why are you suggesting ordinal fractions for the
representation here, anyway? How does that representation facilitate the
sc
24 matches
Mail list logo