Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - prio

#1
newLISP and the O.S. /
October 16, 2006, 10:20:29 AM
Hi Lutz,



Changing to StdCall seems to have fixed it. Thanks.
#2
newLISP and the O.S. / NewLisp.dll and C#
October 16, 2006, 07:08:37 AM
Hi,



I was wondering has anyone tried calling newlispEvalStr from a C# application? Do you have some code to show me how or can you point me in the right direction?



I have tried using dllImport and it seems (i.e. in debug view I can see (+ 2 2) returns "4n")  to work but I keep getting AccessViolationExceptions.



Class which import newlisp.dll (NewLispDLL.cs) is:



using System;
using System.Text;
using Microsoft.CSharp;
using System.Runtime.InteropServices;

class NewLispDLL
{
    [DllImport("C:\Program Files\newlisp\newLisp.dll", EntryPoint = "newlispEvalStr", CallingConvention = CallingConvention.Cdecl)]
    private static extern System.Text.StringBuilder newlispEvalStr(string txt);

    public static string Eval(string LispExpression)
    {
        System.Text.StringBuilder ResultObject;
        ResultObject = newlispEvalStr(LispExpression);
        return ResultObject.ToString();
    }
}


Code that calls it (Program.cs) is:



using System;
using System.Collections.Generic;
using System.Text;

namespace NewLispTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string strCmd = "(+ 2 2)";
            string txt = "";
            txt = NewLispDLL.Eval(strCmd);        
            Console.WriteLine(txt);
            Console.ReadLine();
        }
    }
}


Thanks.
#3
Anything else we might add? /
June 22, 2006, 01:44:35 AM
Thanks Tim. I only use windows at work and I was having the same problem on Mac OS X and Linux at home. I look forward to trying out your next version.
#4
Hi,

Some newbie questions. I have been trying to get Tim's emacs mode to load but I get the following error on startup. Using emacs 21.3 on Windows. I also got this error on Linux.
Quote
Debugger entered--Lisp error: (error "Invalid escape character syntax")

  eval-buffer(#<buffer  *load*<2>> nil "nl-docstrings" nil t)

  load-with-code-conversion("c:/home/emacs-21.3/lisp/nl-docstrings.el" "nl-docstrings" nil t)

  require(nl-docstrings)

  eval-buffer(#<buffer  *load*> nil "~/.emacs" nil t)

  load-with-code-conversion("c:/.emacs" "~/.emacs" t t)

  load("~/.emacs" t t)

Anyone any ideas?

I have hacked scheme.el in the mean time and it seems to be working ok.



What  I would like to have is a key sequence which would load the current buffers file into a running newLisp instance in another buffer, is this possible?

I would also like to have a key sequnce to show documentation for the function my cursor is currently at.



Has anyone anything like this running that they could share with us newLisp/emacs newbies in the crowd?



Thanks.