« first day (2220 days earlier)      last day (435 days later) » 

12:21 AM
From inside a dfn, can I call ⎕ed on a local variable without creating a global? I want to use it to take input in a convenient way without polluting the global namespace
{x⊣'∊'⎕ed'x'}⍬ for example
ah, seems like it works if I initialise x to the right type (otherwise it was readonly), {⍎⎕ed'x'⊣x←0⍴,⊂''}⍬
 
 
4 hours later…
4:17 AM
@rak1507 That's interesting. What about using Character Input?? Something like IN←0⍴⊂'' ⋄ {⍞}⍣{⍺≡,'END': 1 ⋄ 0⊣IN,←⊂⍺} will accumulate a vector of lines into IN which can be easily Fixed, ⎕NPUTed etc.
 
@B.Wilson yeah, that's reasonable, but having an edit window is quite nice for this use case (I'm thinking of using it to memorise long-ish lists of words, so being able to go up lines/edit things/etc is useful)
 
@rak1507 Ah. Cool. Making an custom Anki replacement?
 
sorta, but scrabble related, also having it be programmable is nice as I can easily ask to test 'find all 4 letter words with xyz' or whatever
there are already anki-like things for scrabble (spaced repetition of anagrams) but I think approaching it from multiple angles is probably good for learning (well, that's the hope anyway)
 
Noice.
 
⍞ will do for single input or short lists (space separated) but ⎕ed is better for longer lists >10 elements
as much as generally I like having the editor be separate in most languages, the integration is convenient here, not having to import a gui library etc to get a simple text box
 
4:33 AM
Yeah, sounds like you found a decent workflow.
 
 
11 hours later…
3:39 PM
Announcement: BAA Webinar in 20 mins. See here for details.
 
 
7 hours later…
10:48 PM
What is the idiomatic way to suppress the output of the result of a line run for its side-effect in a tradfn?

the best i've come up with is: {}foo 123
 
@pamphlet That's it.
 
ok, thanks!
 
11:02 PM
and just for completeness, if you want a non-terminating side-effect in a dfn, i assume you assign into a "garbage" local. Is there a standard that folks use? (x←), etc?
 
11:33 PM
@pamphlet many use _←
 
perfect, thanks again!
 

« first day (2220 days earlier)      last day (435 days later) »