Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gleam): support functions and parameters #715

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

McCourtRC
Copy link

@McCourtRC McCourtRC commented Nov 13, 2024

functions

// @function.outer start
pub fn foo(a a: String, b b: String) -> String {
  // @function.inner start  
  a <> b
  // @function.inner end
}
// @function.outer end

// anonymous functions
                     // @function.outer start
with_callback("foo", fn () {
  // @function.inner start 
  "bar"
  // @function.inner end
}                    // @function.outer end
)

parameters
(NOTE: @parameter.outer includes trailing ,)

// function parameters
pub fn foo(a a: String, b b: String) -> String {
  a <> b
}

// arguments
foo(a: "foo", b: "bar")

// data constructor arguments
pub type Foo {
  Foo(a: String, b: String)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant