Skip to content

Conversation

@jayrm
Copy link
Member

@jayrm jayrm commented Jul 31, 2021

  • PROCPTR( identifier, type ) syntax to allow getting procedure pointer for based on sub/function type
  • can optionally specify 'type' of the sub/function; to resolve function overloads or make a check for compatible sub/function on non-overloaded functions

previously was only possible with:

sub s overload()
end sub
sub s( byval i as integer )
end sub

dim s1 as sub( byval i as integer)
s1 = procptr( s )

dim s2 as sub()
s2 = procptr( s )

Now is possible with:

var s1 = procptr( s, sub() )
var s2 = procptr( s, sub( byval i as integer ) )

- PROCPTR( identifier, type ) syntax to allow getting procedure pointer for based on sub/function type
- can optionally specify 'type' of the sub/function; to resolve function overloads or make a check for compatible sub/function on non-overloaded functions

previously was only possible with:

    sub s overload()
    end sub
    sub s( byval i as integer )
    end sub

    dim s1 as sub( byval i as integer)
    s1 = procptr( s )

    dim s2 as sub()
    s2 = procptr( s )

Now is possible with:

    var s1 = procptr( s, sub() )
    var s2 = procptr( s, sub( byval i as integer ) )
@jayrm jayrm merged commit 8539e1d into freebasic:master Jul 31, 2021
@jayrm jayrm deleted the procptr-type branch August 1, 2021 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant