GithubHelp home page GithubHelp logo

rsdn / nemerle Goto Github PK

View Code? Open in Web Editor NEW
616.0 616.0 89.0 211.1 MB

Nemerle language. Main repository.

Home Page: http://nemerle.org

License: Other

Shell 0.17% HTML 3.66% Nemerle 52.98% Makefile 0.50% C# 33.51% C 0.28% ASP 0.19% CSS 0.20% JavaScript 6.82% C++ 0.04% Awk 0.01% Perl 0.04% Emacs Lisp 0.17% PHP 0.04% Python 0.05% F# 0.02% OCaml 0.03% XSLT 0.13% Batchfile 0.21% Roff 0.94%

nemerle's People

Contributors

cannorin avatar catbert avatar cnd avatar codingunit avatar deeprocks99 avatar divanorama avatar dsorokin avatar emperon avatar igor-tkachev avatar kali71234 avatar kochetkov avatar makowiem avatar mart-bogdan avatar nn--- avatar paracoder avatar pawel2006 avatar pbludov avatar pekabon avatar rampelstinskin avatar rystsov avatar sergeya avatar serras avatar someone-with-default-username avatar stdray avatar stitchous avatar v2m avatar viivanov avatar vladd2 avatar vladimirreshetnikov avatar ziaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nemerle's Issues

Нехорошее сообщение об ошибке (no well error message)

Code:

 public compareFiles(f1: string, f2: string):  int * int * int
    {
        (0, 0, 0)
    }

  private RetryCompareButton_Click (sender : object,  e : System.EventArgs) : void
    {
        if (!String.IsNullOrEmpty(fileNameBox1.Text) && !String.IsNullOrEmpty(fileNameBox2.Text))
            compareFiles(fileNameBox1.Text, fileNameBox2.Text);
        else
            _ = MessageBox.Show("Извините, в текстовых полях отсутствуют имена файлов для сравнения:\r\n нажмите кнопку \"Сравнить\" или введите их вручную"): void;
    }

Must be error in compareFiles, but error in MessageBox

error : expected (int * int * int)-, got void in computation branch: (int * int * int) is not a subtype of void [simple require]

[installer] VS Integration removal

Looks like Nemerle uninstaller doesn't correctly handling VS Integration. After uninstall Nemerle is still registered in Visual Studio but is not avaliable for use. It means that Nemerle project types has gone, but Nemerle logo is still displayed on splash screen. Tested with VS08.

Incorrect type inference in :> operator

The following code is not typed, but should.

public variant SplittedExpr
{
    | SimpleExpr {val : string;}
    | InnerExpr  {val : list[SplittedExpr];}
}

module Program
{
  Main() : void
  {
    def getInnerText(x : SplittedExpr.InnerExpr) : string
    {
      _ = !x.val.Exists(y  =>
            match (y)
            {
              | SplittedExpr.InnerExpr => true
              | _ => false
            }
            || (y :> SplittedExpr.SimpleExpr) // E: Can't cast
               .val.Length > 0);

      "\r\n" + x.val.ToString() + ")"
    }

    _ = getInnerText(SplittedExpr.InnerExpr([]));
  }
}

[IDE] Tab settings

Visual Studio's text editor when using Edit | Advanced | Format Document (or Format Selection) considers current tab settings.
But in VS Integration all Nemerle code formatted with default tab size which is 2. So changing this value in Tools | Options | Text Editor | Nemerle | Tabs doesn't affects on formatting behavior.

It's not only VS2010 problem, both VS08 and VS10 integrations are ignoring tab settings.

unitialized fields used as ref/out parameters on public method shoudn't generate warning

module Program
{
  mutable i : int;
  mutable o : object;
  public Main() : void
  {
    M(out i);
    M(ref o);
  }

  public M(a : out int) : void
  {
    a = 10;
  }

  public M(o : ref object) : void
  {

  }
}

Code above generate these warnings

N649: field `i' is never assigned to, and will always have its default value
N649: field `o' is never assigned to, and will always have its default value

But since a and o uses as ref and out, compiler shoudn't assert that a and o is NEVER assigned.

Modifier. AddCustomAttribute() fails to add custom attribute to class methods

Here's the macro:

  [Nemerle.MacroUsage (Nemerle.MacroPhase.BeforeInheritance, Nemerle.MacroTargets.Class,
                     Inherited = true)]
  macro UnitTestFixture (type : TypeBuilder)
  {
    type.GetModifiers().AddCustomAttribute (<[ TestFixture ]>);

    def methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public);
    foreach(method in methods)
    {
      def methodInfo = method.GetMethodInfo();                  
      def modifiers = method.GetModifiers();        

      modifiers.AddCustomAttribute (<[ NUnit.Framework.TestAttribute ]>);      
    }
  } 

Here's how I use the macro:

    [UnitTestFixture()]
    public class OptionalHeaderTests
    {
        public SomeTest() : void
        {            
        }
    }

The resulting class should look like this after compilation:

    [TestFixture]
    public class OptionalHeaderTests
    {
       [Test]
        public SomeTest() : void
        {

        }
    }

...but instead, it looks like this (in C#):

using Nemerle.Internal;
using NUnit.Framework;
using System;
namespace Tests
{
    [Macro("Tests.Macros.UnitTestFixture:type:postscan", 0, ""), TestFixture]
    public class OptionalHeaderTests
    {
        public void SomeTest()
        {
        }
    }
}

So what do I have to do with the macro to make it work?

[IDE] Adding native dlls to Project's dependencies

For now it is possible to add native dll to project's references folder. By doing this You're provoking integration to be involved in infinitive loop of parsing\building type tree which causes huge memory allocations. And VS becomes unusable.

Creating binaries that do not reference Nemerle.dll

Is there any way Nemerle can create binaries that don't need to reference Nemerle.dll? I'm trying to cut down on external dependencies, and having to depend on Nemerle.dll when I'm barely using any of its functionality seems a bit ridiculous.

[VS08] Tips about constructor parameters

Is it possible to give a tips to user about constructor parameters by default? When you creating new instance of some class which has some parameters in its constructor you wouldnt recieve intellisense support. To get parameter list you need to press "ctrl + shift + space" combination. Any chances to get this tooltip by default after typing opening brace?

[VS10] Suggestion completion mode not available

Currently, when typing code in the VS2010 editor it will auto-complete words as you type. This is not the desired behavior if you are templating code using classes not yet written implemented, as it will often choose the wrong thing and automatically insert it into your code as you are typing. The suggestion/standard completion mode toggle would usually resolve this, but it is greyed out when using Nemerle.

Unusual Tab behaviour

Tab press should adjust selection in visual studio editor, this is normal behaviour. If you press Tab key while editing Nemerle Project in visual studio, selection will be not moved to the right, as usual in VS, if you edit c# project. To achieve text adjusting, you should press Home key first, to move the cursor to the beginning of the first selected line. Then Tab key works as expected.

vs2010 extension build error:

----- Build started: Project: ConsoleApplication1, Configuration: Debug Any CPU ------
C:\Program Files (x86)\Nemerle\ncc.exe
/no-color
/no-stdlib
/greedy-references:-
/define:DEBUG;TRACE;SkipPostSharp
/target:exe
/debug+
/project-path:F:\Projects\NemerleTests\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.nproj
/root-namespace:ConsoleApplication1

Main.n
Properties\AssemblyInfo.n

/ref:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\mscorlib.dll"
/ref:"C:\Program Files (x86)\Nemerle\Nemerle.dll"
/ref:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Core.dll"
/ref:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Data.DataSetExtensions.dll"
/ref:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Data.dll"
/ref:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.dll"
/ref:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Xml.dll"
/ref:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Xml.Linq.dll"
/macros:"C:\Program Files (x86)\Nemerle\Nemerle.Linq.dll"

/out:obj\Debug\ConsoleApplication1.exe
C:\Program Files (x86)\Nemerle\Nemerle.MSBuild.targets(230,9): error : internal compiler error: got some unknown exception of type System.BadImageFormatException: Could not load file or assembly 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\mscorlib.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
at System.Reflection.AssemblyName.nGetFileInformation(String s)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
at Nemerle.Compiler.LibraryReferenceManager.assemblyLoadFrom(String path)
at Nemerle.Compiler.LibraryReferenceManager._N_assembly_by_name_53499(_N_closure_53491 _N_LookupAssembly_cp_53498, String path)
at Nemerle.Compiler.LibraryReferenceManager.LookupAssembly(String name)
at Nemerle.Compiler.LibraryReferenceManager.AddLibrary(String name)
at Nemerle.Compiler.ManagerClass._N_tryEx_24889(_N_closure_24873 _N_LoadExternalLibraries_cp_24888, FunctionVoid f)
at Nemerle.Compiler.ManagerClass._N_foreach_loop_24959(_N_closure_24873 _N_LoadExternalLibraries_cp_24958, list`1 _N_wildcard_2417)
at Nemerle.Compiler.ManagerClass.LoadExternalLibraries()
at Nemerle.Compiler.ManagerClass.Run()
at Nemerle.CommandlineCompiler.MainClass.main_with_catching()
Done building project "ConsoleApplication1.nproj" -- FAILED.

Build FAILED.
GetFrameworkPaths failed -- 0 errors, 0 warnings. Build took: 00:00:00.0621246.

Build has been canceled.

Build Summary

00:00.077 - Failed - Debug Any CPU - ConsoleApplication1\ConsoleApplication1.nproj

Total build time: 00:00.082

========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

VS 2010 ASP.NET Web Projects broken

1-) Create a new ASP.NET Web Project
2-) Right click to project from solution folder and click Start With Debugging (optionally enable debugging)

VS will give an error that it is unable to start debugging

Additionally adding new controls to aspx , causes incorrect/missing code designer page

Workaround:
Somehow unload and reload the project everything works properly.

Incorrect IL generation for update field of "out" parameter of "struct" type

Following example generate incorrect IL:

using System;
using System.Console;

module Program
{
  Main() : void
  {
      mutable arg;
      Test(out arg);
      WriteLine(arg.Field1);
      _ = ReadLine();
  }

  mutable cond : bool = false;

  Test(arg : out Struct1) : void
  {
    arg.Field1 = if (cond) "1" else "2";
  }

  public struct Struct1
  {
    public mutable Field1 : string;
  }
}

Output of PEVerify:

[IL]: Error: [E:\MyProjects\Tests\ConsoleApplication355\ConsoleApplication355\bin\Debug\ConsoleApplication355.exe : Program::Test][offset 0x00000003][found address of value 'Program+Struct1'][expected value 'Program+Struct1'] Unexpected type on the stack.

[IL]: Error: [E:\MyProjects\Tests\ConsoleApplication355\ConsoleApplication355\bin\Debug\ConsoleApplication355.exe : Program::Test][offset 0x00000021][found value 'Program+Struct1'][expected readonly address of value 'Program+Struct1'] Unexpected type on the stack.

2 Error(s) Verifying ConsoleApplication355.exe

Note: This example crash on .net 4.0 x86, but work fine on x64.

Implicits and overloads

This is a similar issue to #768 on the old google code tracker. If two types are implicitly convertible, they are sometimes unusable with function overloads. For example:

class A {
  public static @:(b:B):A {A();}
}
class B {
  public static @:(a:A):B {B();}
}

class MainN {
  public static Foo(a:A,b:B):void {}
  public static Foo(a1:A,a2:A):void{}
  public static MainD():void
  {
    Foo(B(),B());
  }
}

This results in "typing fails on ambiguity between overloads". The equivalent C# code works as expected:

class A { public static implicit operator B (A a) { return new B(); } }
class B{ public static implicit operator A (B b){ return new A();}}
class MainCS
{
    static void Foo(A a, B b) { }
    static void Foo(A a1, A a2) { }
    static void Main(string [] args)
    {
        Foo(new B(), new B()); // This works with a call to the first overload
    }
}

A comment from before stated that "This is because when we compare overloads we don't take implicit conversion into account, so A and int are incomparable."

I'd be willing to look into the issue myself, but I'm rather new with Nemerle and I'm not sure where I'd even get started.

[VS08] override "with closed eyes"

C# editor can help you with list of methods that can be overriden inside the class. To recieve a help you just typing "override" then after pressing spacebar you recieving list with methods avaliable for override. When you choose one of them editor will copy signature from metadata. Is it possible to make this inside Nemerle Integration?

Can't define a Variant Option by typeBuilder.DefineNestedType() after MacroPhase.BeforeInheritance.

The following code fail:

[MacroUsage(MacroPhase.BeforeTypedMembers, MacroTargets.Class)]
macro DefineVariantoption_on_BeforeTypedMembers(typeBuilder : TypeBuilder, optionName : PExpr)
{
  def variantOptionBuilder = typeBuilder.DefineNestedType(
  <[ variant_option: | $(optionName.ToString() : usesite) { public override ToString() : string { "defined on BeforeTypedMembers" } } ]>);

  variantOptionBuilder.Compile(); // ICE: Exception=NRE
}

[MacroUsage(MacroPhase.WithTypedMembers, MacroTargets.Class)]
macro DefineVariantoption_on_WithTypedMembers(typeBuilder : TypeBuilder, optionName : PExpr)
{
  def variantOptionBuilder = typeBuilder.DefineNestedType(
  <[ variant_option: | $(optionName.ToString() : usesite) { public override ToString() : string { "defined on WithTypedMembers" } } ]>);

  variantOptionBuilder.Compile(); // E: no _N_GetVariantCode() defined
}

ICE on interface intersection

using System.Collections.Generic;

module Program
{
  Main() : void
  {
    def xs1 = List.[string]();

    foreach (_x in xs1 ?? array(0)) // ICE
      ();
  }
}

Vs2010 nemerle project polutes the Error Pane with bogus errors.

In a Nemerle Project if you add a C# file with BuildAction Compile,

Though the project compiles fine, the Error pane is full of errors, as if the compiler compiles the C# file expecting Nemerle syntax.
This is very annoying because it hides the actual compiler errors.

[VS08] Collapsing #region makes it unnamed

Try to wrap your code with named region like this:

region Test

// code

endregion

Then collapse this region. At this moment region will be displayed as rectangular area with text inside. Save file which contains this region. Then close and open this file again. After reopening you will see that your region is displayed as "..." now.

Workaround: press "Outlining | Toggle All Outlining" twice. Then collapse your region. It will save its name until you close file.

No well error message, copy of closed #55

see closed #55 (I does not reopen)


  1. "if" expression can not be int_int_int type in sample function, but compiler error message requires this.
  2. Compiler error message must be easy to understand and must have well location. if compiler can not inference of type "if" expression, it must say about this with correct form.

therefore, #55 is a bug.

Ошибка при добавлении сборки

Собрал последние на текущий момент исходники Nemerle.

Создал проект Nemerle Console App (.Net 3.5).
При добавлении сборки System.Reactive (последняя версия Reactive Extensions 3.5) появляется ошибка

Nemerle Visual Studio Integration

Error: assertion failed in file ncc\external\LibraryReferenceManager.n, line 530: not loaded internal type... file:///C:/Users/Acer/AppData/Local/Microsoft/VisualStudio/10.0Exp/Extensions/Nemerle Team/Nemerle Visual Studio 2010 Integration/1.0/Nemerle.Compiler.Utils.dll:System.Reactive.Notification`1[T]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.