Comments (2)
Just to clarify what you mean, you would like to be able to have something like:
public class Map
{
public function set(key:*, value:*) : void
{
// stuff
}
}
I think the compiler might be challenged to differentiate that from:
public class Map
{
public function set myval(key:*, value:*) : void
{
// stuff
}
}
which is a property setter..
Is there any reason you couldn't use capitalised versions or something to differentiate it from the reserved words? I'd be a little hesitant about changing those kinds of things..
thanks
from adobe-runtime-support.
Yes, that's exactly what I mean. I'm also want to use some other reserved keywords like break
, continue
, default
...
The reason is, in some case I think they're the best names to use.
In above example, I just want my classes (Map/Set) to have same API compared to JavaScript, so anyone that familiar with javascript can use my lib right away.
Set.delete()
Map.delete()
Map.get()
Map.set()
Another example, I have a class AsyncLoop
that can construct something like for loop. It can handle multiple items need to be loaded/processed asynchronously. And I need some functions called break
, continue
to break/continue the async loops.
I'm also building some library that use command line processes. The command line APIs have flags/switches named include
, default
... And I want to use them as property names.
In some programing languages, there're ways to use reserved names. For example in C# I can use the @
prefix.
Back to your example, I think it's quite easy to distinguish:
public class Map
{
public function set(key:*, value:*) : void
{
// if there's nothing after set, so set is the function name
}
}
public class Map
{
public function set myval(key:*, value:*) : void
{
// there's something after set (myval), so set is a keyword
}
}
from adobe-runtime-support.
Related Issues (20)
- [Feature Request] `NetStream::appendBytes()` MP4 H.264 support (for streaming content)
- [AIR 51.0.1.2] Corrupted ELS files cause application crash on `EncryptedLocalStore.setItem()`
- AIRSDK_51.0.1.2 mediaPlaybackRequiresUserAction regression on iOS HOT 1
- Error: Apple App Store allows only universal applications. "EfunSDK" is not a universal binary. Please change build settings in Xcode project to "Standard Architecture" to create universal library/framework. HOT 1
- java.io.IOException: Unable to run java: com.adobe.air.ADTException: gradle tool failed
- Google Play Rejects Apps/APKS with the Billing Permission HOT 4
- macOS TLF font rendering broken in AIR 51 HOT 1
- Building issue with AIR 51.0.1.3 and Gradle HOT 10
- Build ipa-test-interpreter success, but if ipa-test error unexpected failure: Cannot invoke "java.io.File.getAbsolutePath()" because "<parameter1>" is null HOT 1
- No version found for Apple ID on platform macOS App, Asset validation failed 90259, 90242, 90270 HOT 1
- Build Error, Undefined symbols for architecture x86_64 HOT 2
- [New Crash on Android 14] com.adobe.air.AndroidInputManager.onInputDeviceRemoved
- [AIR SDK][Windows][macOS] AIR SDK has WebKit files
- [AIR 51] Incorrect text selection when select text to left/right side of the text field HOT 2
- [Docs] Strange symbols in `EncryptedLocalStore` description
- [Docs] "EncryptedLocalStore internal error" exception not documented
- On MacOS, animate keeps overwriting App.XML file
- [java] NOTE: Multiple Android build-tools folders exist, choosing the latest version (34.0.0) for packaging [java] unexpected failure: Unable to run java: com.adobe.air.ADTException: gradle tool failed: ERROR:D8: com.android.tools.r8.internal.Fq: No VersionRequirement with the given id in the table HOT 1
- [Linux] Out of fullscreen cause GLib-CRITICAL errors in console
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adobe-runtime-support.