Star-Dust Expert Licensed User Longtime User Oct 14, 2018 #1 Today browsing a little haphazardly on the web, but throwing an eye to operating systems, I came across Plan 9, an old operating system derived from Unix and updated until a few years ago, I think now abandoned. Operating system that runs on different platforms. Related to this o.s. we speak of Alef a native language developed to be able to be compiled and run on whatever platform the operating system was. What I noticed that struck me ... you see a piece of code and square how are passed and returned parameters .... multiple .... something that does not exist in modern languages (you can get creating a custom type ... but here it is not necessary) Code: (int, byte*, byte) func() { return (10, "hello", ’c’); } void main() { int a; byte* str; byte c; (a, str, c) = func(); } note that the name is not "ALFA" the first letter of the Greek alphabet but "ALEF" that if I'm not mistaken the first letter of the Hebrew alphabet (ﬡ)
Today browsing a little haphazardly on the web, but throwing an eye to operating systems, I came across Plan 9, an old operating system derived from Unix and updated until a few years ago, I think now abandoned. Operating system that runs on different platforms. Related to this o.s. we speak of Alef a native language developed to be able to be compiled and run on whatever platform the operating system was. What I noticed that struck me ... you see a piece of code and square how are passed and returned parameters .... multiple .... something that does not exist in modern languages (you can get creating a custom type ... but here it is not necessary) Code: (int, byte*, byte) func() { return (10, "hello", ’c’); } void main() { int a; byte* str; byte c; (a, str, c) = func(); } note that the name is not "ALFA" the first letter of the Greek alphabet but "ALEF" that if I'm not mistaken the first letter of the Hebrew alphabet (ﬡ)
Erel B4X founder Staff member Licensed User Longtime User Oct 14, 2018 #2 Star-Dust said: if I'm not mistaken the first letter of the Hebrew alphabet (ﬡ) Click to expand... That's true. Star-Dust said: What I noticed that struck me ... you see a piece of code and square how are passed and returned parameters .... multiple .... something that does not exist in modern languages (you can get creating a custom type ... but here it is not necessary) Click to expand... It is sometimes named a tuple. BTW, it is not so distant from: Code: Sub Func As Object() Return Array(10, "hello", "c") End Sub Dim res() As Object = Func Dim a As Int = res(0) Dim b As String = res(1) Dim c As String = res(2) Last edited: Oct 14, 2018
Star-Dust said: if I'm not mistaken the first letter of the Hebrew alphabet (ﬡ) Click to expand... That's true. Star-Dust said: What I noticed that struck me ... you see a piece of code and square how are passed and returned parameters .... multiple .... something that does not exist in modern languages (you can get creating a custom type ... but here it is not necessary) Click to expand... It is sometimes named a tuple. BTW, it is not so distant from: Code: Sub Func As Object() Return Array(10, "hello", "c") End Sub Dim res() As Object = Func Dim a As Int = res(0) Dim b As String = res(1) Dim c As String = res(2)
JordiCP Expert Licensed User Longtime User Oct 14, 2018 #3 Star-Dust said: ... something that does not exist in modern languages Click to expand... Erel said: It is sometime named a tuple. Click to expand... Also exists in Python, if I'm not mistaken.
Star-Dust said: ... something that does not exist in modern languages Click to expand... Erel said: It is sometime named a tuple. Click to expand... Also exists in Python, if I'm not mistaken.
Sandman Expert Licensed User Longtime User Oct 15, 2018 #4 JordiCP said: Also exists in Python, if I'm not mistaken Click to expand... You're not mistaken. I'd say it's so common it's difficult to use Python if you don't grok the tuple.
JordiCP said: Also exists in Python, if I'm not mistaken Click to expand... You're not mistaken. I'd say it's so common it's difficult to use Python if you don't grok the tuple.
Sandman Expert Licensed User Longtime User Oct 15, 2018 #6 Star-Dust said: I would like to have it on B4X Click to expand... If only we had some sort of way here in the forum to express such a wish. ;-)
Star-Dust said: I would like to have it on B4X Click to expand... If only we had some sort of way here in the forum to express such a wish. ;-)
Star-Dust Expert Licensed User Longtime User Oct 15, 2018 #7 Sandman said: If only we had some sort of way here in the forum to express such a wish. ;-) Click to expand... Express a desire and an account, see it realized and another. The forum is full of expressed wishes @Erel suggested a method to achieve something similar The same method we use with CallSub when the parameters are many, we put an array of objects. But as it would be nice to have the native tuple in b4X.
Sandman said: If only we had some sort of way here in the forum to express such a wish. ;-) Click to expand... Express a desire and an account, see it realized and another. The forum is full of expressed wishes @Erel suggested a method to achieve something similar The same method we use with CallSub when the parameters are many, we put an array of objects. But as it would be nice to have the native tuple in b4X.