TheSwamp

Code Red => .NET => Topic started by: It's Alive! on November 30, 2008, 07:10:54 PM

Title: LSharp v2
Post by: It's Alive! on November 30, 2008, 07:10:54 PM
http://www.lsharp.org/

Code: [Select]
namespace AcadLSharp
{
  public static class Commands
  {
    [CommandMethod("doit")]
    public static void doit()
    {
      Editor editor = AcAp.Application.DocumentManager.MdiActiveDocument.Editor;

      System.IO.StringReader sin = new System.IO.StringReader(string.Empty);
      System.IO.StringWriter sout = new System.IO.StringWriter();
      System.IO.StringWriter serr = new System.IO.StringWriter();
      try
      {
        LSharp.Runtime r = new LSharp.Runtime(sin, sout, serr);
        r.EvalString("(+ 1 2 3)");
        editor.WriteMessage(r.EvalString("(+ 1 2 3)").ToString());
        //editor.WriteMessage(serr.ToString());
      }
      catch (System.Exception ex)
      {
        editor.WriteMessage(ex.Message);
      }
      finally
      {
        sin.Dispose();
        sout.Dispose();
        serr.Dispose();
      }
    }
  }
}

Title: Re: LSharp v2
Post by: MP on November 30, 2008, 07:16:14 PM
Interesting; bookmarked for later. :)
Title: Re: LSharp v2
Post by: It's Alive! on November 30, 2008, 07:45:26 PM
Not sure how to use it yet, but it seems that this could be a really cool add-on for lisp
especially if I can work a way to pass a ResultBuffer to the LSharp evaluator and return a ResultBuffer to lisp.
Title: Re: LSharp v2
Post by: It's Alive! on November 30, 2008, 07:59:51 PM
Code: [Select]
;;; A minimal Windows Forms application

(reference "System.Windows.Forms")
(reference "System.Drawing")

(using "System.Drawing")
(using "System.Windows.Forms")

;; Create a form
( = form1 (new "Form"))
(.set_text form1 "Hello")

;; Create a label
(= label1 (new "Label"))
(.set_Text label1 "Hello World")
(.set_size label1 (new "Size" 224 23))
(.set_Location label1 (new "Point" 24 16))
(.add (.controls form1) label1)

;; Show the form
(.showdialog form1)

Title: Re: LSharp v2
Post by: sinc on December 01, 2008, 12:41:03 AM
This makes me think of using a nuclear power plant to turn coal into diesel fuel for running a generator in order to produce electricity.   ;-)

But I suspect a number of people are drooling over the prospect of "Lisp.NET"...
Title: Re: LSharp v2
Post by: MP on December 01, 2008, 01:00:33 AM
I think it's interesting but it's not drool worthy.
Title: Re: LSharp v2
Post by: Kerry on December 01, 2008, 03:25:29 AM

I think it's another chance for some people to get capability and expectation mixed up.
Title: Re: LSharp v2
Post by: pkohut on December 01, 2008, 05:43:02 AM
I think, I won't comment :wink:

Paul
Title: Re: LSharp v2
Post by: It's Alive! on December 01, 2008, 11:58:36 AM
Actually I think the idea of creating a lisp interpreter using Linq expression trees is very creative.  8-)

Feel free to post negative comments, but positive ones are more constructive.  :-P
Title: Re: LSharp v2
Post by: jmaeding on December 01, 2008, 12:52:58 PM
I'd be curious to hear what people really like about lisp.
For me, its mainly the fact that you can test lines of code at the command line, and that the list variables hold values that do not require casting to int or string...
In other words, a completely un-typesafe language is nice.  I can write my own checking stuff, but generally I don't mix up types.
This all stems from the fact that there are no classes in lisp.  There are only value types, and lists.

Title: Re: LSharp v2
Post by: Spike Wilbury on December 01, 2008, 01:07:40 PM
I'd be curious to hear what people really like about lisp.
For me, its mainly the fact that you can test lines of code at the command line, and that the list variables hold values that do not require casting to int or string...
In other words, a completely un-typesafe language is nice.  I can write my own checking stuff, but generally I don't mix up types.
This all stems from the fact that there are no classes in lisp.  There are only value types, and lists.



short comment:

lisp it is easy....

i'm doing porting of lisp code to arx... not easy at all - but the software company it is what they want.... :)
Title: Re: LSharp v2
Post by: sinc on December 01, 2008, 02:27:56 PM
I think some people like the "logic puzzle" aspect of Lisp.  The language has relatively few commands, but some of them are very flexible and powerful.  Coming up with the most-concise way of accomplishing a task is a lot like solving a puzzle, which some people enjoy.

That sort of programming isn't very ideal, though.  The code tends to be very obtuse, difficult to read, and difficult to maintain or expand.  Those are big drawbacks.
Title: Re: LSharp v2
Post by: Spike Wilbury on December 01, 2008, 07:24:54 PM
I think some people like the "logic puzzle" aspect of Lisp.  The language has relatively few commands, but some of them are very flexible and powerful.  Coming up with the most-concise way of accomplishing a task is a lot like solving a puzzle, which some people enjoy.

That sort of programming isn't very ideal, though.  The code tends to be very obtuse, difficult to read, and difficult to maintain or expand.  Those are big drawbacks.

I spent so much time on lisp from 1987-2001/2002 - now I would like to go back and start with C++ (what I use now)  instead of lisp but yes that's not possible  :-(
Title: Re: LSharp v2
Post by: sinc on December 01, 2008, 07:46:19 PM
It probably takes me at least twice as long to perform a task in C++, compared to C#.  The syntax of C++ is rather messy, which makes it easier to create errors that are difficult to find.  Not only is it faster/easier to write C#, I spend less time in the debugger.  And it's always possible to write some code in C++ and throw a managed wrapper around it, should you find something that can't be done (or doesn't perform well enough) in C#.

And of course, Boo makes C# look twisted...  The languages keep a'changin, and they usually get better.

But I'm sure there will still be lots of interest in that L# Lisp.NET thing...  Lisp's longevity is really rather impressive.  Isn't Lisp generally considered to be, like, the third computer language ever invented, or something like that?
Title: Re: LSharp v2
Post by: mjfarrell on December 01, 2008, 10:23:17 PM
fyi http://www-formal.stanford.edu/jmc/history/lisp/node3.html#SECTION00030000000000000000 (http://www-formal.stanford.edu/jmc/history/lisp/node3.html#SECTION00030000000000000000)
Title: Re: LSharp v2
Post by: Bryco on December 01, 2008, 11:09:43 PM
Garbage collection was designed into lisp, I wonder if the new version will be faster at all?
Title: Re: LSharp v2
Post by: tjr on December 02, 2008, 02:00:44 AM
Feel free to post negative comments, but positive ones are more constructive.  :-P
There is nothing lost with exploration. Scratch that itch and don't worry about those who don't understand.

Heck, Jim Hugunin set out to prove the CLR was terrible for dynamic languages and look what his work spawned (IronPython, IronRuby, IronLisp, etc.).
Title: Re: LSharp v2
Post by: sinc on December 02, 2008, 08:17:59 AM
Scratch that itch and don't worry about those who don't understand.

Who doesn't understand?  I think we all pretty much understand what this is.
Title: Re: LSharp v2
Post by: jmaeding on December 02, 2008, 06:09:40 PM
The pattern I see, is every major program needs both a command line language, and an object oriented API.
You can test things so easily at the command line, so development is pretty easy.
The OO stuff is easier for larger programs with lots of settings and things being passed around.

Its the ability to run stuff on the command line that is so slick in lisp.  I can test (car nil) to see if the Car function freaks out on a nil.
No way to do that in .net, you must set up a test program, then step through it.
One nice thing I figured out a few months ago, is the quickwatch window in VS.
You can type in any simple statement to see it evaluate, like someVar.GetType().ToString().
You can type in anything to see if it gives a value, helpful when investigating if you are doing what you think you are.
Title: Re: LSharp v2
Post by: tjr on December 02, 2008, 08:44:04 PM
Scratch that itch and don't worry about those who don't understand.

Who doesn't understand?  I think we all pretty much understand what this is.
To clarify I was speaking of those who don't understand the need to scratch that itch of fooling around with something that may seem useless, yet fun, but turn into something great. I wasn't implying that people here didn't understand what his code does.
Title: Re: LSharp v2
Post by: uncoolperson on December 02, 2008, 09:25:31 PM
I meant to give L# a good look when i first saw it... sadly got sidetracked with a ball of tinfoil
Aside from any negatives, the fun factor could definitely be there.

hey look tinf.....
Title: Re: LSharp v2
Post by: Spike Wilbury on December 04, 2008, 06:03:20 PM
It probably takes me at least twice as long to perform a task in C++, compared to C#.  The syntax of C++ is rather messy, which makes it easier to create errors that are difficult to find.  Not only is it faster/easier to write C#, I spend less time in the debugger.  And it's always possible to write some code in C++ and throw a managed wrapper around it, should you find something that can't be done (or doesn't perform well enough) in C#.

And of course, Boo makes C# look twisted...  The languages keep a'changin, and they usually get better.

But I'm sure there will still be lots of interest in that L# Lisp.NET thing...  Lisp's longevity is really rather impressive.  Isn't Lisp generally considered to be, like, the third computer language ever invented, or something like that?

For the few software companies I have done code so far, C++/MFC/ARX/ATL (I feel very comfortable and like it a lot) is what they want.

I still like lisp, but do not have time anymore to continue playing... I guess I did most of what I could.... I also like C# and it is easier if you come from the above languages or at least for me it was, but again little time too and mostly what I have done it is for my personal use :)

Lisp will continue... no doubt about it.
Title: Re: LSharp v2
Post by: sinc on December 04, 2008, 11:56:42 PM
For the few software companies I have done code so far, C++/MFC/ARX/ATL (I feel very comfortable and like it a lot) is what they want.

They are building on lots of existing code, then?  It seems self-destructive to start a new project using MFC at this point.
Title: Re: LSharp v2
Post by: It's Alive! on December 05, 2008, 09:04:01 AM
For the few software companies I have done code so far, C++/MFC/ARX/ATL (I feel very comfortable and like it a lot) is what they want.

They are building on lots of existing code, then?  It seems self-destructive to start a new project using MFC at this point.

Why is that? Microsoft released a bunch of new MFC goodies for VS9 && C++ is getting lots of TLC, with C++0x -> lambda expressions, regex , smart pointers etc. great stuff.
Title: Re: LSharp v2
Post by: Spike Wilbury on December 05, 2008, 09:38:54 AM
For the few software companies I have done code so far, C++/MFC/ARX/ATL (I feel very comfortable and like it a lot) is what they want.

They are building on lots of existing code, then?  It seems self-destructive to start a new project using MFC at this point.

Why is that? Microsoft released a bunch of new MFC goodies for VS9 && C++ is getting lots of TLC, with C++0x -> lambda expressions, regex , smart pointers etc. great stuff.


I just do it.... :)

Below it is a quote of an email, when I asked for information, a few days ago....

Quote
We would really need to see a resume to make a good guess.   
Which computer languages is he familiar with?  C, C++, Java? 
Which OS does he work in Windows, UNIX, Linux, or RHEL?

Has he ever had a security clearance in the last 5 years? 
If not, it’s OK given he has a clean report. 
Many jobs don’t need clearance, but it does pay better when you get one.
Title: Re: LSharp v2
Post by: Spike Wilbury on December 05, 2008, 09:42:11 AM
For the few software companies I have done code so far, C++/MFC/ARX/ATL (I feel very comfortable and like it a lot) is what they want.

They are building on lots of existing code, then?  It seems self-destructive to start a new project using MFC at this point.

Yes.

The projects I have done, must follow an structure, and I have somehow started from scratch :)

The other part, well, that's what they want.
Title: Re: LSharp v2
Post by: sinc on December 05, 2008, 09:47:52 AM

Why is that? Microsoft released a bunch of new MFC goodies for VS9 && C++ is getting lots of TLC, with C++0x -> lambda expressions, regex , smart pointers etc. great stuff.


Just that Microsoft really seems to be going .NET these days, and the CLI stuff is SO much cleaner than MFC.
Title: Re: LSharp v2
Post by: Spike Wilbury on December 05, 2008, 09:53:41 AM

Why is that? Microsoft released a bunch of new MFC goodies for VS9 && C++ is getting lots of TLC, with C++0x -> lambda expressions, regex , smart pointers etc. great stuff.


Just that Microsoft really seems to be going .NET these days, and the CLI stuff is SO much cleaner than MFC.

Sinc,

If it was for me, I will use it.... when I get a chance (on any of the future projects) I will try to see if they want that... (one of the comments the lead programmer(s) mention is protection of the source code and that they have their own structure)

:)
Title: Re: LSharp v2
Post by: sinc on December 05, 2008, 10:11:47 AM
For people with lots of legacy MFC code, it's hard to switch.  They typically have all these libraries all built, debugged, and working, with lots of other code using those libraries, and changing that can be pretty difficult.

I think that's why MS is continuing to release tools for MFC, not because they really want people to use it, just that they recognize that too many of their big customers still have too much MFC stuff, and that isn't going to change for quite some time.
Title: Re: LSharp v2
Post by: Spike Wilbury on December 05, 2008, 10:22:14 AM
For people with lots of legacy MFC code, it's hard to switch.  They typically have all these libraries all built, debugged, and working, with lots of other code using those libraries, and changing that can be pretty difficult.

I think that's why MS is continuing to release tools for MFC, not because they really want people to use it, just that they recognize that too many of their big customers still have too much MFC stuff, and that isn't going to change for quite some time.

Sinc,

What do you use for your protection of your software, the obfuscation? or ?

Thanks.
Title: Re: LSharp v2
Post by: sinc on December 05, 2008, 11:01:07 AM
Yeah, I use Dotfuscator.  Some of the obfuscators are garbage, but Dotfuscator seems to do a pretty good job.  At least, I tried to crack it, and decided I MIGHT be able to do it, but I could tell it would take a lot more work than I felt like doing, or if there's some easy way to do it, it takes someone who knows a lot more about Microsoft stuff than I to manage it.  And that's a good enough protection level for my software.

There's also stuff that compiles your .NET code into an executable file, much like when you compile C++.  They say that thing gives you even more security, but I haven't tried it myself.
Title: Re: LSharp v2
Post by: It's Alive! on December 05, 2008, 11:30:35 AM

Why is that? Microsoft released a bunch of new MFC goodies for VS9 && C++ is getting lots of TLC, with C++0x -> lambda expressions, regex , smart pointers etc. great stuff.


Just that Microsoft really seems to be going .NET these days, and the CLI stuff is SO much cleaner than MFC.

True

I used C++/CLI on this project here. 
http://www.theswamp.org/index.php?topic=23943.msg315006#msg315006

Since most forms/Dialogs only need a few types I.e Strings , it’s easy enough to create a couple of wrappers.
Title: Re: LSharp v2
Post by: It's Alive! on December 07, 2008, 12:43:39 AM
Well I was able to attach the L# runtime to AutoCAD in a better way. A single instance of the runtime and environment is started on load, this stores the global/local vars and L# functions. Also I can now define a function in L# and  call it from lisp.

I.e.

Code: [Select]
;;;mytest.lsp
(reference "C:\\Program Files\\AutoCAD 2007\\acmgd.dll")
(reference "C:\\Program Files\\AutoCAD 2007\\acdbmgd.dll")

(using "Autodesk.AutoCAD.GraphicsInterface")
(using "Autodesk.AutoCAD.Runtime")
(using "Autodesk.AutoCAD.Windows")
(using "Autodesk.AutoCAD.Geometry")
(using "Autodesk.AutoCAD.EditorInput")
(using "Autodesk.AutoCAD.LayerManager")
(using "Autodesk.AutoCAD.ApplicationServices")
(using "Autodesk.AutoCAD.DatabaseServices")

(def mytest ()
  (prn (Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable "date"))
)

And

Code: [Select]
(L#EvalString"(mytest)")

I still need to map the functions in AutoCAD, so in the future I can just call (mytest) and I need to work on returning the correct type

Title: Re: LSharp v2
Post by: It's Alive! on December 07, 2008, 09:18:29 AM
I am thinking about using the decorator L#: to define a L# function that is callable from Autolisp. Thoughts? 
How about command function? For now I think command functions will need to wrapped in an Autolisp function..I.e.

Code: [Select]
(defun c:doit()
 (L#:doit)
)
Title: Re: LSharp v2
Post by: It's Alive! on December 08, 2008, 02:18:07 AM
Cewl, I was able to map L# functions to AutoCAD. For example I can create a L# file that contains the following code.

Code: [Select]
(def L#DATE ()
  (prn (Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable "date"))
)

(def L#CTAB ()
  (prn (Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable "CTAB"))
)

(def L#CLAYER ()
  (prn (Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable "CLAYER"))
)

Upon loading of the file, all the functions defined by “def” and decorated with L#, will be added to AutoCAD so L# functions can be called within AutoLisp.
I.e

Code: [Select]
(L#LOAD "C:\\test.lsp")

!L#CLAYER

(L#CLAYER)

;;
(defun doit()
 (L#CLAYER)
)

Next, I need to work on passing parameters and accessing global variables  :-o
BTY, the first time a L# function is loaded, Its compiled to MSIL and stored in L#’s environment,
when the function is called from Autolisp, it’s pretty snappy.


Title: Re: LSharp v2
Post by: It's Alive! on December 08, 2008, 11:03:25 AM
We have parameters (some)

Code: [Select]
;;;L#
(def L#MBOX (msg title)
  (prn (MessageBox.Show msg title))
)

Code: [Select]
;;;AutoLisp
(L#MBOX "This is a message from AutoLisp" "We Have Parameters")

Title: Re: LSharp v2
Post by: pkohut on December 08, 2008, 11:09:01 AM
What about error handling?  What happens if 2 ints are passed to L#MBOX ?

We have parameters (some)

Code: [Select]
;;;L#
(def L#MBOX (msg title)
  (prn (MessageBox.Show msg title))
)

Code: [Select]
;;;AutoLisp
(L#MBOX "This is a message from AutoLisp" "We Have Parameters")


Title: Re: LSharp v2
Post by: It's Alive! on December 08, 2008, 11:13:45 AM
For now, I am throwing the exception messages back as a cons list.
I don’t think I will be able to do a stack trace.

Title: Re: LSharp v2
Post by: It's Alive! on December 08, 2008, 11:19:07 AM
My problem is now with types.
Example  It won’t let me pass an integer as a System.Windows.Forms.MessageBoxButtons.YesNo. I have an email out to the author
on this.  :mrgreen:
Title: Re: LSharp v2
Post by: pkohut on December 08, 2008, 11:19:44 AM
I see.

What about C# structs being passed back and forth?  Are they going
to be wrapped in resbufs?  Just thought of 1 more - how would functions
work that pass by reference?

Thanks,
Paul
Title: Re: LSharp v2
Post by: It's Alive! on December 08, 2008, 11:58:18 AM
Good questions, and the answer is , I don’t know yet.

Obviously there will be many limitations, given the nature of Autolisp and the types it recognizes,.

In dealing with structs, I assume one would need to write a L# wrapper that would convert lisp parameter(s) or lisp list(s)
to a type that can be consumed by the struct’s constructor.
I.e send a list of 16 doubles to L#, than have L# convert the list to an array to fill a Matrix3d.. This is something I’ll need to try.

I have no idea how, or if it’s even possible to pass by reference in L#  :mrgreen:
Title: Re: LSharp v2
Post by: Spike Wilbury on December 08, 2008, 12:38:37 PM
are you going to emulate what it is now in autolisp/vlisp or just something new that can be added ?
Title: Re: LSharp v2
Post by: It's Alive! on December 08, 2008, 12:46:04 PM
are you going to emulate what it is now in autolisp/vlisp or just something new that can be added ?

 No, I am trying to make Vlisp interact with L# so they can be used together.
Title: Re: LSharp v2
Post by: Spike Wilbury on December 08, 2008, 01:02:18 PM
are you going to emulate what it is now in autolisp/vlisp or just something new that can be added ?

 No, I am trying to make Vlisp interact with L# so they can be used together.

thanks Daniel...

wonder how are you going to handle: list's, mapcar's, lambda's and when they have or are made of different types and are deep nested, if end up using as arguments - waiting for see that.
Title: Re: LSharp v2
Post by: It's Alive! on December 08, 2008, 01:39:22 PM
are you going to emulate what it is now in autolisp/vlisp or just something new that can be added ?

 No, I am trying to make Vlisp interact with L# so they can be used together.

thanks Daniel...

wonder how are you going to handle: list's, mapcar's, lambda's and when they have or are made of different types and are deep nested, if end up using as arguments - waiting for see that.

me too  :-D
Title: Re: LSharp v2
Post by: It's Alive! on December 08, 2008, 01:39:54 PM
Sample

Code: [Select]
(def L#ADDLINE ()
 (= pDb (HostApplicationServices.WorkingDatabase))
 (= tm (.TransactionManager pDb))
 (= tr (.StartTransaction tm))
 (= id (SymbolUtilityServices.GetBlockModelSpaceId pDb))
 (= mode (OpenMode.ForWrite))
 (= blockTableRecord (.GetObject tr id mode))
 (= line (new "Line" (new "Point3d" 0 0 0) (new "Point3d" 100 100 0)))
 (= id2 (.AppendEntity blockTableRecord line))
 (.AddNewlyCreatedDBObject tr line true)
 (.Commit tr)
 (.Dispose tr)
 id2
)

Title: Re: LSharp v2
Post by: Spike Wilbury on December 08, 2008, 02:06:07 PM
are you going to emulate what it is now in autolisp/vlisp or just something new that can be added ?

 No, I am trying to make Vlisp interact with L# so they can be used together.

thanks Daniel...

wonder how are you going to handle: list's, mapcar's, lambda's and when they have or are made of different types and are deep nested, if end up using as arguments - waiting for see that.

me too  :-D


 :lol:

and wait for: append, cdr, reverse, member - to mention a few..... (I am in this boat right now btw lisp->c++/arx)
Title: Re: LSharp v2
Post by: TonyT on December 09, 2008, 02:09:06 AM
Sample

Code: [Select]
(def L#ADDLINE ()
 (= pDb (HostApplicationServices.WorkingDatabase))
 (= tm (.TransactionManager pDb))
 (= tr (.StartTransaction tm))
 (= id (SymbolUtilityServices.GetBlockModelSpaceId pDb))
 (= mode (OpenMode.ForWrite))
 (= blockTableRecord (.GetObject tr id mode))
 (= line (new "Line" (new "Point3d" 0 0 0) (new "Point3d" 100 100 0)))
 (= id2 (.AppendEntity blockTableRecord line))
 (.AddNewlyCreatedDBObject tr line true)
 (.Commit tr)
 (.Dispose tr)
 id2
)



Not terribly thrilled with that syntax, not at all.

(= var value) for assignment makes no sense to
LISP programmers for whom (setq) or (setf) are
second nature. If following more strictly, Common
LISP conventions, it would be (setf) that is used
to set properties of an object, but which form
the accessor should take seems to be the subject
of much debate.

The fact that they ended up with this contortion
(I'll call it 'LISP from hell'), which looks like it's just
a big ugly hack, largely out of sheer convenience,
pretty much seals the fate of L#.

My guess is that most hard-core LISPers would
have no part of it.
Title: Re: LSharp v2
Post by: It's Alive! on December 09, 2008, 02:53:23 AM

I certainly agree, some of the syntax is not like Autolisp at all, (= var value) is very weird.
The good news is that the author has made it very simple to change and add new items.
Once I further a long, I will dig in and see if I can make it more Autolisp like.
I did notice the SETQ and SET are already defined.
 
Title: Re: LSharp v2
Post by: It's Alive! on December 09, 2008, 03:52:17 AM
Sorry SETQ was not defined, I have added it

Code: [Select]
(def L#DATE ()
  (setq a (Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable "date"))
  a
)

&&

Code: [Select]
(def L#ADDLINE ()
     (setq pDb (HostApplicationServices.WorkingDatabase))
     (setq tm (.TransactionManager pDb))
     (setq tr (.StartTransaction tm))
     (setq id (SymbolUtilityServices.GetBlockModelSpaceId pDb))
     (setq mode (OpenMode.ForWrite))
     (setq blockTableRecord (.GetObject tr id mode))
     (setq line
        (new "Line" (new "Point3d" 0 0 0) (new "Point3d" 100 100 0))
     )
     (setq id2 (.AppendEntity blockTableRecord line))
     (.AddNewlyCreatedDBObject tr line true)
     (.Commit tr)
     (.Dispose tr)
     id2
)
Title: Re: LSharp v2
Post by: It's Alive! on December 09, 2008, 05:54:31 PM
Here is a list of functions, I suspect this list will change since L# is sill experimental

Code: [Select]
;;;Command: (L#EvalStr"(map (fn (x) (prn (+(.ToUpper(.ToString(.key x))) \"  \")))  environment)")

("ISO  LOAD  EVERY?  EXPT  NOT  BOUND  CAAR  TRUE  REST  REDUCE  OR  SEQ  DO1 
UNLESS  PR  DEF  LENGTH  LIST  PROGN  TESTIFY  TIME  MSEC  EVEN  +  COMPILE 
TOLIST  LET  CDDR  TYPE  LEN  LAST  MACEX1  SQRT  STDOUT  MOD  APPLY  EVAL  PRN
 REVERSE  -  *  NO  CADR  DEFUN  NOR  IDFN  ERR  CONS  T  NIL  FOR  <  TOARRAY 
SLEEP  >  NTH  USING  REFERENCE  STDERR  ISA  AND  WHILE  PAIR  MEMBER?  STDIN 
MACEX  RANGE  EMPTY?  UNIQ  FIRST  NEW  HELP  ATOM?  SET  WHEN  THROW  WITH 
NULL  COERCE  ENVIRONMENT  IS  DO  STR  FALSE  SAFESET  ODD  CDR  MAC  SEQ? 
SETQ  =  MAP  SOME?  /  INSPECT  TYPEOF  CAR  EACH  ")

Title: Re: LSharp v2
Post by: kdub_nz on December 09, 2008, 06:44:08 PM
Which of those have you added and which are native Daniel ?
Title: Re: LSharp v2
Post by: It's Alive! on December 09, 2008, 07:11:28 PM
I added SETQ and DEFUN.. Actually they are just synonyms for SET and DEF.
Title: Re: LSharp v2
Post by: It's Alive! on December 10, 2008, 12:39:06 AM
PFC  8-)

Code: [Select]
(reference "System.Xml")
(= news (new "System.Xml.XmlDocument"))
(.load news "http://www.theregister.co.uk/headlines.rss")
(map (fn (x) (.innertext x)) (.selectnodes news  "/rss/channel/item/title"))