« first day (28 days earlier)      last day (2920 days later) » 

Ven
Ven
16:53
I remember trying -script for Dyalog APL, but it not doing what I wanted (I think it was the namespace thingie that was off...)
 
2 hours later…
19:22
@Ven I don't think that will work as intended.
Ven
Ven
really? it works for my use-cases :(
I don't know Ruby (is that what it's in?), but can you try tio.run/nexus/…
Ven
Ven
yes, that's Ruby. it's code to launch dyalog and make it shut up about the workspace and all. -script didn't work when I last tried.
@Ven Dyalog doesn't have a universal way to use scripts as the world understands scripts. I'm pushing hard for this. Gave a long talk about it at our yearly planning meeting.
 
1 hour later…
Ven
Ven
20:53
@Adám Yes, I've come to realize this, hence this ruby script. I've long tried to find stuff in the docs, about SALT and all, but :(
@Ven I'll be happy to help out. FOR TIO's purposes, I think Dennis's solution is pretty solid. What are you trying to accomplish?
@Ven Can you join me inhttp://chat.stackexchange.com/rooms/52405/apl?
Ven
Ven
21:29
@Adám I'm just trying to feed some scripts and get the results printed. i.e. something you'd usually see in a #!/usr/bin/apl
@Ven If your script would be something you could type into the APL session, then you can just pipe into dyalog.exe.
@Ven Yes, but lots of things cannot be done in the session. E.g. you cannot define multi-line dfns.
Ven
Ven
yeah :[ I know. but it was the simplest way I found.
I talked about this a bit with Morten during the Paris APL user meetup, a few months ago.
@Ven And?
Ven
Ven
21:36
he said you guys were looking into ways to store code more easily as "code", rather than in some special format
as well as other things
@Ven That's .dyalog files he is talking about. That's what Dennis uses.
Ven
Ven
alright
Ven
Ven
Sorry :)
Yes, so -- .dyalog files. Would they work for scripting purposes? Do I absolutely need a namespace around them?
Yes, and no
Ven
Ven
21:40
so, I can just do as I did before, but instead of piping store them as .dyalog? Do I get the automatic print like before?
23 messages moved from talk.tryitonline.net
@Ven depends on what you are doing.
You can store any array, function, operator, namespace, or class in a .dyallg file
Of course, namespaces and classes can contain more of the above.
The easiest way to create such script files (and thus to see what their format is like), is to use ]save: E.g. say you have a function called foo in your workspace; just enter ]save foo /tmp/ into the session.
You don't need to save your workspace. When you want to use your function, just type ]load /tmp/foo
@Ven under program control you can use 2 ⎕FIX 'file:///tmp/foo.dyalog' to load it.
Ven
Ven
I'd prefer writing that by hand :)
21:52
@Ven So that was my question, what you want to accomplish. If it is just keeping your APL source code in human readable files, ]save and ]load (and ]snap for batch processing) is the way to go. For automated execution of arbitrary code, use ⎕FIX.
Ven
Ven
Imagine I'm doing all this remotely and don't have access to the Dyalog itself
well I guess I should look at RIDER nowadays but anywya.
I'm programming APL via ssh
That shouldn't make a difference.
Ven
Ven
I can't open Dyalog and type quad-fix
But don't you have a terminal connection to a running dyalog.exe instance?
Ven
Ven
no
I mean, I can launch one, but I'd need to emit )OFF like I do
21:56
@Ven You always have to end with )off or ⎕off.
Ven
Ven
:(
Why :(?
Ven
Ven
I'm adding that )off manually in the runner
@Ven Wait, so you are trying to automate running arbitrary code?
Ven
Ven
yes, from a .dyalog file
22:03
@Ven I see, so why don't you just pipe in a ⎕FIX statement followed by ⎕OFF ?
.dyalog scripts cannot be piped into APL.
Ven
Ven
@Adám echo -e "2 ⎕FIX 'foo.dyalog'\n)off" | dyalog, huh?
I need to try this
almost: echo -e "2 ⎕FIX 'file://foo.dyalog'\n)off" | dyalog, huh?
oh, and another newline after )off
This is pretty much what Dennis does. (with one little caveat)
Ven
Ven
why is Dennis generating namespaces, though?
Because the .dyalog file must define something, not just contain arbitrary code. Now users of TIO don't need things, they just want to execute some code or define some functions and use them. So Dennis wraps the user submitted code in a namespace wrapper. Thus ⎕FIX has a thing (a namespace) to define.
Ven
Ven
Yeah :/
22:10
Remember that .dyalog files are meant to be created by ]save, which - duh - saves things.
Ven
Ven
I understand, but that's not my use case.
ok.
Ven
Ven
I'll probably end up doing the same as dennis is, to allow for multiline defns.
You can already define one or more multi-line dfns with 2⎕FIX, without :namespace'ing.
Ven
Ven
ah, right, because I'm defining something.
22:12
Yep.
Ven
Ven
So any <- (`[) in the file is enough?
huh? that doesn't look like APL.
Ven
Ven
I mean a ← 5
For variables, you need to prefix , and must use ]load or ⎕SE.SALT.Load to load them back.
So ⌷a←5 is a valid .dyalog file
Ven
Ven
It's all very complex :P. So I can just prepend ⌷xxx←5\n to any .dyalog file and run it that way. Thanks
22:18
Sorry for the complexity. That's why I fight for 3 ⎕FIX to just do what you'd expect :-|
Ven
Ven
Haha, thanks. Well, I just posted a permalink to one of the messages in a github issue for future reference.
Thanks, you provided a lot more info than the "kids those days don't know how to do anything by themselves" I got in comp.lang.apl.
You are always welcome to contact me here or write support@ or adam@
for variables: ⌷name←expression - use ]load or ⎕SE.SALT.Load
Ven
Ven
Thanks for the reads up :). It's not like anything is outliving the .dyalog file.
for tradfns, dfns, namespaces, classes: 2 ⎕FIX 'file://path/file.dyalog'
Ven
Ven
so I do still have the wrap the whole file as a NS.
I'll just copy TIO.
22:23
@Ven If you want execution of arbitrary code (i.e. could be expression, could be function definitions, could be variable assignments), yes.
Ven
Ven
alright, that sums it up :D
@Ven Good idea. Dennis and I spent two night getting it almost right.
@Ven And now, to break your spirit: expressions in a :namespace script do not have implicit display of result. :-( Boo!
Ven
Ven
yeah I expected that one :P.
It's fine, I can just add some []<-
Alright, bedtime. Thanks&gn.
@Ven Good night.

« first day (28 days earlier)      last day (2920 days later) »