Problem with WebSocketSample

MiServer is Dyalog's APL-based web development framework

Problem with WebSocketSample

Postby PGilbert on Sun Jul 12, 2020 12:14 am

The function WebSocketSample on GitHub (https://raw.githubusercontent.com/Dyalo ... ple.dyalog.) does not work for me.

I copy the code of the link in a )clear WS and create the fn WebSocketSample and type WebSocketSample ''

The HTMLRenderer is showing the correct window and the debug window is shown as expected.

When I click on the Open button, I am getting the following error in the interpreter:

      VALUE ERROR: Undefined name: show
WebSocketSample[150] ⎕←'obj ev wsid url hdr auto'show args


The function 'show' is not defined hence the error and I don't see where it is.

Could someone show me where it is? Thanks in advance.

P.S.: Also, this function is expecting an ⎕ML←1 workspace and our standard is ⎕ML←3.
User avatar
PGilbert
 
Posts: 436
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: Problem with WebSocketSample

Postby Brian|Dyalog on Sun Jul 12, 2020 8:33 pm

Hi Pierre,

Thanks for pointing out that the show function wasn't defined in WebSocketSample. Strangely enough, I had included it in my local copy but apparently hadn't pushed it to GitHub; it's there now.

As for ⎕ML (and ⎕IO), our standard practice is to write tools and samples using ⎕ML←1 and ⎕IO←1 unless there's an overriding reason to do otherwise. However, we should set and localize them so that the code should run in whatever environment our users happen to have set. I've done so with WebSocketSample and pushed the changes to GitHub.

I hope this helps!
/Brian
User avatar
Brian|Dyalog
 
Posts: 116
Joined: Thu Nov 26, 2009 4:02 pm
Location: West Henrietta, NY

Re: Problem with WebSocketSample

Postby PGilbert on Mon Jul 13, 2020 3:41 am

Thanks, it's working now. Coming from APL2000, ⎕ML←3 is more natural for me.
User avatar
PGilbert
 
Posts: 436
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada


Return to MiServer

Who is online

Users browsing this forum: No registered users and 1 guest