Skip to main content



      Home
Home » Modeling » TMF (Xtext) » emulate return functions and objects in xbase???
emulate return functions and objects in xbase??? [message #1053570] Mon, 06 May 2013 10:52 Go to next message
Eclipse UserFriend
Hi, Xbase is that does not support functions or objects, but if my interpreter recognizes expressions will exist some method using lambda ... imagine this...
function name (param1, param 2){
  print("Hi world!!!");
  return true;
}

var d = name("any", "bye");

print d; 


and the console look at Hi World!!! true

and This is possible with xbase????
Re: emulate return functions and objects in xbase??? [message #1053853 is a reply to message #1053570] Tue, 07 May 2013 17:29 Go to previous messageGo to next message
Eclipse UserFriend

any ideas?? .. anything??? .. can not??
Re: emulate return functions and objects in xbase??? [message #1053859 is a reply to message #1053853] Tue, 07 May 2013 18:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

xbase has lamba support. so i dont really get your question
Re: emulate return functions and objects in xbase??? [message #1057928 is a reply to message #1053859] Thu, 09 May 2013 16:19 Go to previous messageGo to next message
Eclipse UserFriend
yes.. how I can use lamba???...the xtext tutorial is very short...
Re: emulate return functions and objects in xbase??? [message #1057937 is a reply to message #1057928] Thu, 09 May 2013 17:29 Go to previous messageGo to next message
Eclipse UserFriend
See the docs:

val func = [ String s | s.length>3 ]
Re: emulate return functions and objects in xbase??? [message #1058071 is a reply to message #1057937] Fri, 10 May 2013 15:21 Go to previous message
Eclipse UserFriend
Thaks..yes.. but if my rules is
function: 
   'func' name=ValidID '(' arg=OneArg ')'
    '{'
        exp+=XExpresion ';'
       (return Other ';')?
    '}'


How I can create the _evaluateXXXFunction

protect Object evaluatefunction(literal, ctx, indic){
  Object result = ?????function(ctx.branch, body???);
  I no idea...
}
Previous Topic:Missing type info in JvmType model
Next Topic:Calling a custom compiler
Goto Forum:
  


Current Time: Wed Jul 23 13:35:57 EDT 2025

Powered by FUDForum. Page generated in 0.48847 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top