Comments (2)
It's not a bug, whenever you call a name preceded by @
, then the value of @
is passed in as the first argument.
@hello "world"
is the same as
self.hello self, "world"
So the same rules apply to @__class
.
The special form @@
is a shortcut to @_class
like @
is a shortcut for self
, but when you call @@
nothing is passed in as the first argument. So you can do:
@@ "test2"
To make a new instance of the current class. http://moonscript.org/reference/#_and__values
from moonscript.
Aah ok thx.
Btw seems http://moonscript.org/reference/ is being too agressively cached. I opened the link, and there was no "@@" and it appeared after ctrl+f5. Firefox, linux.
from moonscript.
Related Issues (20)
- self documenting function HOT 1
- How to use lua's `load` function HOT 6
- Fill operator HOT 1
- Document that @name is a method call if self.name is a function HOT 4
- no long comments? HOT 2
- The option --output-to works in a weird way. It creates the source directory inside the target directory.
- Error: Module "alt_getopt" not found HOT 1
- Any chance we could get a existance operator and a pipe operator HOT 1
- How can I call ls.NewClosure and set local variable HOT 1
- Support for "goto" method
- installing moonscript bug HOT 2
- NOT compatible with lua 5.1 HOT 3
- Any method to use if statement in class method define? HOT 4
- Is it possible to add utf 8 support for names ?
- How to use latest version of code on Windows?
- Syntax error should throw for invalid interpolation
- destructing assignment works wrong with for generator HOT 1
- moonc doesnt output to -t when using -w
- Destructured table literals generate syntactically invalid subscripts
- Add "Prompt" function for user input HOT 1
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 moonscript.