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⍴,⊂''}⍬
@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)
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)
⍞ 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
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?