« first day (2245 days earlier)      last day (394 days later) » 

5:30 AM
Contest Phase 2, Task 3: Objective function "returns a character vector representing the protein string made by translating the codons into their corresponding amino acids or stop signals."
I'm interpreting this to mean that prot should stop translating at any stop codon; however, I realized there's a reading where prot just naively spits out sequences of amino acids, including the stop pseudo-amino acid.
What's the intended reading here?
 
 
4 hours later…
9:03 AM
@B.Wilson If you look at the big example, input and output given as files, you'll find that stop codons are simply ignored.
 
9:14 AM
@Adám IIUC, both examples contain a single stop codon at the end.
So, "including the stop pseudo-amino acid" is clearly wrong, then.
Still, I'm slightly unsure whether "ignore everything after the first stop codon" is what the question is asking for.
 
9:35 AM
@B.Wilson Oh, you're right. I had an offset in my reading, and saw stops in the middle. Sorry.
 
 
1 hour later…
10:55 AM
Just when I think I understand the BG parsing, something crops up. I am not sure what this means:
      ⎕cy'dfns'
      defns ← scripts._defs
      try ← (0 defns parse'')∘parse
      try'x←5⋄x+1'
┌───────┬─┬───┐
│    XL │N│ A │
│  ┌─┴─┐│x│┌┴┐│
│ ┌┴─┐ ⋄│ │+ 1│
│┌┴┐ 5  │ │   │
│x ←    │ │   │
└───────┴─┴───┘
All I can think is that the parser gives up after the diamond, given that it doesn't know what x is.
Or that the x type (unassigned name) in the grammar doesn't do what I think it does.
But the array type doesn't work:
      try'a←5⋄a+1'
┌─┬────┬──┬─────┐
│A│ ERR│XL│  A  │
│a│┌┴┐ │⋄ │ ┌┴─┐│
│ │← 5 │  │┌┴┐ 1│
│ │    │  │a +  │
└─┴────┴──┴─────┘
Can I get ChatGPT to be John Scholes?
 
11:25 AM
 
12:12 PM
It must have scraped the dfns site, because it manages to not make a fool out of itself, explaining the result of your code.
 
12:31 PM
Hmm. It suggests that x←5⋄x+1 should evaluate to 6, which you can't argue with. But getting it to say why the parse tree comes out like it does ends up in a hallucination.
As an aside, my wife's using it to explain Swedish grammar occasionally, and it's disturbingly flawless. But I guess it's digested every book on the subject since the dawn of time.
 
12:43 PM
@xpqz Looks like the second x token (incorrectly) gets the type N, is all.
       try'x←5⋄5+1'
        A
     ┌──┴──┐
   ┌─┴─┐  ┌┴─┐
  ┌┴─┐ ⋄ ┌┴┐ 1
 ┌┴┐ 5   5 +
 x ←
Since both XL N and N F don't bind, that's why you get the 3-vector with x sitting all by itself.
 
Yeah, although after some pondering it's probably not incorrect -- since the parse function carries no variable state (it doesn't evaluate), it can't know that x is an array after the diamond.
Well, clearly the parse tree is nonsense, but it's probably expected nonsense.
 
1:01 PM
"It's not incorrect. It's behaving exactly as it does!"
But yeah, it's moderately surprising that Diamond and Arrow are in the binding table at all, given the stateless, crystalline beauty of the thing.
 
1:18 PM
 
2:13 PM
This paper was shared on libera.chat#apl: Karl Fritz Ruehr, A SURVEY OF EXTENSIONS TO APL, 1982. Looks like a fun read.
 
 
2 hours later…
4:04 PM
@Adám can you set a conditional breakpoint, stop here if x>y?
(in the debugger, obviously)
 
 
2 hours later…
5:50 PM
@xpqz Only as actual code: (1+(x>y)/⊃⎕LC)⎕STOP⊃⎕SI
 
One day I will write a tutorial/webinar on this stuff; only way to force myself to learn it properly.
Unless someone beats me to it.
 
Maybe this one should go on APLcart.
 
6:04 PM
Are these tricks just oral history, or is there some cheat sheet or debug-specific documentation somewhere -- I can't see it anywhere, but perhaps I don't know where to look.
 
Less than that. I came up with this one.
We do have a proposal, however, to extend ⎕STOP to take a Boolean as right argument, and stop "here" if that.
 
How about a right-click on the red dot in RIDE and let the user enter a boolean expression .... too early for April Fools' jokes?
I obviously know that there is no need for APL debugger magic, as real APL programmers get it right the first time.
 
6:27 PM
@xpqz Sure, although not related to RIDE per se, a "watch point" feature would be awesome. Here's a hack that implements it, but requires global x and y:
∇watch_x
 :Implements trigger x
 ((x>y)/2⊃⎕LC)⎕STOP(2⊃⎕SI)
∇
Then e.g. the following function stops appropriately:
∇foo
 :For x :In ⍳10
     ⎕←x
 :EndFor
∇
 
I don't understand why or how that works. Too much magic.
 
Trigger functions are cool voodoo
 
@xpqz watch_x gets called whenever the value of x is changed.
 
I just spotted the trigger docs.
 
Actually, it should say :Implements trigger x,y as x can become larger than y because y changed.
 
6:37 PM
So a trigger basically can change stuff behind the user's back whenever someting is touched. I am not sure if I should grin evilly in anticipation of the fun one could have with that, or shake my head in disbelief. Maybe a bit of both.
 
With great power comes great responsibility…
Did I ever show you some of the fun you can have with output events?
 
Nope...
 
E.g. try ⎕SE.onSessionPrint←⎕FX,⊂'P←{⎕←⌽⎕FMT⍺}'
Or ⎕SE.onSessionPrint←⎕FX,⊂'P←{⎕←(-⎕PW)↑⍤1⎕FMT⍺}'
 
That seems to right-adjust the output.
Ok, the first one ... is ...
       ⎕SE.onSessionPrint←⎕FX,⊂'P←{⎕←⌽⎕FMT⍺}'

      3 3⍴⍳9
3 2 1
6 5 4
9 8 7
Let's install that on TryAPL for a bit.
 
I smell a good April Fool's trick in the making
 
6:50 PM
@Adám going back to the break point thing, could I hang something like that on a user command? ]break x>y for a conditional breakpoint at the current location?
A trigger though would stop whenever the condition is fulfilled, not specifically when passing a specific line in the code?
So at the line of modification? I'm speculating here.
 
@xpqz Correct, although you can check in the trigger fn that the location is also as required.
@xpqz Read up on ⎕STOP — it simply sets the red blob for the next line in the function that did the modification.
 

« first day (2245 days earlier)      last day (394 days later) »