Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #199100

Re: yabasic problem

From "Thomas Schmitt" <scdbackup@gmx.net>
Newsgroups linux.debian.user
Subject Re: yabasic problem
Date 2018-08-20 19:50 +0200
Message-ID <woWtr-ym-7@gated-at.bofh.it> (permalink)
References <woUUF-8en-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

Richard Owlett wrote:
> With a good filename, nothing printed.
> With a bad filename, it reports file not found.

But it does not abort at that point, does it ?

When the file name is bad, is the resulting filenumber 0 ?
If not: Can you read or write to that filenumber ?

I cling so massively to the theory of a sticky error indicator because
that is exactly what the indicator variable "errno" does in C and what
is described in man 3 errno.


Read The Source Luke:

peek$("error") is probably implemented in
  https://sources.debian.org/src/yabasic/1:2.79.2-1/function.c/#L1582
which hands out a copy of variable "errorstring".

A search for "errorstring" by
  https://codesearch.debian.net/search?q=package%3Ayabasic+errorstring
yields only one match where this variable's content is reset. That's
when it gets created at yabasic startup:
  https://sources.debian.org/src/yabasic/1:2.79.2-1/main.c/?hl=116#L117

All other occasions fill it with new error texts or put it out.
So it does not get cleared when command "open" succeeds.

See its implementation in
  https://sources.debian.org/src/yabasic/1:2.79.2-1/io.c/?hl=683#L683
The message
  "No such file or directory"
probably stems from the C function strerror(3) via my_strerror()
  https://sources.debian.org/src/yabasic/1:2.79.2-1/io.c/?hl=683#L804
  https://sources.debian.org/src/yabasic/1:2.79.2-1/main.c/?hl=2402#L2406

To fix this stickiness of error indicators, i would insert at the start of
myopen() around
  https://sources.debian.org/src/yabasic/1:2.79.2-1/io.c/?hl=683#L701
the statement

  errorstring[0] = 0;
  errorcode = 0;

... or somewhere more upwards, in the big interpreter loop ...


Hey, that's something HP BASIC never allowed us. Peeking into its code
and making perky proposals.

-------------------------------------------------------------------------

> This project started out in Tcl, which I visualize as a super-BASIC.

How that ?
Tcl is a strange script language with the only adavantage that together
with its sibling Tk it is the GUI toolkit with the least dependencies.
But as procedural language it is really substandard.
It was an exercise in stubbornness to finish
  https://dev.lovelyhq.com/libburnia/libisoburn/raw/master/frontend/xorriso-tcltk
and i had to build a text parser into xorriso's C code because doing
proper unquoting in Tcl was flatly impossible to me.


> Due to inexperience I got lost in how Tcl handled my JSON data.

You perhaps used some of these ?
  https://wiki.tcl-lang.org/13419
Their number raises suspicion. Why so many of them ?


> Now that I have yabasic reading/writing files I've solved my program logic
> problems.

So you want a decent procedural language. That's a healthy wish.
But Tcl is really not such a language.


Have a nice day :)

Thomas

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-19 15:10 +0200
  Re: yabasic problem <tomas@tuxteam.de> - 2018-08-19 15:40 +0200
    Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-19 16:00 +0200
      Re: yabasic problem Curt <curty@free.fr> - 2018-08-19 16:30 +0200
        Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-19 17:10 +0200
          Re: yabasic problem David Wright <deblis@lionunicorn.co.uk> - 2018-08-20 01:30 +0200
            Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-20 09:40 +0200
              Re: yabasic problem Jim Popovitch <jim@k4vqc.com> - 2018-08-20 10:00 +0200
              Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-20 14:20 +0200
                Re: yabasic problem Mark Fletcher <mark27q1@gmail.com> - 2018-08-20 14:40 +0200
                Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-20 15:40 +0200
                Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-20 15:30 +0200
                Re: yabasic problem Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-20 15:40 +0200
                Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-20 16:00 +0200
                Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-20 18:10 +0200
                Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-20 19:50 +0200
              [OT] Re: yabasic problem David Wright <deblis@lionunicorn.co.uk> - 2018-08-20 17:10 +0200
                Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-20 18:50 +0200
      Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-20 14:00 +0200
        Re: yabasic problem <tomas@tuxteam.de> - 2018-08-20 17:20 +0200
          Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-20 21:40 +0200
  Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-19 15:50 +0200

csiph-web