I have spent the day adding a Pike column to some more language comparisions on the net, and thought it wise to save some info on where Pike failed:
Python and Perl has a three way (</=/>) comparision function "cmp". Should Pike have one, and where?
Possibly.
Pliant has a four way (</=/>/not comparable) comparision function "compare". Should Pike that instead or at all?
Probably not.
Should we make an eval function like most other languages. mixed eval(string x) { return compile_string("mixed foo(){ "+x+";}")()->foo(); }
I don't think so. Python/Perl emphasize runtime compilation, Pike does not. (For god reasons)
Should we have an identity function for the fun of it (Haskell has id and Smalltalk has yourself)?
Possibly, but what should it be called?
Should upper_case and lower_case be able to operate on integers (chars)?
Why not? Please submit a patch :)
Should we add Array.shift and Array.pop to remove elements in either end of the Array?
That wouldn't work (well), since array sizes cannot be modified destructively. You would have to encapsulate the array in another class first.
Note that arr=arr[1..]; and arr=arr[..sizeof(arr)-2]; are fairly well optimized, so there would probably be no need to implement this class in C.
Should we add Array.zip and Array.unzip to merge and split arrays.
What would that do?
Should we add Array.partition that splits an array into two (like filter with two outputs)?
What would that do?
Should we add Array.exists/any to determine if at least one element satisfies a criterion and Array.every/all to determine if the all are?
Possibly.
Should we add the possibility to define default values for types, e.g. typedef int myint = 7;
No. Although, you can already do typedef int(7..7) myint;
Do we need a Math.divmod?
Probably not, when would you use it?
Questions, questions...
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2003-09-03 16:26: Subject: Language comparisions
I have spent the day adding a Pike column to some more language comparisions on the net, and thought it wise to save some info on where Pike failed:
Python and Perl has a three way (</=/>) comparision function "cmp". Should Pike have one, and where?
Pliant has a four way (</=/>/not comparable) comparision function "compare". Should Pike that instead or at all?
Should we make an eval function like most other languages. mixed eval(string x) { return compile_string("mixed foo(){ "+x+";}")()->foo(); }
Should we have an identity function for the fun of it (Haskell has id and Smalltalk has yourself)?
Should upper_case and lower_case be able to operate on integers (chars)?
Should we add Array.shift and Array.pop to remove elements in either end of the Array?
Should we add Array.zip and Array.unzip to merge and split arrays.
Should we add Array.partition that splits an array into two (like filter with two outputs)?
Should we add Array.exists/any to determine if at least one element satisfies a criterion and Array.every/all to determine if the all are?
Should we add the possibility to define default values for types, e.g. typedef int myint = 7;
Do we need a Math.divmod?
Questions, questions...
/ Martin Nilsson (ja till euro, nej till cent)