0

チキンスキーム 4.8.0.5

皆さん、こんにちは。

リストのリストの不正な定義の断片を次に示します。変数名が左端の括弧の外側にあり、明示的な定義ステートメントがないため、形式が正しくないと言います。(define techDisplays ((AG1 fillIgnore....nil nil))

snippet.il

techDisplays(
;( LayerName            Purpose                  Packet                         Vis Sel C2C Drg Val )
;( ---------            -------                  ------                         --- --- --- --- --- )
( AG1                  fillerIgnore             AG1_fillerIgnore                t   t  nil  t  nil )
( AG2                  drawing                  AG2_drawing                     t   t  nil  t   t  )
( AG2                  fillerIgnore             AG2_fillerIgnore                t   t  nil  t  nil )
( AG2                  frame                    AG2_frame                       t   t  nil  t   t  )
( AG2                  frameOnly                AG2_frameOnly                   t   t  nil  t   t  )
( AG2                  frameOnlyHole            AG2_frameOnlyHole               t   t  nil  t   t  )
( y0               flight     y0_flight                 t   t   t   t   nil )
( y1               flight     y1_flight                 t   t   t   t   nil )
( y2               flight     y2_flight                 t   t   t   t   nil )
( y3               flight     y3_flight                 t   t   t   t   nil )
( y4               flight     y4_flight                 t   t   t   t   nil )
( y5               flight     y5_flight                 t   t   t   t   nil )
( y6               flight     y6_flight                 t   t   t   t   nil )
( y7               flight     y7_flight                 t   t   t   t   nil )
( y8               flight     y8_flight                 t   t   t   t   nil )
( y9               flight     y9_flight                 t   t   t   t   nil )
( border           boundary   border_boundary           t   nil t   t   nil )
( snap             grid       snap_grid                 t   nil t   nil nil )
) ;techDisplays

問題: これを有効なトップレベルの定義としてSchemeに認識させる必要があります さらなる問題: これが由来する場所にはさらに100以上あるため、ソリューションはスケーラブルでなければなりません.括弧のカウント、マッチング、およびレイヤー化のすべてで間違っていることが判明する可能性が非常に高いため、いくつかの解析ルーチンを作成する必要があります。

アイデア、ヒント、建設的な批判はすべて大歓迎です。

ティア、

まだまだ勉強中のスティーブ

4

1 に答える 1

0

このことを考慮、

; this is structured as your input with just a space after the first name
#;1> (define inp 
             '(techdisps (foo bar baz) 
                         (foo1 bar1 baz1) 
                         (foo2 bar2 baz2))) 
#;2> inp
(techdisps (foo bar baz) (foo1 bar1 baz1) (foo2 bar2 baz2))
#;3> (define techdisps cdr)
;get all the displays from you input
#;4> (techdisps inp)
((foo bar baz) (foo1 bar1 baz1) (foo2 bar2 baz2))
;this should be just a tech display, let's see how it parses.
#;5> (car (techdisps inp))
(foo bar baz)
#;6> (define foo car)
#;7> (define bar cadr)
#;8> (define baz caddr)
;this will give us all the bazes
#;9> (map baz (techdisps inp))
(baz baz1 baz2)

これがスケールしないと思われる場合 (ただし、100 秒を超えると、適切なボックス内の最新のスキーム インタープリターが問題を解決するのに苦労することはありません)、代替案を提案できます。お役に立てれば。

乾杯。

于 2014-12-16T18:56:08.537 に答える