[PR]
×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
プログラミング、3DCGとその他いろいろについて
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
@echo OFF "C:\Program Files (x86)\Mono-2.10.9\bin\mono.exe" "C:\Program Files (x86)\IronPython 2.7\ipy.exe" %*
-X:Frames C:\Users\Developer\Documents\Eclipse\eclipse-SDK-4.2.1-win32\eclipse\plugins\org.python.pydev_2.7.1.2012100913\pysrc\interpreterInfo.py
<xml> <version>2.7</version> <executable>C:\Program Files (x86)\IronPython 2.7\ipy.exe</executable> <lib path="out">C:\Users\Developer\Documents\Eclipse\eclipse-SDK-4.2.1-win32\eclipse\plugins\org.python.pydev_2.7.1.2012100913\pysrc</lib> <lib path="ins">C:\Program Files (x86)\IronPython 2.7\Lib</lib> <lib path="ins">C:\Program Files (x86)\IronPython 2.7\DLLs</lib> <lib path="ins">C:\Program Files (x86)\IronPython 2.7</lib> <lib path="ins">C:\Program Files (x86)\IronPython 2.7\lib\site-packages</lib> <forced_lib>exceptions</forced_lib> <forced_lib>__builtin__</forced_lib> <forced_lib>sys</forced_lib> <forced_lib>unicodedata</forced_lib> <forced_lib>_ast</forced_lib> <forced_lib>imp</forced_lib> <forced_lib>future_builtins</forced_lib> <forced_lib>clr</forced_lib> <forced_lib>cmath</forced_lib> <forced_lib>msvcrt</forced_lib> <forced_lib>mmap</forced_lib> <forced_lib>signal</forced_lib> <forced_lib>winsound</forced_lib> <forced_lib>zipimport</forced_lib> <forced_lib>zlib</forced_lib> <forced_lib>_bisect</forced_lib> <forced_lib>_codecs</forced_lib> <forced_lib>_collections</forced_lib> <forced_lib>copy_reg</forced_lib> <forced_lib>cPickle</forced_lib> <forced_lib>cStringIO</forced_lib> <forced_lib>datetime</forced_lib> <forced_lib>errno</forced_lib> <forced_lib>gc</forced_lib> <forced_lib>itertools</forced_lib> <forced_lib>_csv</forced_lib> <forced_lib>_io</forced_lib> <forced_lib>_locale</forced_lib> <forced_lib>marshal</forced_lib> <forced_lib>math</forced_lib> <forced_lib>_md5</forced_lib> <forced_lib>nt</forced_lib> <forced_lib>operator</forced_lib> <forced_lib>_sha</forced_lib> <forced_lib>_sha256</forced_lib> <forced_lib>_sha512</forced_lib> <forced_lib>socket</forced_lib> <forced_lib>_ctypes</forced_lib> <forced_lib>_ctypes_test</forced_lib> <forced_lib>_heapq</forced_lib> <forced_lib>_struct</forced_lib> <forced_lib>thread</forced_lib> <forced_lib>time</forced_lib> <forced_lib>xxsubtype</forced_lib> <forced_lib>_functools</forced_lib> <forced_lib>_random</forced_lib> <forced_lib>_sre</forced_lib> <forced_lib>_ssl</forced_lib> <forced_lib>_subprocess</forced_lib> <forced_lib>_warnings</forced_lib> <forced_lib>_weakref</forced_lib> <forced_lib>_winreg</forced_lib> <forced_lib>bz2</forced_lib> <forced_lib>re</forced_lib> <forced_lib>select</forced_lib> <forced_lib>binascii</forced_lib> <forced_lib>array</forced_lib> <forced_lib>_sqlite3</forced_lib> <forced_lib>wpf</forced_lib> </xml>なので、ここまでではMacだとひどい目にあいます。
(show-paren-mode t) ;思わず"\"C:\\Program Files\\IronScheme\\IronScheme.Console\" -emacs" ;としたくなってしまうかもしれませんが、それでは何故かうまくいきません。 ;%ProgramFiles%を使ってもダメです。 ;きちんと"C:\Program Files\IronScheme"にパスを通して、以下のようにしてください。 ;run-schemeの実装に原因があるかもしれません(※)。 ;※参考:http://saito.s4.xrea.com/wiliki.cgi?Emacs%3Ascheme-args-to-list (setq scheme-program-name "IronScheme.Console.exe -emacs") (run-scheme scheme-program-name) ;エラーの文字化け対策 (modify-coding-system-alist 'process "IronScheme.Console" '(utf-8 . utf-8))
(show-paren-mode t)
(import (rnrs) (ironscheme clr)) (clr-using System) (define myArray (clr-new-array Int32 4)) (do ((index 0 (+ index 1))) ((= index (clr-prop-get Array Length myArray))) (clr-indexer-set! Int32[] myArray index index)) (do ((index 0 (+ index 1))) ((= index (clr-prop-get Int32[] Length myArray))) (clr-static-call Console WriteLine (clr-indexer-get Int32[] myArray index))) (clr-static-call Console ReadLine)
using System; class Program { public static int[] myArray = new int[4]; static void Main() { for (int index = 0; !(index == myArray.Length); index++) { myArray[index] = index; } for (int index = 0; !(index == myArray.Length); index++) { Console.WriteLine(myArray[index]); } Console.ReadLine(); } }
0 1 2 3
36561384 36561408 36561432 36561456
(import (rnrs) (ironscheme clr)) (clr-using System) (define myArray (clr-new-array Int32 1)) (clr-indexer-set! Int32[] myArray 0 42) (display (clr-indexer-get Int32[] myArray 0)) (clr-static-call Console ReadLine)C#でいうとこんな感じです:
using System; class Program { public static int[] myArray = new int[1]; static void Main() { myArray[0] = 42; Console.Write(myArray[0]); Console.ReadLine(); } }
42
(import (rnrs) (ironscheme clr)) (clr-using System) (define myArray (clr-new-array Int32 1)) (define value 42) (clr-indexer-set! Int32[] myArray 0 value) (display (clr-indexer-get Int32[] myArray 0)) (clr-static-call Console ReadLine)
using System; class Program { public static int[] myArray = new int[1]; public static int value = 42; static void Main() { myArray[0] = value; Console.Write(myArray[0]); Console.ReadLine(); } }
42
(import (rnrs) (ironscheme clr)) (clr-using System) (define myArray (clr-new-array Int32 1)) (let ((value 42)) (clr-indexer-set! Int32[] myArray 0 value) (clr-static-call Console WriteLine value)) (clr-static-call Console WriteLine (clr-indexer-get Int32[] myArray 0)) (clr-static-call Console ReadLine)
using System; class Program { public static int[] myArray = new int[1]; static void Main() { int value = 42; myArray[0] = value; Console.Write(myArray[0]); Console.ReadLine(); } }
42 39708184
(import (rnrs) (ironscheme clr)) (let ((value 42)) (clr-static-call System.Console WriteLine "{0} {1}" (clr-call System.Object GetType value) value)) (clr-static-call System.Console ReadLine)
class Program { public static int[] myArray = new int[1]; static void Main() { int value = 42; System.Console.WriteLine("{0} {1}", value.GetType(), value); System.Console.ReadLine(); } }
System.Int32 42
(import (rnrs) (ironscheme clr)) (clr-using System) (define myArray (clr-new-array Int32 4)) (do ((index 0 (+ index 1))) ((= index (clr-prop-get Array Length myArray))) (clr-indexer-set! Int32[] myArray index (clr-cast Int32 index))) (do ((index 0 (+ index 1))) ((= index (clr-prop-get Int32[] Length myArray))) (display (clr-indexer-get Int32[] myArray index)) (newline)) (clr-static-call Console ReadLine)C#版:
using System; class Program { public static int[] myArray = new int[4]; static void Main() { for (int index = 0; !(index == myArray.Length); index++) { myArray[index] = (int)index; } for (int index = 0; !(index == myArray.Length); index++) { Console.WriteLine(myArray[index]); } Console.ReadLine(); } }
0 1 2 3あれ…
(import (rnrs) (ironscheme clr)) (clr-using System) (define myValue 0) (let ((value 42)) (set! myValue value) (clr-static-call Console WriteLine value)) (clr-static-call Console WriteLine myValue) (clr-static-call Console ReadLine)
42 42正常です。
(import (rnrs) (ironscheme clr)) (clr-reference PresentationFramework) (clr-reference PresentationCore) (clr-reference WindowsBase) (clr-using System.Windows) (clr-using System.Threading) (define runApplication (lambda () (define app (clr-new Application)) (clr-call Application Run app (clr-new Window)))) (define staThread (clr-new Thread runApplication)) (clr-call Thread SetApartmentState staThread 'STA) (clr-call Thread Start staThread)
using System.Windows; using System.Threading; class Program { static void runApplication() { var app = new Application(); app.Run(new Window()); } static void Main(string[] args) { var staThread = new Thread(runApplication); staThread.SetApartmentState(ApartmentState.STA); staThread.Start(); } }そうですね