[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Re Atari BASIC versis Python versus Lua in 1982...
- From: Martin <eden_martin_fuhrspam@...>
- Date: Sat, 18 Mar 2017 03:49:43 -0700
On 03/17/2017 01:19 PM, Sean Conner wrote:
>> Lua is missing simple but
>> powerful string manipulation functions as the Basic has.
> What? All I recall of BASIC string manipulations are LEFT$(), RIGHT$(),
> MID$() and STRING$(), all of which can be replaced with string.sub() in Lua.
> I recall those being pretty typical of the time.
There are more.
LEFT$/RIGHT$/MID$ - get part of string
MID$ - set part of string
~ string.len, # operator
LTRIM$/RTRIM$ - trim spaces
INSTR - find substring
STRING$/SPACE$ - repeat one char <n> times,
MKI$/CVI/... - codecs to internal number formats (int, dbl, float, ...)
Generally I feel Lua functions more generic, more powerful and
harder to master.
Surely they are completely different languages. Lua is a more
language itself, with central abstractions on tables, first-type
functions and variable code. While QBASIC is a fixed interface to
hardware that was available at that time. Lua is good for processing
complex data structures while QBASIC is good for implementing UI.
(BTW for Lua is a nice library Love2D which affords similar
functionality as QBASIC - almost direct access to hardware without
predefined UI elements.)
(And I think that niche for data processing are still almost empty.
Only regexps are there. (And probably map/reduce.))
(Yes, we can do anything with C/Go/Pascal/Ada/.. but sometimes
marginal simplicity and narrower application field are needed to
implement complex things.)