Giter Club home page Giter Club logo

Comments (3)

Y-Less avatar Y-Less commented on August 17, 2024

The @p example won't work - @ is already a valid symbol character in PAWN (though rarely used outside of low-level libraries in my experience), so @p is a valid variable now. Also, a function with @ as the first character of its name is public even without the public keyword:

@MyPublic();

@MyPublic()
{
    print("hi");
}

main()
{
    CallLocalFunction("@MyPublic", ""); // Works.
}

Note that this is not quite a replacement for public because it remains part of the name, you can't do @ MyPublic and then just refer to the function as MyPublic.

The & operator on the other hand already has precedence for this in that it is the syntax when declaring functions, so a different syntax would probably be more confusing. (Side note, I also used & for some libraries that can take the address of a function in the same way).

from pawn.

assyrianic avatar assyrianic commented on August 17, 2024

hmmm, how about $ as an alternative token for standalone references?
Example:

new i = 5;
new $p = i;
p = 2; // i == 2

I don't believe the $ is used is it?

from pawn.

Y-Less avatar Y-Less commented on August 17, 2024

No, but still why not just & - I think that would cause far less confusion as it already means that:

MyFunc(&a, &b)
{
    a = 7;
    printf("%d", b); // Prints 7.
}

main()
{
    new var = 11;
    MyFunc(var, var);
}

from pawn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.