The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
list functions sugestion
09-20-2015, 07:55 PM (This post was last modified: 09-20-2015 08:40 PM by hpfx.)
Post: #1
list functions sugestion
Hello,
I've functions suggestion, it's related to list in programs.

GET(L1,n)
get n-th item of the list
ex :GET({1, 2, 3},2) -> 2

FOREACH L1 AS var;
END;

to iterate lists items.
ex: FOREACH {1,2} AS it; PRINT(it);END;
note : or with alternative syntax (less block style) : FOREACH(L1,var); END;


Arr2List() and List2Arr()
convert array (vectors, matrix) to list and reverse..
ex:Arr2List([1, 2]) -> {1, 2}
Arr2List([[1, 2][3,4]]) -> {{1, 2}{3,4}}


Let me know your feeling about such suggestion, I do really like to have a foreach function like in many modern language, it makes life simplier to iterate into lists.

And please, add a Lists menu in Cmds (program editing), to show existing list command like SIZE, SUB, POS ...
Otherwise it's not obvious o guess such functions does exists...
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
list functions sugestion - hpfx - 09-20-2015 07:55 PM
RE: list functions sugestion - komame - 09-20-2015, 08:41 PM
RE: list functions sugestion - hpfx - 09-20-2015, 08:49 PM
RE: list functions sugestion - komame - 09-20-2015, 08:53 PM
RE: list functions sugestion - hpfx - 09-20-2015, 08:59 PM
RE: list functions sugestion - douganc - 09-21-2015, 07:15 AM
RE: list functions sugestion - parisse - 09-21-2015, 09:15 AM
RE: list functions sugestion - hpfx - 09-22-2015, 08:04 AM
RE: list functions sugestion - Tyann - 09-22-2015, 11:06 AM
RE: list functions sugestion - komame - 09-22-2015, 01:25 PM
RE: list functions sugestion - hpfx - 09-24-2015, 02:53 PM



User(s) browsing this thread: 5 Guest(s)