Code Monkey home page Code Monkey logo

Comments (18)

SheepTester avatar SheepTester commented on June 5, 2024 1

What did I do

from n-lang.

SheepTester avatar SheepTester commented on June 5, 2024 1

maybe[int] is like Kotlin's Int?. It can be made with no special N syntax, just plain enums:

type maybe[t] = <yes t> | none

from n-lang.

SheepTester avatar SheepTester commented on June 5, 2024

Destructuring in for loops already is a thing because we've abstracted assigning a pattern to a type/value.

== checks by value not memory location already

Expressions able to be evaluated everywhere

We already have this, I think; all expressions can be used where values are expected.

when statement (or switch statement)

this would be the match proposal: #78

from n-lang.

Ashvin-Ranjan avatar Ashvin-Ranjan commented on June 5, 2024

Ok, I have updated the list with that info

from n-lang.

ky28059 avatar ky28059 commented on June 5, 2024

The to operator actually creates a pair, if you're interested in implementing that
image

from n-lang.

Ashvin-Ranjan avatar Ashvin-Ranjan commented on June 5, 2024

Oh ok, I shall update it, the thing I dislike using words in code so I kinda want to use something like ~> but that might just be bad

from n-lang.

SheepTester avatar SheepTester commented on June 5, 2024

The to operator actually creates a pair, if you're interested in implementing that
image

Oh, in that case, we already have something like that. mapFrom([(1, "hi"), (2, "hey")])

from n-lang.

Ashvin-Ranjan avatar Ashvin-Ranjan commented on June 5, 2024

True, so I guess that to is effectively implemented.

from n-lang.

ky28059 avatar ky28059 commented on June 5, 2024

The to operator actually creates a pair, if you're interested in implementing that
image

Oh, in that case, we already have something like that. mapFrom([(1, "hi"), (2, "hey")])

Hmm, not the biggest fan of the surrounding square brackets. Does N have vararg or something equivalent?

from n-lang.

Ashvin-Ranjan avatar Ashvin-Ranjan commented on June 5, 2024

Ok, Added it to the list to implement.

from n-lang.

ky28059 avatar ky28059 commented on June 5, 2024

Will N have null safety?

from n-lang.

SheepTester avatar SheepTester commented on June 5, 2024

Will N have null safety?

Already does with the maybe type

from n-lang.

ky28059 avatar ky28059 commented on June 5, 2024

Is the maybe type something like maybe<int> like kotlin's Int? or is it more like kotlin's Any??

from n-lang.

SheepTester avatar SheepTester commented on June 5, 2024

What if we did something like

identifier[1, 2, 3]
//       ^ no newlines allowed between the identifier and list

as a shorthand for identifier([1, 2, 3]): calling a function with a list as an argument.

If other arguments need to be given, we can just take advantage of currying:

coolFunction("happy", \{s})[1, 2, 3](true)

from n-lang.

Ashvin-Ranjan avatar Ashvin-Ranjan commented on June 5, 2024

Intresting, that might be nice.

from n-lang.

Ashvin-Ranjan avatar Ashvin-Ranjan commented on June 5, 2024

Should the vararg idea be removed because it can be done with a record or a tuple?

from n-lang.

SheepTester avatar SheepTester commented on June 5, 2024

yeah, or a list

from n-lang.

Ashvin-Ranjan avatar Ashvin-Ranjan commented on June 5, 2024

Closed as all things here are done

from n-lang.

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.