Other New release: B4A v14.0 with optional parameters

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4A v14.0 follows B4J v10.7 and adds the optional parameters feature to B4X programming language.

The parser has undergone a major refactoring, resulting in performance improvements and providing the potential for new language features. The first one is optional parameters.

B4X:
'From:
Dim b() As Byte = "aaaa".GetBytes("UTF-8")
'''
Dim s As String = BytesToString(b, 0, b.Length, "UTF-8")

'To:
Dim b() As Byte = "aaaa".GetBytes
'''
Dim s As String = BytesToString(b)

'From:
Dim j As HttpJob
j.Initialize("", Me) 'unused JobName and always "Me"
j.Download(url)

'To:
Dim j As HttpJob
j.Initialize
j.Download(url)

Improvements:

Download link: https://www.b4x.com/b4a.html
 

Duque

Active Member
Licensed User
Longtime User
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

byz

Active Member
Licensed User
resulting in performance improvements and providing the potential for new language features. The first one is optional parameters.
Regarding the "potential for new language features" you mentioned — could you elaborate on how optional parameters fit into this? Does this mean we can expect more modern language features in B4X's future roadmap? And if so, what other features are you considering or planning?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
could you elaborate on how optional parameters fit into this?
Yes, a large refactoring was done in order to support optional parameters.
Maybe a variant of varargs (as an alternative to Array()).

Compile time automatic type inference:
B4X:
Dim x = "aa" 'x is string
Dim i  = 12 'i is int
Dim b = pnl.GetView(i) 'b is B4XView

And other stuff that is too premature to even post it...
 
Upvote 0

walt61

Well-Known Member
Licensed User
Longtime User
Compile time automatic type inference

At the moment, compiler warning "Variable declaration type is missing. String type will be used. (warning #5)" is raised when omitting the type. I hope the automatic type inference will include some kind of "Option Explicit" (as it's called in VBA) to make type declarations mandatory?
 
Upvote 0
Top