Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
Maplets のスタイルガイド
このドキュメントでは、maplet コードを構築する際の推奨事項を記します。構築の方法により、ユーザ自身と、その maplet を保守し、理解することが必要な将来の maplet の製作者の双方にとって、maplet の読みやすさが改善されます。
Maplets を書く際には、以下の指針に従います:
1. 1 行を 1 つの要素の定義に使用する。要素の定義が短い場合には、複数の定義を使用することが可能。
2. それぞれの後の要素、または階層化されたリストについてはインデントを取る。
3. 閉じた丸括弧、要素の括弧、または階層化されたリストについては、開かれた行として、同じレベルの字下げを行って配置する。
4. Fonts や Image といった情報を提供する要素は、どこでも定義が可能。しかし、情報を提供する要素は、maplet の最初に定義されているほうが、より読みやすい maplet コードとなる。
5. 要素の内容と属性は分離して保持する。
6. 未評価の引用符は、オプション名や参照として使用される、記号や変数名の周りに配置する。そうしないでいて、記号や変数名がどこかで割り当てられている場合には、maplet の定義が壊れる原因となる。
7. 手続きの中では、use 文を使用し、with 文を使用しないようにする。他のユーザがそのコードを実行する際に、with コマンドはそのユーザの環境設定に影響を及ぼすが、 use は影響を及ぼさない。
以下の例で、正しい maplet コードの構造を説明します。
use Maplets[Elements] in maplet := Maplet( 'onstartup' = RunWindow( 'W1' ), Font['F1']( 'family' = "helvetica",'size'=12 ), Window['W1']( "Vector Norm", [ BoxCell( 'left', TextBox( 'editable' = 'false', 'width' = 50, 'font' = 'F1', "A vector norm is a function ||V|| that satisifies the conditions of a norm." ) ), [ "Norm (Select from list or enter non-negative number): ", ComboBox['CoB1']( ["infinity", "1", "Euclidean (2)", "Frobenius"] ) ], [ "Vector has real entries: ", CheckBox['ChB1']( 'true' ) ], [ "Evaluate result: ", CheckBox['ChB2']( 'true' ) ], [ Button['B1']( "OK", Shutdown(['CoB1', 'ChB1', 'ChB2']) ), Button['B2']( "Cancel", Shutdown() ) ] ] ) ); end use: Maplets[Display](maplet);
参照
Maplets パッケージの概要, Maplets[Elements], Maplets のレイアウトに関する指針
Download Help Document