문제

나는 Ableson/Sussman 강의와 Berkeley 61A 강의를 모두 사용하여 SICP를 통해 내 길을 따라 노력하고 있습니다. 버클리 숙제 중 일부를하고 싶지만 문장에 대한 정의가 필요합니다. 한 번에 Dr. Scheme에 내장 된 간단한 체계 언어가 있었지만 가장 최근의 버전 4.1.5는 가지고 있지 않습니다. 에서 행성 plt내 정의 창에 간단히 추가 할 수 있다고 생각했습니다 (요구 사항 ( "Dyoo" "Simply-Scheme"1 0))). 나는 얻다

require: PLaneT
could not find the requested package: Server had no matching package:
No package matched the specified criteria

Simply.scm 파일을 잡으려고 시도했습니다 여기DR Scheme 정의 창에 붙여 넣었지만 작동하지 않습니다.

고급 학생 모드에서는 "불법적 인 사용"을 읽습니다.

다음 코드의 라인 (Lambda (String. Args)의 경우.

(define whoops
  (let ((string? string?)
    (string-append string-append)
    (error error)
    (cons cons)
    (map map)
    (apply apply))
    (define (error-printform x)
      (if (string? x)
      (string-append "\"" x "\"")
      x))
    (lambda (string . args)
      (apply error (cons string (map error-printform args))))))

r5rs에서 나는 set! : module required identifier에서 mact를 돌연변이 할 수 없다 : number-> string (다음 코드의 7 행)

(if (char=? #\+ (string-ref (number->string 1.0) 0))
    (let ((old-ns number->string)
      (char=? char=?)
      (string-ref string-ref)
      (substring substring)
      (string-length string-length))
      (set! number->string
        (lambda args
          (let ((result (apply old-ns args)))
        (if (char=? #\+ (string-ref result 0))
            (substring result 1 (string-length result))
            result)))))
    'no-problem)
도움이 되었습니까?

해결책

고급 학생은 당신이 그것을 위해 설계된 예제를 따르지 않는 한 실제로 당신을 위해 일하지 않을 것입니다. 대부분의 책과 예는 가정합니다 아르 자형5Rs 또는 그와 비슷한 것. 나는 꽤 큰 언어를 사용하는 것이 좋습니다.5Rs 및 PLT require 구문 및 몇 가지 다른 것들.

행성의 간단한 체계 패키지를 사용하려면 새로운 요구 구문을 사용해야합니다 (이를 통해 찾을 수 있습니다. 패키지 목록 페이지; 그것은처럼 보인다 패키지의 문서 업데이트되지 않았습니다) :

(require (planet dyoo/simply-scheme:1:2/simply-scheme))

다른 팁

후속; 라켓에 대한 간단한 체계 지원 라이브러리는 다음에서 찾을 수 있습니다.http://planet.plt-scheme.org/display.ss?package=simply-scheme.plt&owner=dyoo가벼운 문서 업데이트를했습니다 http://planet.plt-scheme.org/package-source/dyoo/simply-scheme.plt/2/1/planet-docs/manual/index.html.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top