Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/ortus-solutions-priv…
Browse files Browse the repository at this point in the history
…ate/boxlang into development
  • Loading branch information
bdw429s committed Sep 21, 2023
2 parents 9788e1f + 224ea43 commit bbe56e3
Showing 1 changed file with 92 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,97 +32,97 @@
*/
public class Phase2Lambda$lambda1 extends Lambda {

private static Phase2Lambda$lambda1 instance;
/**
* The name of the function
*/
private final static Key name = Lambda.defaultName;

/**
* The arguments of the function
*/
private final static Argument[] arguments = new Argument[] {
new Argument( true, "String", Key.of( "name" ), "Brad", "" )
};

/**
* The return type of the function
*/
private final static String returnType = "any";

/**
* The hint of the function
*/
private final static String hint = "";

/**
* Whether the function outputs
* TODO: Break CFML compat here?
*/
private final static boolean output = true;

// TODO: cachedwithin, modifier, localmode, return format

/**
* Additional abitrary metadata about this function.
*/
private final static Map<Key, Object> metadata = new HashMap<Key, Object>();

public Key getName() {
return name;
}

public Argument[] getArguments() {
return arguments;
}

public String getReturnType() {
return returnType;
}

public String getHint() {
return hint;
}

public boolean isOutput() {
return output;
}

public Map<Key, Object> getMetadata() {
return metadata;
}

private Phase2Lambda$lambda1() {
super();
}

public static synchronized Phase2Lambda$lambda1 getInstance() {
if ( instance == null ) {
instance = new Phase2Lambda$lambda1();
}
return instance;
}

/**
* <pre>
( required string name='Brad' ) -> {
var greeting = "Hello " & name;
return greeting;
}
* </pre>
*/
@Override
public Object _invoke( FunctionBoxContext context ) {

context.getScopeNearby( LocalScope.name ).assign(
Key.of( "Greeting" ),
Concat.invoke(
"Hello ",
context.scopeFindNearby( Key.of( "name" ), null ).value()
)
);

return context.scopeFindNearby( Key.of( "greeting" ), null ).value();
}
private static Phase2Lambda$lambda1 instance;
/**
* The name of the function
*/
private final static Key name = Lambda.defaultName;

/**
* The arguments of the function
*/
private static final Argument[] arguments = new Argument[] {
new Argument( true, "String", Key.of( "name" ), "Brad", "" )
};

/**
* The return type of the function
*/
private static final String returnType = "any";

/**
* The hint of the function
*/
private static final String hint = "";

/**
* Whether the function outputs
* TODO: Break CFML compat here?
*/
private static final boolean output = true;

// TODO: cachedwithin, modifier, localmode, return format

/**
* Additional abitrary metadata about this function.
*/
private static final Map<Key, Object> metadata = new HashMap<Key, Object>();

public Key getName() {
return name;
}

public Argument[] getArguments() {
return arguments;
}

public String getReturnType() {
return returnType;
}

public String getHint() {
return hint;
}

public boolean isOutput() {
return output;
}

public Map<Key, Object> getMetadata() {
return metadata;
}

private Phase2Lambda$lambda1() {
super();
}

public static synchronized Phase2Lambda$lambda1 getInstance() {
if ( instance == null ) {
instance = new Phase2Lambda$lambda1();
}
return instance;
}

/**
* <pre>
( required string name='Brad' ) -> {
var greeting = "Hello " & name;
return greeting;
}
* </pre>
*/
@Override
public Object _invoke( FunctionBoxContext context ) {

context.getScopeNearby( LocalScope.name ).assign(
Key.of( "Greeting" ),
Concat.invoke(
"Hello ",
context.scopeFindNearby( Key.of( "name" ), null ).value()
)
);

return context.scopeFindNearby( Key.of( "greeting" ), null ).value();
}

}

0 comments on commit bbe56e3

Please sign in to comment.