arithmetics Re: command modifiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> To list of my failed shell inventions[0], i'd like to add following.
> 
> [0] ftp://flower.upol.cz/dts/ash0000_var/ideas

Arithmetics is the basic knowledge, anyone must have and develop over the
whole life. (i'm a dreamer)

Yet this is not the case in shell:

   original calculating size of variables in `sh` with `expr` and regular
   expressions. (no comments)

Now feature is implemented in shell natively, yet:

* only signed 32 values (don't say it's POSIX)
* "small" and "fast"` dash` has it in bulky bison and stuff (ou, crap)

For start, size and sign (thus, easy seek() in /dev/kmem, for example)

$(s32(...)) || $(s(...))
$(u32(...)) || $(u(...))
$(s64(...)) || $(ss(...))
$(u64(...)) || $(uu(...))

if this will have problems with $(), then more stupid postfix form:

$((...)s); $((...)uu)

Extending to the future: u128, or uuuu, etc.

maybe even to have

sizeof(s||u) = 32b; sizeof(S||U) = 16b; (for flexibility with 16-bit);
____
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux