GithubHelp home page GithubHelp logo

Anonymous objects about eo HOT 8 CLOSED

objectionary avatar objectionary commented on August 16, 2024
Anonymous objects

from eo.

Comments (8)

Lebedevsd avatar Lebedevsd commented on August 16, 2024

@g4s8 if I want to create two different objects as Ticket, and both of them have Person as a ctor param. Then I will end up with the problem that the same notation could create 2 objects, and I do not know which will be created.

from eo.

g4s8 avatar g4s8 commented on August 16, 2024

the same notation could create 2 objects, and I do not know which will be created.

@Lebedevsd, you can still use object name, if you want to create second object. I think anonimous objects should be similar to java anoanymous classes instances. In such way you won't be able to create one anonymous object twice.

from eo.

Lebedevsd avatar Lebedevsd commented on August 16, 2024

@g4s8 how will you resolve this:

Ticket ticket(Person passenger):
  object x(passenger) as Ticket:
  ......

Ticket ticket(Person passenger):
  object y(passenger) as Ticket:
  ......

ticket(passenger: "Someone")

which object will be created x or y?

from eo.

g4s8 avatar g4s8 commented on August 16, 2024

@Lebedevsd , Ticket ticket(Person passenger): is a method. It's not allowed to define two methods with same signature in one scope.

from eo.

Lebedevsd avatar Lebedevsd commented on August 16, 2024

@g4s8 Then it looks like static method, which is not the thing we wanna see in EO

from eo.

g4s8 avatar g4s8 commented on August 16, 2024

@Lebedevsd , it's an example from Readme and it's out of any context, this method is just a method (not static). Furthermore it doesn't belong to this issue: "Anonymous objects".

from eo.

yegor256 avatar yegor256 commented on August 16, 2024

@g4s8 I like the idea. Do you want to submit a pull request with this?

from eo.

g4s8 avatar g4s8 commented on August 16, 2024

@yegor256, yes, I'll do it.

from eo.

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.