If you were going to add to the Xojo language

What things would you add to the Xojo language (not the framework)
HTPPSocket, PushButton and such are part of the framework -and those can be added to without having to change the underlying language.
I’m curious about things like

  • the FINAL keyword to make it so a subclass CAN NOT override a method in a superclass
  • the ABSTRACT keyword to make it so a subclass MUST implement the method

What other things would YOU add ?

2 Likes

comments elsewhere include

++ (for use like i++)
– (for use like i–)

generics

2 Likes

One nicety I would like to have is type inference, instead of having to explicitly declare every variable.

E.g., instead of having to type…

Dim i as integer = 5

Dim s as string = "hello"

Dim t as some.Long.Framework.Class = foo() // returns an sLFC instance

…it’s a lot easier and almost always completely understandable to just type:

i := 5

s := "hello"

t := foo()

The := construct is the way Go does it, but there are other options. However it’s done, it makes coding quicker and reading code generally easier.

With
..
end with

Inline functions.

Closures (a la Swift)
Friend (allow a private class to give access to a “friend” class)

x+=y
For strings as well as number data types. Or x=+y, which logically makes more sense.

Not sure if this is part of the language or framework, but ability to use multidimensional arrays everywhere that single-dimensional arrays can be used, including all current methods/properties of single-dimensional arrays. Part of this would be the ability to cast/extract a single-dimensional array from a multi, like when passing an array to a method that expects only a single-dimension.

ah slicing … yeah
I take it uou mean something like this ?
imagining foo(3,2) gives “3 rows 2 columns”

dim foo(3, 2) as string

mymethod(foo(1))

sub myMethod( arr as string(-1) )

end sub

and mymethod would get foo(1,2) (row1 all columns)

ability to return mutliple values from a function

Var X as Integer
Var y as Integer
(x,y) = myFunction()
function myFunction As (x as Integer, Y as Integer)
... do stuff
return (x,y)

Swift has this and it has been really handy at times

3 Likes

YES! I don’t know how many times I’ve had to have a method return a Pair or a Dictionary simply so that I could have it return “multiple” values.

keep em coming !

lots of good ideas

• Checked Exceptions
• Named Parameters
• Type Aliases
• The ability to pass empty arrays without having to declare a variable
• ByRef support for simple expressions (eg: passing Self.mMyProperty rather than mMyProperty)
• Inlining of functions

  • Type inference
  • Tuples
  • Ignore return values without using Call
  • Unless keyword:
a = b Unless b = 10
  • Generics
  • Everything should be an object, even primitive data types
1 Like
  • Ignore return values without using CALL

Swift doesn’t use call, but return values are easily ignored by using a dash

let _ = myFunction()

The same is used for a loop with you don’t care about the value

for _ in(0...10) { x+=1 }
1 Like

Make it so that interrupts work on the Raspberry Pi for electronics.

Multithreading multicores :slight_smile:

1 Like

That is framework, not the languaje :upside_down_face:

Multiple inheritance but I’d be already happy with generic, function returning multiple values and multithreading multicores

Embedded functions

func myfunction()
      func embed() // this function is availble only to "myFunction"
       end function
 end function

The same ability for class and structure,… and yes Swift does this and its quite useful

of course for many of us this topic is moot… unless you are going to embark on a Xojo Killer replacement of course :slight_smile:

  • MULTITHREADING!! (utilizing multiple cores of course)
  • Private functions inside other methods/functions
  • With/End With
  • += -= *=, >>=, etc.
  • Null-Conditional operators
  • “>>” “<<” functions (instead of the overly-verbose bitwise.shiftright, bitwise.shiftleft)
  • WebSocket
  • DataBinding for controls (seems like that was a thing, then was taken away?)
  • Validation on controls
  • MULTITHREADING!!! (along with Async/Await)