I love the Elements Island compiler!

Playing around with bring in more Linq Support in Island Windows:
Look at this Source:

  procedure SimpleGroupByUser;
  begin
    writeLn('SimpleGroupByUser');
    var users :=   PrepareUser;
    for each user in users do
      writeLn($"Users  {user.Name} Age: {user.Age} Home: {user.HomeCountry}");

writeLn;

var usersGroupedByCountry :=  users.GroupBy(user -> user.HomeCountry);
for each lgroup in usersGroupedByCountry do
  begin
  writeLn($"Users from {lgroup.Key}:");
  for each user in lgroup do
    writeLn($"  User:  {user.Name} Age: {user.Age} Home: {user.HomeCountry}");
  writeLn;
end;

var usersGroupedByCountryAndAge := users.GroupBy(user ->  (user.HomeCountry, user.Age ));
for each &group in usersGroupedByCountryAndAge do
  begin
  writeLn($"Users from  {&group.Key[0]}  at the age of {group.Key[1]} :");
  for each  user in &group do
    writeLn("* " + user.Name + " [" + user.Age + " years]");
  writeLn;  
end;

end;
end;

Result:

SimpleGroupByUser
Users  John Doe Age: 42 Home: USA
Users  Jane Doe Age: 38 Home: USA
Users  Joe Doe Age: 19 Home: Germany
Users  Jenna Doe Age: 19 Home: Germany
Users  Marc Hofmann Age: 54 Home: Curacao
Users  James Doe Age: 8 Home: USA

Users from USA:
  User:  John Doe Age: 42 Home: USA
  User:  Jane Doe Age: 38 Home: USA
  User:  James Doe Age: 8 Home: USA

Users from Germany:
  User:  Joe Doe Age: 19 Home: Germany
  User:  Jenna Doe Age: 19 Home: Germany

Users from Curacao:
  User:  Marc Hofmann Age: 54 Home: Curacao

Users from  USA  at the age of 42 :
* John Doe [42 years]

Users from  USA  at the age of 38 :
* Jane Doe [38 years]

Users from  Germany  at the age of 19 :
* Joe Doe [19 years]
* Jenna Doe [19 years]

Users from  Curacao  at the age of 54 :
* Marc Hofmann [54 years]

Users from  USA  at the age of 8 :
* James Doe [8 years]

I love the extensions you have done to pascal.
Thanks for that cool type of tools!!!

5 Likes

that’s the kind of post that makes me get out of bed in the morning! ;). much appreciated, and I;m glad you enjoy Elements!

Hmm. Do i really look that old though? I thought I had a few more years before I hit my fifties… :joy:

1 Like

Ok i have changed it im my Tests to 32… :wink: :innocent:

2 Likes

:laughing:

Ditto… incredibly cool. Only started playing with these extensions a couple of weeks ago.

2 Likes

I love it too! @mh @ck. And really enjoy the direct interacting with the core brains of RemObjects crew. It is now a pleasant daily routine of mine, just browsing RemObject Talk/Blog at every morning w/ a cup of coffee starting my day, and waiting for each Friday’s weekly release has quickly become my recurrent ritual of anticipation (just for the comfort of seeing its getting better and better) …

That being said - It would be even better if we could/or would soon have:

  1. Native Island support for RemObject SDK and DataAbstract - possible? Is it too much to ask?
  2. A UI framework, whether or not via WPF/WinForms/??, and whether or not via an enhanced Hydra
  3. A successful killer project (closed source, or open source) demonstrating its power while giving potential users much more confidence to adopt
  4. An ever-growing friendly user community (which seems already out there/here, but not large enough)
2 Likes

It’s something we wanna do and on our list. In fact, I want a “rethought” RO/DA client API that works consistently across all Elements platforms (right now you can of course use the .NET, Cocoa and Java versions, but they all work slightly different, because each one is designed to fit in well with its platform, not to be the same). But only 24 hours in the day. But we’ll get to it sooner rather than later.

Note you can use WPF/WinForms now, you just have to use .NET, not native (which imho should not be a big deal for GUI apps). You can bring Island code in via Hydra, too. What enhancements to Hydra would you like to see?

How about Fire/Water itself?

Working on it. Anything you guys can drop to help spread the word is of course appreciated. :wink:

—marc

For me one thing I really missing at moment is
proper EUnit support in Fire and Water for the Island part.
For me unit Tests are a important part of my development.

Hm, that should be there? What’s missing?

Hi Marc,
the Tests can not be startet with ctrl-T and I got:
ctrl-R will work

namespace TestEunit;
interface
uses
  RemObjects.Elements.EUnit;
type
  localTest = public class(Test)
  public
    method simpleTest;
  end;

implementation

  method localTest.simpleTest;
  begin
    Assert.Fail('not implemented');
  end;

  begin
    writeLn('Start Test');
    var lTests := Discovery.DiscoverTests();
    Runner.RunTests(lTests) withListener(Runner.DefaultListener);
    writeLn('Finish Test');
end.


~> Process TestEunit started testing
~> The process failed to start with the following error: System.ComponentModel.Win32Exception (0x80004005): Falscher Parameter
~>    bei RemObjects.Elements.NDebug.Windows.WindowsDebugger.Start(String aExe, String aArgs, String aEnv, String aWorkDir, Boolean aCaptureOutput, Boolean aCaptureInput)
~>    bei RemObjects.Oxygene.CoreDebugEngine.IslandDebugEngine.StartWindows()
~>    bei RemObjects.Oxygene.CoreDebugEngine.IslandDebugEngine.Start()
~>    bei DebugHost.Program.Main(String[] args)

Curious; I’ll debug.

Hmm. that happens only with EUnit? Looks to me like a general problem with the Island/Windows debugger (which, to be fair, I dont use myself often/ever). @elenap, any ideas?

Wonder what Wrong Parameter refers to. Can you grab the DebugStartParameters from the Water.log file?

hmm, I cannot repro this. new Island project. as soon as I add an EUnit reference, the Test menu items enable ok, for me.

Neither Fire or Water. Steps:

  • New Island/Windows console project:
    → Debug|Test is disabled
  • Add EUnit referene
    → Debug|Test is enabled and I can launch

can you give me more steps or a test project that shows the issue for you? DFo you have a direct EUnit.fx reference (that’s what Fire/Water uses to determine if it’s a test project or not)?

Yes the Test menu item enables, but i can not run the test, always this error from above. Same happens in Fire and Darwin.
And yes only EUnit an Test

Ah yes, I misread you. Co Ctrl+R works, Ctrl=T gives the debugger error. reproduced, very strange. The only difference is that I’m passing parameters and environment variable to the debuggee…

Logged as 83009: Cannot run Island/Windows EUnit app in test mode