September 19, 2016 at 8:58 am #4019
Example linq program:Monkey123456789101112131415161718192021222324252627Namespace linqtest#Import "<std>"#Import "<linq>"Using std..Using linqFunction Main:Void()Local list := New List<String>()If not list.Any()list.Add("ABC")list.Add("DEF")list.Add("GHI")Local x := list.First2(Lambda:Bool(item:String)return item = "DEF"End)Print(x)EndEnd
Currently this only works in v1.0.5 if I put the following in the module’s linq.monkey2 file (which forces it to include some of the linq code, but not all of it), otherwise the linq code is all optimized out.Monkey1234Function Main:Void()Local list := New List<String>()list.Any()EndSeptember 19, 2016 at 9:47 am #4025
Ok, this runs for me now!
Just committed compiler fixes+new binaries.September 19, 2016 at 11:07 am #4029
Ted2 doesn’t build 🙁
Clean download of latest source, copy in “i686-5.3.0-posix-dwarf-rt_v4-rev0” and run rebuildall.batMonkey12345678910111213141516***** Rebuilding ted2 *****mx2cc version 1.0.6***** Building app 'C:/Documents/Programs/Monkey2/monkey2-master/src/ted2/ted2.monkey2' *****Parsing...Semanting...Caught signal:Memory access violationFile not found - assets0 File(s) copiedFile not found - *.dll0 File(s) copiedFile not found - *.exe0 File(s) copiedmx2cc version 1.0.6
Edit: Also did updatemx2cc.bat and then rebuildall.bat and get same error.September 19, 2016 at 9:31 pm #4034
Hokay, try again – maybe this time!September 20, 2016 at 12:47 pm #4039
Yep – working now 🙂
I’ll try get my linq module tarted up an uploaded in the next few days.
One question: should extension Functions work? (they worked before I made this a module).September 25, 2016 at 10:35 am #4089
This is good to see, it’s one of the things I would need if I ever wanted to port my project to MX2 so nice to see it being done.
@Mark a suggestion for the module manager, why not have a form/submission system built into the IDE, having something in IDE would I think help prompt people to use it more, also unless you know its in there it’s fairly easy to miss.September 26, 2016 at 9:07 am #4097
TinyXML seems to be working well!
I’ve tried a few moderately complex XML files with it.
1) When parsing an XML document with attribute values with language specific characters, in my case Danish æøå ÆØÅ, monkey ignores them when outputting them to the treeview. It seems strings are truncated, when one of these chars are met.
I’m assuming tinyXML handles them ok, and it is monkey2 that’s the reason?
2) Ted2 does not show æøå (and I assume other language specific chars). Ted2 seems to save them, as the show up in Mollusk.September 26, 2016 at 10:31 am #4099
I’m changing my code to use tinyxml, but if I declare List<XMLNode> or Stack<XMLNode> I get:Monkey123456C:/Documents/Development Projects/Monkey 2/Dungeon/dungeon.buildv1.0.6/windows_debug/include/dungeon_std_collections_2container.h:18:8: error: 't_std_collections_IContainer_1Ttinyxml2' has not been declaredstruct t_std_collections_IContainer_1Ttinyxml2::XMLNode_2;^
You must be logged in to reply to this topic.