Boo Boo 2 Boo 2.NET Framework SDK 2 Subversion 2 2 Java 4 NAnt 5 Boo 5 5 Boo if 11 for 11 range 12 break continue 13 pass

Similar documents
listings-ext

Java updated

r07.dvi

ohp07.dvi

Python Speed Learning


JavaScript 1.! DOM Ajax Shelley Powers,, JavaScript David Flanagan, JavaScript 2

Python Speed Learning

or a 3-1a (0 b ) : max: a b a > b result a result b ( ) result Python : def max(a, b): if a > b: result = a else: result = b ret

haskell.gby

cpp1.dvi

r03.dvi

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1

ohp03.dvi


Condition DAQ condition condition 2 3 XML key value

bdd.gby

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

test.gby

1.3 ( ) ( ) C

untitled

Q&A集

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

javascript key

fp.gby

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

ワークショップ テスト駆動開発

2.2 Java C main Java main 2 C 6 C Java 3 C Java ( ) G101Hello.java G101Hello main G101Hello.java /* G101Hello */ class G101Hello { /* main */ public s

新・明解Java入門

ALG ppt

導入基礎演習.ppt

8 if switch for while do while 2

CodeIgniter Con 2011, Tokyo Japan, February

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

text_08.dvi

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental data structures /06/14(Tue) / Memory Management

Parametric Polymorphism

解きながら学ぶJava入門編

LogisticaTRUCKServer-Ⅱ距離計算サーバ/Active-Xコントロール/クライアント 概略   

(CC Attribution) Lisp 2.1 (Gauche )

Java演習(4) -- 変数と型 --

Microsoft PowerPoint - 11RubyIntro-No02.ppt [互換モード]

Copyright c 2008 Zhenjiang Hu, All Right Reserved.

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1

2

(Java/FX ) Java CD Java version Java VC++ Python Ruby Java Java Eclipse Java Java 3 Java for Everyone 2 10 Java Midi Java JavaFX Shape Canvas C

Jacques Garrigue

K227 Java 2

コーディング基準.PDF

VB


untitled

piyo0705B.rtfd

main

アルゴリズムとデータ構造1

Java学習教材

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2

myx_backup Ver 1.10のPHP7対応


Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

ALG2012-A.ppt

10-C.._241_266_.Z

parser.y 3. node.rb 4. CD-ROM

(STL) STL 1 (deta structure) (algorithm) (deta structure) 2 STL STL (Standard Template Library) 2.1 STL STL ( ) vector<int> x; for(int i = 0; i < 10;

r02.dvi

TOEIC

ohp02.dvi

離散数理工学 第 2回 数え上げの基礎:漸化式の立て方

ハッシュテーブル

cpp2.dvi


1

My関数の作成演習問題集

Microsoft PowerPoint - C_Programming(3).pptx

PowerPoint Presentation

( ) ( ) lex LL(1) LL(1)

r08.dvi

untitled

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World");

untitled

RubyKaigi2009 COBOL

programmingII2019-v01

if clear = 1 then Q <= " "; elsif we = 1 then Q <= D; end rtl; regs.vhdl clk 0 1 rst clear we Write Enable we 1 we 0 if clk 1 Q if rst =

r1.dvi

WinHPC ppt

lifedesign_contest_No3

プロセス間通信

yacc.dvi

第10回 コーディングと統合(WWW用).PDF

I. (i) Java? (A). 2Apples (B). Vitamin-C (C). Peach21 (D). Pine_Apple (ii) Java? (A). Java (B). Java (C). Java (D). JavaScript Java JavaScript Java (i

離散数理工学 第 2回 数え上げの基礎:漸化式の立て方

r3.dvi

PowerPoint Presentation

超初心者用

IronPython による柔軟なゲーム開発 筑波大学 AmusementCreators

1.ppt

(OnePoint) ( URL Web Copyright 2005 Microsoft Corporation. All rights reserved. Microsoft Windows Visual Basic Visual Studio Microsoft Corporation

2008 DS T050049


Copyright c 2006 Zhenjiang Hu, All Right Reserved.

Transcription:

Boo Boo 2 Boo 2.NET Framework SDK 2 Subversion 2 2 Java 4 NAnt 5 Boo 5 5 Boo 6 6 7 9 10 11 if 11 for 11 range 12 break continue 13 pass 13 13 14 15 15 23 23 24 24 24 25 import 26 27-1-

Boo Boo Python CLI.NET Mono Python.NET C#/VB.NET Boo C#/VB.NET Boo Boo Boo Boo Visual Studio.NET.NET Framework SDK C# Boo Subversion Subversion http://subversion.tigris.org/project_packages.html Windows GUI Tortoise http://tortoisesvn.tigris.org/ Tortoise Tortoise -2-

Subversion Checkout... TortoiseSVN Checkout... Boo c: home product boo -3-

URL - svn://svn.boo.codehaus.org/boo/scm/trunk/ URL OK Boo Boo Java Boo ALTLR Java -4-

Boo NAnt NAnt http://nant.sourceforge.net Java NAnt Boo Boo c: home product boo nant rebuild build Boo Boo pt Boo.dll Boo.Lang.Compiler.dll Boo.Lang.Interpreter.dll Boo.Lang.Parser.dll Boo.NAnt.Tasks.dll booc.exe booc.rsp booi.exe booish.exe Boo booish booc booi booish sh boosh -5-

1 +2 3... if a =10 10 if a = 10:... print "OK"... OK if Boo 2 +2 4 2 +2# 4 2 +2// 4-6-

2 +2/* */ 4 C#= a =10 10 x =y=z=10 10 x 10 y 10 z 10 1.2 + 3.4 4.6 _ _ *2 9.2 'Hello, World' 'Hello, World' "Hello, World" -7-

'Hello, World' + hello = "Hello" + ", " + "World" 'Hello, World' hello 0 H Boo BCL String hello 0 = 'h' ----^ ERROR: Property 'System.String.Chars' is read only. : :, hello 1:5 'ello' 0 hello :2 'He' hello 2: 'llo, World' hello :-1 'Hello, Worl' -8-

-1 0 1 'd' 'd' ' n' Boo c = 1, 'two', 3.0, "four" 1, 'two', 3, 'four' c 2 = 3.3 c 1, 'two', 3.3, 'four' c 2: 3.3, 'four' Add c.add 5 1, 'two', 3.3, 'four', 5 c.add 'six'1, 'two', 3.3, 'four', 5, 'six' AddUnique c.addunique 3.3 1, 'two', 3.3, 'four', 5, 'six' c.addunique 7.7 1, 'two', 3.3, 'four', 5, 'six', 7,7 Remove c.remove 1-9-

'two', 3.3, 'four', 5, 'six', 7,7 c.remove 5 'two', 3.3, 'four', 'six', 7,7 RemoveAt c.removeat 2 'two', 3.3, 'six', 7,7 len len c 4 Clear c.clear len c 0 Boo Fibonacci a,b=0,1#a=0,b=1 1 while b 10: # while... print'*',b#b... a,b=b,a+b# Fibonacci... *1 *1 *2 *3 *5 *8 13-10-

13 Fibonacci '*' C#... Boo while b 10:... print '*' b... a, b = b, a + b... while print b Boo if-elif given-when C# switch-case if x 0:... print 'Negative'... elif x == 0:... print 'Zero'... else:... print 'Positive' C#for foreach cities = 'Tokyo', 'Sapporo', 'Osaka' 'Tokyo', 'Sapporo', 'Osaka' for city in cities:... print city, len city... -11-

Tokyo 5 Sapporo 7 Osaka 5 C#for range cnt = len cities 3 for i in range cnt :... print cities i, len cities i... Tokyo 5 Sapporo 7 Osaka 5 range Python range 5 0 4 Boo r =range 5 Boo.Lang.Builtins+RangeEnumerator RangeEnumerator IEnumearator r.movenext true r.current 0 r.movenext true r.current 1-12-

C#break/continue x =0 0 while true... ++x # x x++... if x 3:... continue #... if x 8:... break #... print'*'*x#'*'x... *** **** ***** ****** ******* ******** 9 if x 10:... pass... else:... print x fibonacci -13-

def fib n as int :... a,b=0,1... while b n:... print '*', b... a,b=b,a+b... fib 10 *1 *1 *2 *3 *5 *8 def : def as : Boo def make_incrementor n asint :... return def x asint :... return x + n... f = make_incrementor 42 Input11Module+ closure1.invoke f 0 42 f 1 43-14-

def def make_incrementor n asint :... return x asint x+n... 3.3 List Add object item list = list.add 1 1 list.add "two" 1, 'two' List AddUnique object item list = list.addunique 1 1 list.addunique 1 1-15-

list.addunique "two" 1, 'two' void Clear null 0 list = 1, 2, 3 1,2,3 list.clear list List Collect Predicate condition Predicate object bool list = i for i in range 10 1,2,3,4,5,6,7,8,9 sub = list.collectx asint x 5 0,1,2,3,4 List Collect List target, Predicate condition target target list = i for i in range 10 1,2,3,4,5,6,7,8,9 sub = 'one', 'two', 'three' 'one', 'two', 'three' list.collect sub, x asint = 3 'one', 'two', 'three', 0, 1, 2, 3 bool Contains object item item true list = 'one', 'two', 'three' 'one', 'two', 'three' list.contains 'one' true list.contains 'four' -16-

false bool Contains Predicate condition true list = i for i in range 10 list.containsx asint returnx 3 true list.containsx asint returnx = 10 false void CopyTo Array target, int index index list = i for i in range 10 arr = array range 0, 20 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, 19 list.copyto arr, 10 arr 0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 List Extend IEnumerable enumerable list = i for i in range 10 list.extend range 10, 20 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, 19 object Find Predicate condition list = i for i in range 10 list.findx asint returnx 7-17-

0 List GetRange int begin begin list = i for i in range 10 list.getrange 3 3,4,5,6,7,8,9 List GetRange int begin, int end begin, end list = i for i in range 10 list.getrange 3, 7 3,4,5,6 int IndexOf Predicate condition -1 list = i for i in range 10 list.indexofx as int return x 5 6 int IndexOf object item -1 list = i for i in range 10 list.indexof 7 7 List Insert int index, object item list = i for i in range 10-18-

list.insert 5, 4.5 0,1,2,3,4,4.5,5,6,7,8,9 string Join string separator separator list = i for i in range 10 list.join ' ' '0 1 2 3 4 5 6 7 8 9' List Multiply int count count list = 'one', 'two', 'three' 'one', 'two', 'three' list.multiply 3 'one', 'two', 'three', 'one', 'two', 'three', 'one', 'two', 'three' object Pop list = i for i in range 10 list.pop 9 list 0,1,2,3,4,5,6,7,8 object Pop int index index list = i for i in range 10 list.pop 0 0 list 1,2,3,4,5,6,7,8,9-19-

List Push object item list = i for i in range 10 list.push 10 0,1,2,3,4,5,6,7,8,9,10 List Remove object item list = 'one', 'two', 'three' 'one', 'two', 'three' list.remove 'two' 'one', 'three' List RemoveAt int index index list = 'one', 'two', 'three' 'one', 'two', 'three' list.removeat 1 'one', 'three' List Sort list = 'one', 'two', 'three' 'one', 'two', 'three' list.sort 'one', 'three', 'two' List Sort Comparer comparer comparer comparer object int list = 'one', 'two', 'three' 'one', 'two', 'three' list.sortx as string, y as string return y.compareto x -20-

'two', 'three', 'one' Array ToArray Type targettype targettype list = i for i in range 10 arr = list.toarray typeof int arr.gettype System.Int32 objecttoarray list = i for i in range 10 arr = list.toarray arr.gettype System.Object int Count list = 'one', 'two', 'three' 'one', 'two', 'three' list.count 3 stack = 3,4,5 3,4,5 stack.push 6 3,4,5,6-21-

stack.push 7 3,4,5,6,7 stack.pop 7 stack 3,4,5,6 stack.pop 6 stack.pop 5 stack 3, 4 queue = 3,4,5 3,4,5 queue.push 6 3,4,5,6 queue.push 7 3,4,5,6,7 queue.pop 0 3 queue.pop 0 4 queue 5,6,7 "map function, enumerable "enumerable x function x enumerable 1 9 list = List mapx asint returnx*x, range 1, 10 1, 4, 9, 16, 25, 36, 49, 64, 81-22-

1 9 list = x *xforxinrange 1, 10 list = x *xforxinrange 1, 10 ifx%2!=0 1,9,25,49,81 list = x *xforxinrange 1, 10 unless x % 2 == 0 1,9,25,49,81 Boo BCL Array BCL array, arr1 = array typeof int, 10 # int 10 0,0,0,0,0,0,0,0,0,0 arr2 = 1,2,3,4,5 # 1,2,3,4,5 1,2,3,4,5 Boo Hash BCL Hashtable BCL Key:Value, hash = 'one': 1, 'two': 2 'two': 2, 'one': 1 hash 'one' 1 hash 'two' 2-23-

hash 'three' = 3 hash 'three': 3, 'two': 2, 'one': 1 for e in hash:... print e.key, e.value... three 3 two 2 one 1 for k in hash.keys:... print k... three two one for v in hash.values:... print v... 3 2 1 booish fib.boo # fib.boo -24-

def fib n as int : #n a,b=0,1 while b n: System.Console.Write b +"" a,b=b,a+b print def fib2 n asint : #n result = a,b=0,1 while b n: result.add b a,b=b,a+b return result fib 1000 print fib2 1000 booi fib.boo fib.boo 1123581321345589144233377610987 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987 booi fib.boo fibfib2 fib.boo fib.boo Boo DLL booc.exe Boo -25-

booc -t:library fib.boo -t DLL fib.dll booc -t:library foo.boo bar.boo foo.dll DLL DLL -o boo -t:library -o:mydll foo.boo bar.boo mydll.dll DLL your.dll fib calc my.dll calc calc my.dll your.dll BCE0004: Ambiguous reference 'calc': Your Module.calc, MyModule.calc. 1 error s. # your.boo -26-

namespace Your def calc: print "your.calc" # my.boo namespace My def calc: print "my.calc" "namespace " app.boo # app.boo Your.calc My.calc ". " ". " import # app.boo import Your calc# Your.calc My.calc MyYour import DLL EXE booi EXE fib.dll app.boo -27-

booi -r:fib.dll app.boo EXE booc -t:exe -r:fib.dll app.boo EXE app.exe -28-