Custom Query (146 matches)

Filters
 
Columns

Show under each result:


Results (101 - 146 of 146)

1 2
Ticket Summary Owner Type Priority Milestone Component
#506 Get and put toups enhancement major toups/functional.plt

Reported by Sgeo, 13 years ago.

description

I think it would make sense to include get, put, and modify for the state monad, or perhaps call them state-get state-put state-modify. Could also make state-put and state-modify not return useful values, but not sure if there's a reason to do that.

(define state-get
  (lambda (state)
    (state-doublet state state)))

(define (state-put new-state)
  (lambda (old-state)
    (state-doublet new-state new-state)))

(define (state-modify modifier)
  (lambda (old-state)
    (define result (modifier old-state))
    (state-doublet result result)))
#507 Font lock doesn't work for subsubsubsection neil defect major neil/scribble-emacs.plt

Reported by highfly22@…, 12 years ago.

description

I have created a patch for this.

--- a/.emacs.d/emacs-lisp/scribble.el +++ b/.emacs.d/emacs-lisp/scribble.el @@ -283,11 +283,11 @@ For other licenses and consulting, please contact the author.")

...)

part-start? scribble-subsubsection-heading-face]

- [sub*section (,@scribble-heading-form-args - [p - pre-content? -] - ...) - part-start? - scribble-sub*section-heading-face] + [subsubsub+section (,@scribble-heading-form-args + [p - pre-content? -] + ...) + part-start? + scribble-sub*section-heading-face]

[author ([p - content? -])

block? nil]

@@ -711,9 +711,8 @@ For other licenses and consulting, please contact the author.")

(,(if face 6 5) 'scribble-curly-brace-face nil t))))

(let ((face-to-namerxs-alist '()))

(mapc (lambda (form)

- (let* ((namerx (regexp-quote - (symbol-name (scribble-get-form-name - form)))) + (let* ((namerx (symbol-name (scribble-get-form-name + form)))

(face (scribble-get-form-face form)) (pair (assq face face-to-namerxs-alist)))

(if pair

#518 Doesnt' run kazzmir defect major kazzmir/planet-manager.plt

Reported by kalimehtar@…, 12 years ago.

description

monk@veles:~/languages/racket$ racket Welcome to Racket v5.2.1.

(require (planet kazzmir/planet-manager:1:1/gui))

/home/monk/.racket/planet/300/5.2.1/cache/kazzmir/planet-manager.plt/1/1/planet-utils.ss:5:49: only-in: identifier `pkg-spec->full-pkg-spec' not included in nested require spec at: planet/resolver in: (only-in planet/resolver pkg-spec->full-pkg-spec get-package-from-server pkg-promise->pkg)

#534 Fixing the test files shawnpresser defect major shawnpresser/racket-unix-sockets.plt

Reported by orseau, 12 years ago.

description

Thanks a lot for this package, it will be very helpful.

The tests don't work properly as they are. In particular, when installing the package from PLaneT, names tend to be quite long, raising the 100 characters long error. Placing the socket in racket's pref-dir should be better.

Also, all racket files should begin with the "#lang" line. Usually "#lang racket" or "#lang racket/base" for non-GUI programs.

Last, it is usually advised that the test files should not reference the PLaneT package, but the updir main.rkt file instead.

Maybe there should also be a note in the readme telling to avoid testing the listener in DrRacket?, otherwise a crash may be expected ;)

Fixes for the test files:

-- test-connecting.rkt: #lang racket (require "../main.rkt")

(define-values (i o)

(unix-socket-connect

(build-path (find-system-path 'pref-dir)

"tmp-socket")))

(display "hello" o)

-- test-listenning.rkt: #lang racket (require "../main.rkt")

(define (serve path)

(define listener (unix-socket-listen path 5)) (printf "listening: ~a" listener) (newline) (define (loop)

(accept-and-handle listener) (loop))

(loop))

(define (accept-and-handle listener)

(define-values (i o) (unix-socket-accept listener)) (printf "accepted: ~a" listener) (newline) (display (read-line i)) (newline))

(serve (build-path (find-system-path 'pref-dir) "tmp-socket"))

#539 Problem installing Whalesong dyoo defect major dyoo/whalesong.plt

Reported by kruckman@…, 12 years ago.

description

I've just installed Whalesong for the first time. When I try to run it, I get the following error message:

Library/Racket/planet/300/5.3.4/cache/dyoo/whalesong.plt/1/21/parser/parse-bytecode-5.3.rkt:372:20: match: wrong number for fields for structure mod: expected 16 but got 15

at: (name srcname self-modidx prefix provides requires body syntax-body unexported max-let-depth dummy lang-info internal-context pre-submodules post-submodules) in: (struct mod (name srcname self-modidx prefix provides requires body syntax-body unexported max-let-depth dummy lang-info internal-context pre-submodules post-submodules))

The same happens when I run raco setup.

#1114 Bad typecheck in map, foldl, foldr krhari defect major krhari/pfds.plt

Reported by anonymous, 12 years ago.

description

(require (planet krhari/pfds:1:5/catenablelist))

(map (λ (+ x 0)) (list 1 3 4))

. Type Checker: The type of list-map cannot be converted to a contract in: (map (λ (+ x 0)) (list 1 3 4))

(foldl + (list 1 3 4))

. Type Checker: The type of list-foldl cannot be converted to a contract in: (foldl + (list 1 3 4))

(foldr + (list 1 3 4))

. Type Checker: The type of list-foldr cannot be converted to a contract in: (foldr + (list 1 3 4))

#1462 transform-painter fails on non-rectangle configuration soegaard defect major soegaard/sicp.plt

Reported by i@…, 12 years ago.

description

As mentioned in the bible:

(define squash-inwards

(transform-painter (make-vect 0 0)

(make-vect 0.65 0.35) (make-vect 0.35 0.65)))

(paint (squash-inwards einstein))

this tries to paint einstein in a parallelogram, but DrRacket? complains "vector-ref: expects a vector as 1st argument, given 0"

#1789 Adding support for a testing ticket status asumu enhancement major some asumu/taglib.plt

Reported by anonymous, 11 years ago.

description

Tracie J. Gilmore 1893 John Calvin Drive Buffalo Grove, IL 60089 Phone:708-909-0962 Email Address: TracieJGilmore@…

Free Gift W/ Pump Free Discreet Fast Shipping in USA.

 Penomet

#1790 charterm event not ready when bytes are available neil defect major neil/charterm.plt

Reported by b2coutts, 11 years ago.

description

I have constructed a small program which causes the (current-charterm) event not to be ready for synchronization, even while (charterm-byte-ready?) produces #t. The behaviour seems to somehow be linked to calling (charterm-screen-size). It can be induced by running my program and mashing keys as fast as possible (see also the comment block at the beginning of the program).

#1791 charterm event not ready when bytes are available neil defect major neil/charterm.plt

Reported by b2coutts, 11 years ago.

description

While attempting to sync on the charterm event with a timeout, by mashing keys very quickly, it is possible to put charterm in a state where the charterm event is not ready for synchronization, and yet (charterm-byte-ready?) produces #t. Strangely, this only occurs when (charterm-screen-size) is called after sync/timeout.

Attached is a small program that causes this behaviour; it can be induced by simply mashing keys as fast as possible. See the comment at the beginning of the program.

#1792 charterm event not ready when bytes are available neil defect major neil/charterm.plt

Reported by b2coutts, 11 years ago.

description

While attempting to sync on the charterm event with a timeout, by mashing keys very quickly, it is possible to put charterm in a state where the charterm event is not ready for synchronization, and yet (charterm-byte-ready?) produces #t. Strangely, this only occurs when (charterm-screen-size) is called after sync/timeout.

Attached is a small program that causes this behaviour; it can be induced by simply mashing keys as fast as possible. See the comment at the beginning of the program.

#1794 Channel mask should be 0xf instead of 0x7 clements defect major clements/midi.plt

Reported by kashyap, 11 years ago.

description

The bit mask used for extracting the channel number from the midi should be 0xf I believe.

#1802 Scribble Emacs Mode Installation Issue. neil defect major neil/scribble-emacs.plt

Reported by jhemann, 10 years ago.

description

The installation instructions in the Racket Scribble Emacs Mode documentation didn't work for me.

(require (planet neil/scribble-emacs:1:2/install-in-my-emacs))

crashed because the regexp on line 55 didn't match. I changed the regexp to the following:

(regexp-match #rx"([0-9]+-..-..T)(..:..:..)$"

and that worked.

#36 implement JavaScript library fully dherman task minor dherman/javascript.plt

Reported by dherman, 17 years ago.

description

The standard JavaScript? library is stubbed but not fully implemented.

#38 numbers are unfaithful to spec dherman defect minor dherman/javascript.plt

Reported by dherman, 17 years ago.

description

Numbers are represented as Scheme bignums; they should be inexact IEEE754 double-precision floating point. And then there are all the Ecma conversions to integer and string throughout the semantics.

#39 regular expressions aren't implemented dherman task minor dherman/javascript.plt

Reported by dherman, 17 years ago.

description

Regular expressions are stubbed but not implemented.

#40 over-parenthesization in while-conditions dherman defect minor dherman/javascript.plt

Reported by dherman, 17 years ago.

description
(pretty-print
 (format-term (parse-source-element "while (true) { }")))

displays:

while ((true)) {
}
#41 implement read-only __proto__ dherman enhancement minor dherman/javascript.plt

Reported by dherman, 17 years ago.

description

This could be implemented as a custom getter. I believe that's how Mozilla does it.

#95 make a csv-reader that takes in an input-port neil enhancement minor neil/csv.plt

Reported by yinso.chen@…, 17 years ago.

description

Based on the doc, the csv.ss currently exposes a csv-reader-maker functions that creates a closure over the input port for reading the csv data.

While this is convenient for just reading csv files, it doesn't work well for composing different readers as it doesn't follow the scheme pattern of

(read <input-port>)

.

It would be nice to have a csv-reader-maker that'll make a procedures that takes an input-port so the reader can be composed.

#124 rename require.ss to main.ss ryanc enhancement minor ryanc/require.plt

Reported by dougorleans@…, 17 years ago.

description

If you rename require.ss to main.ss, then one could require this package with (require (planet ryanc/require)), which would be cool.

#125 Docs link unavailable; .DS_Store file unnecessary zitterbewegung defect minor zitterbewegung/uuid-v4.plt

Reported by vegashacker, 17 years ago.

description

It'd be great if you could get the docs link working. Nothing elaborate for documentation needed, I think--just an example showing the main way to use the library. Also, the .DS_Store file in the source for the library I believe is unnecessary.

#176 same name as another planet package - confusing version numbering fjl task minor fjl/leftparen.plt

Reported by spdegabrielle@…, 16 years ago.

description

If this version is deprecated - please note it as such and remove the categories - that will remove it from the list of planet packages.

#181 example from docs declares IDistributeLists as a module cce defect minor cce/dracula.plt

Reported by pnkfelix, 16 years ago.

description

This is bogosity in the Dracula documentation

  (module IDistributeLists
    (include IAssociative)
    (include ICommutative)
    (include IDistributive)
    (sig addall (xs))
    (sig mulall (x ys))
    (con addall/mulall-distributive
      (implies (proper-consp bs)
               (equal (mulop a (addall bs))
                      (addall (mulall a bs))))))

If you are just cut-and-pasting from the ref manual, you get this error:

. include: not valid outside interface in: (include iassociative)
#185 Modular ACL2 reacts poorly to mixing of "code" and exports cce defect minor cce/dracula.plt

Reported by pnkfelix, 16 years ago.

description

Open up the following in Modular ACL2, select the module m, and click "Admit All" button

(interface Ig (sig g (y)))
(interface Ih (sig h (z)))

(module m 
  (defun g (y) (+ y y))
  (defun h (z) (g z))
  (export Ig)
  (in-theory (disable (:executable-counterpart h)))
  (export Ih))

I get the following internal error from the guts of Dracula/DrScheme:

highlight/save: start position 177 > end position 125

 === context ===
/Users/pnkfelix/Library/PLT Scheme/planet/300/4.1.5/cache/cce/dracula.plt/8/2/drscheme/dracula-drscheme-tab.ss:

The obvious workaround is to put the in-theory invocation above the export. Note however that I think some people might have reason to write down in-theory invocations that effect the proof attempts for some signatures but not all of them.

In any case the internal error is bad.

#194 problem including this file from planeT synx defect minor synx/xml-maker.plt

Reported by anonymous, 16 years ago.

description

This does not work (require (planet synx/xml-maker:1:0))I get the following error

require: not a valid planet path; should be: (require (planet STRING (STRING STRING NUMBER NUMBER)))

If I use the "old" way things are OK.

DrScheme? 4.2 under windows XP SP3.

#218 ^M end-of-lines orseau defect minor orseau/lazy-doc.plt

Reported by orseau, 16 years ago.

description

It adds M end-of-lines in generated docs on Unix.

#236 pict-* from scheme/slideshow should combine in the order of the clauses cce enhancement minor cce/scheme.plt

Reported by sstrickl@…, 16 years ago.

description

It would be nice if pict-* combined the subpicts in the order they were given, instead of the non-ghost pict always being combined first. That would be useful for #:combining via *-append instead of *-superimpose, and possibly other uses I haven't yet thought of. An small example program is below:

#lang slideshow

(require slideshow/code

(planet cce/scheme:6:0/slideshow))

(staged

[a b c] (slide

(pict-cond

#:combine vl-append [(= stage a)

(item (code a))]

[(= stage b)

(item (code b))]

[(= stage c)

(item (code c))])))

(For such uses, allowing a #:ghost keyword that allows overriding of the ghosting behavior may also be useful. That way non-active parts can be greyed or cellophaned out instead.)

#258 bogon in docs dherman defect minor dherman/javascript.plt

Reported by dherman, 15 years ago.

description

intro.html:

Examples:

> (eval-script "print(40 + 2)") link: module mismatch, probably from old bytecode whose dependencies have changed: variable not provided (directly or indirectly) from module: "C:\Documents and Settings\dherman\My Documents\Subversion\planet\javascript\lang\lang.ss" at source phase level: 0 in: script-begin > (require (planet dherman/pprint))

Reported by Eric Hanchrow.

#274 mzsocket fails to install cleanly on OS X (10.5 and 10.6) vyzo defect minor vyzo/socket.plt

Reported by endobson@…, 15 years ago.

description

I am trying to install mzsocket with the planet line: (require (planet vyzo/socket:3:2))

It downloads it correctly but upon installation I get the following error on (10.5.8): /Users/eric/Library/PLT Scheme/planet/300/4.2.4/cache/vyzo/socket.plt/3/2/compiled/native/i386-macosx/3m/_socket.c: In function 'inet_address_to_vec': /Users/eric/Library/PLT Scheme/planet/300/4.2.4/cache/vyzo/socket.plt/3/2/compiled/native/i386-macosx/3m/_socket.c:1596: warning: pointer targets in passing argument 1 of 'scheme_make_sized_byte_string' differ in signedness except-in: identifier `socket-accept' not included in nested require spec setup-plt: error: during making for <planet>/vyzo/socket.plt/3/2 (mzsocket) setup-plt: except-in: identifier `socket-accept' not included in nested require spec

in 10.6.2 I do not get the c errors but still the same three lines of scheme errors.

#275 please convert comments in xml file to *COMMENT* sxml nodes lizorkin enhancement minor lizorkin/ssax.plt

Reported by friedel@…, 15 years ago.

description

I've been trying to get an sxml view of an xml document including comments and tried with

(require (planet lizorkin/sxml:2:1/sxml)) (sxml:document "my_doc.xml")

(in mzscheme)

I noticed however that sxml drops the comments and also shifts the order of attributes around, if I do it this way.

I'd like to use sxml as a format for editing xml files, since it's a little less markup-heavy than xml, but I'd need to keep the comments and order of attributes (I put the most important attribute to the front, to make it stand out). The plain xml format needs to be the master format, since people who never heard of s-expressions are going to have to edit those files.

I started diving into the source, but failed to see an obvious way to change that behaviour yet. SSAX-code.ss is impossible to read, so I had to download SSAX.scm from sourceforge. It looks like comments could be handled by a function similar to ssax:read-cdata-body.

I appreciate if you could help me out with this, maybe add one or two optional parameters to sxml:document to convert comments into sxml comments and maintain the order of attributes.

#298 Better error messages for accessors krhari enhancement minor krhari/pfds.plt

Reported by dvanhorn, 15 years ago.

description

Compare the quality of the error messages below. The PFDS library could do better.

Welcome to DrRacket, version 5.0.1.3--2010-08-25(-/f) [3m].
Language: racket; memory limit: 512 MB.
> (require (prefix-in pf: (planet krhari/pfds:1:4/skewbinaryrandomaccesslist)))
> (require (prefix-in rk: racket))
> (pf:second (pf:list 1))
. . list-ref: given index out of bounds
> (rk:second (rk:list 1))
. . second: expected argument of type <list with 2 or more items>; given '(1)

#303 xpath-parser.ss problem w/ abbreviated xpath syntax lizorkin defect minor lizorkin/sxml.plt

Reported by dmarshall207@…, 15 years ago.

description

Hi, I'm somewhat new and did not notice the ticket feature so I sent this report in yesterday to email addresses listed in the source code.

I thought I'd resend it here again as it's probably better protocol:

subject : bug in xpath-parser.ss

First, thank you for all the OS PLT-Scheme -- errr I mean, Racket code. I love this stuff.

There seams to be a problem with some special cases for abbreviated xpath syntax -- looks like absolute paths have problems with xpaths that start with one of : "div", "mod", "and", "or". (could be that I just don't understand the specs)

examples to illustrate :

;;---------------------------------------------------- ;; Works : (let*([data '(*TOP*

(*PI* xml "version='1.0'") (one "111"

(two "222")))])

(list

(eval-xpath "/one" data) (eval-xpath "/one/two" data)))

;;---------------------------------------------------- ;; Fails : (let*([data '(*TOP*

(*PI* xml "version='1.0'") (div "111"

(two "222")))])

(eval-xpath "/div" data))

;; Error Message : ;; XPath/XPointer parser error: unexpected end of XPath ;; expression. Expected - NCName procedure application: expected ;; procedure, given: #f; arguments were: (*TOP* (*PI* ;; xml "version='1.0'") (div "111" (two "222")))

;;---------------------------------------------------- ;; Fails : (let*([data '(*TOP*

(*PI* xml "version='1.0'") (div "111"

(two "222")))])

(eval-xpath "/div/two" data))

;; Error Message : ;; /: division by zero

;;------------------------------------------------------------------ ;; Works : (let*([data '(*TOP*

(*PI* xml "version='1.0'") (div "111"

(two "222")))])

(list

(eval-xpath "div/two" data) (eval-xpath "/child::div" data) (eval-xpath "/child::div/two" data)))

Davis Marshall

#309 Parsing bug discovered neil defect minor neil/htmlprag.plt

Reported by anonymous, 15 years ago.

description

The double-quote turns into the string "&quot;" when you convert to HTML and back again in this example:

(html->shtml (shtml->html '(FooBar? (@ (quote "\"'")) "DSFSDF"))) ==> (*TOP* (foobar (@ '"&quot;'") "DSFSDF"))

#310 Cigar Site bzlib defect minor some bzlib/flexer.plt

Reported by anonymous, 15 years ago.

description

Trying to install on my site for Cigars, but I keep getting the same install error:

#327 require error on installing cce defect minor cce/fasttest.plt

Reported by jmj@…, 14 years ago.

description

The fasttest.plt module gives this error under Racket 5.1 when downloading and installing the module:


require: unknown module: 'program raco setup: error: during Building docs for C:\Users\jjohnson.INTERNAL\AppData?\Roaming\Racket\planet\300\5.1\cache\cce\scheme.plt\7\3\reference/manual.scrbl raco setup: require: unknown module: 'program


Aside from that, the build proceeds normally.

#329 Frequency counting benchmark hash-for-each bug dvanhorn defect minor dvanhorn/ralist.plt

Reported by anonymous, 14 years ago.

description

There is a bug in the hash table implementation of the frequency counting benchmark, which relies on hash-for-each to iterate through the result frequency count, but the problem specification is to print them in ascending order. But hash-for-each iterates in unspecified order.

There is a failing test case that catches this.

#366 Revision to previous ticket kazzmir defect minor kazzmir/vi.plt

Reported by anonymous, 14 years ago.

description

I posted the ticket about insert-line-previous not working, but I realized that it only doesn't work if you are trying to use it when your cursor is on the first line of the document. It works if you are anywhere else in the document, but not at the very top. Sorry for any confusion this may have caused. If I knew a way to edit an existing ticket, I would have done so.

#436 Reg Fixers bzlib enhancement minor bzlib/date-tz.plt

Reported by isabellarodway@…, 13 years ago.

description

Here are the three most reliable Reg Fixers that I feel lead in the market currently. a) Registry mechanic: The Registry mechanic is designed to scan your laptop or computer for problems in the reg that slow down your laptop or computer and even crash it then helps you repair these mistakes with the many tools that it comes with. This software program can fix quite a few issues in the laptop or computer including missing help files, removed fonts, broken shortcuts and references to uninstalled software programs. The Registry mechanic additionally easily creates backups of the reg and has a Tuneup service option and a reg defragger that can enhance operating system boot services. There are of course a lot of other tools and elements that make this software program one of the most preferred by computer users. b) CyberDefender?: If you want a Reg Fixer that doubles up as an antivirus software program and anti-malware, cyberdefender certainly is your kind of software program. I think that this software program deserves the top three position because it is stealthy and catches more malware and viruses than most other antivirus software programs. It uses Dual-core anti-malware technology to give sophisticated detection and prevention and has got the option of Link Patrol that will keep you safe from adware and spyware downloads along with phishing scams. CyberDefender? comes with tons of options to customize it to your preferences and other enhancements on version 3.0 that were recommended by reviewers and users from the earlier versions 1 and 2. Info  http://www.registrycleanerswatch.com/

#488 Empty file reports wrong error dherman defect minor dherman/json.plt

Reported by nculwell, 13 years ago.

description

When attempting to parse an empty JSON file, I found that instead of giving the correct error, which is "read: unexpected EOF", this module instead reports this error:

char-whitespace?: contract violation expected: char? given: #<eof>

This can fixed by changing the application of char-whitespace? in skip-whitespace to be "(and (char? ch) (char-whitespace? ch))".

#499 "not a procedure" problem on Windows clements defect minor clements/rsound.plt

Reported by khardy, 13 years ago.

description

Some of the example code from the docs produce a "not a procedure" problem on windows.

For example the code below produces (highlighting lpf/dynamic in DrRacket?):

application: not a procedure;

expected a procedure that can be applied to arguments

given: #<network/s> arguments...:

#<procedure:control> #<procedure:sawtooth>

Similar issue results on using sine-wave.

Example program from docs pro

#lang racket/base

(require (planet clements/rsound:4:4)) (require (planet clements/rsound:4:=4/filter))

(define (control f) (+ 0.5 (* 0.2 (sin (* f 7.123792865282977e-005))))) (define (sawtooth f) (/ (modulo f 220) 220)) (play (signal->rsound 88200 (lpf/dynamic control sawtooth)))

#1803 Have you thought about moving this to MELPA? (EOM) neil enhancement minor neil/scribble-emacs.plt
#195 prime? of neg. number doesn't end soegaard defect trivial soegaard/math.plt

Reported by carolynoates@…, 16 years ago.

description

for example: (prime? -99) Obviously only an abs is needed.

#313 Documentation bug: Incorrect SCRBL markup dutchyn defect trivial dutchyn/aspectscheme.plt

Reported by anonymous, 15 years ago.

description

@link{ http://blahblah/} was used instead of @url{ http://blahblah/}, resulting in blank links in the manual.

#322 Racket v5.1 for/vector wmfarr enhancement trivial wmfarr/simple-matrix.plt

Reported by Tim Coppieters, 14 years ago.

description

Since version 5.1 of DrRacket? the for/vector and for*/vector function is standard included in the #lang racket library. So when loading the simple-matrix module some errors are generated: "module: identifier already imported from a different source"

Maybe removing the for/vector, for*/vector from the module isn't that a bad idea then?

Furthermore the base one is a bit further extended: #lang racket: (for/vector (for-clause ...) body ...+) (for/vector #:length length-expr (for-clause ...) body ...+)

Simple-matrix: (for/vector length-expr (for-clause ...) body)

Offtopic: I would like to thank you for the module, saved me some time writing it myself, cheers!

Kind regards, Tim Coppieters. VUB

#414 Support vectors dherman enhancement trivial dherman/json.plt

Reported by simon.haines@…, 13 years ago.

description

I would love it if this module supported vectors as JSON arrays. Then it would nicely interoperate with Jay McCarthy's mongodb module, and decode the BSON it produces.

The workaround I use has this small change to lines 17-18:

  [(or (list? json)
       (vector? json))
#1535 `prime?' function does not check if x < 2. djhaskin987 enhancement trivial djhaskin987/miller-rabin.plt

Reported by anonymous, 12 years ago.

description

It seems that (prime? 1 2 random) will cause an infinite loop. See fixed version below (perhaps not the best solution). The only change is at the start of the function: (cond ((< x 2) #f) ((or (= x 2) (= x 3)) #t)

(define (prime? x k (rng random))

(cond ((< x 2)

#f)

((or (= x 2) (= x 3))

#t)

((let-values (((s d) (get-s-d (sub1 x))))

(let loop ((i 0))

(if (>= i k)

#t

(let ((test (mod-exp (add1 (rng (- x 3))) d x)))

(if (or (= test 1) (= test (sub1 x)))

(loop (add1 i)) (let carmichael-test ((r 1)

(ctest (modulo (* test test) x)))

(cond ((>= r s)

#f)

((= ctest 1)

#f)

((= ctest (sub1 x))

(loop (add1 i)))

(else

(carmichael-test (add1 r) (modulo (* ctest ctest) x)))))))))))))

1 2
Note: See TracQuery for help on using queries.