Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:52 Go to next message
Yoandri Saavedra is currently offline Yoandri SaavedraFriend
Messages: 24
Registered: February 2013
Junior Member

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 21:29 Go to previous messageGo to next message
Yoandri Saavedra is currently offline Yoandri SaavedraFriend
Messages: 24
Registered: February 2013
Junior Member


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 22:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

xbase has lamba support. so i dont really get your question


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: emulate return functions and objects in xbase??? [message #1057928 is a reply to message #1053859] Thu, 09 May 2013 20:19 Go to previous messageGo to next message
Yoandri Saavedra is currently offline Yoandri SaavedraFriend
Messages: 24
Registered: February 2013
Junior Member

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 21:29 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
See the docs:

val func = [ String s | s.length>3 ]


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: emulate return functions and objects in xbase??? [message #1058071 is a reply to message #1057937] Fri, 10 May 2013 19:21 Go to previous message
Yoandri Saavedra is currently offline Yoandri SaavedraFriend
Messages: 24
Registered: February 2013
Junior Member

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: Thu Mar 28 08:30:48 GMT 2024

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

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

Back to the top