On Wed, Jan 16, 2019 at 12:04 AM infodeveloperdon
wrote:
>
> Hi,
> It has been awhile since I've been posting questions to [Racket Users].
> Previously, my gmail account would receive both my query entry and every
> reply entry. (Of course, it actually received all entries and replies entered
>
On Sun, Apr 22, 2018 at 10:40 PM, Zelphir Kaltstahl
wrote:
> Ah OK, I understand that additional newline. Since the code matching the
> regex is run before that newline gets in, the newline will be on the
> input port.
>
> In DrRacket I observe the following:
>
> (I remembered that there are negat
Il giorno 29 luglio 2017, alle ore 20:48, rom cgb ha
scritto:
>Hi,
>Probably due to all operations not being in-place, chaining operations on
>bignums is very costful.
>for example, using bitwise-bit-field[1] on bignums is atrocious.
>I also tried
> (define (reverse-bits n)
> (for/fold ([
On Sat, Nov 26, 2016 at 11:37 AM, luis.osa.gdc wrote:
> Hi, everyone!
> ```
> (check-= (t-test bacteria-a bacteria-b) 13.0 0.1)
> ```
>
> In short: is there a way to specify tolerance in `eval:check`?
Perhaps, instead of checking directly the result of t-test you can
check (good-enough (t-test .
On Sat, Oct 29, 2016 at 5:31 PM, wrote:
> At the certain point of the program I get
> a list as parameter 'lst', which contains
> the sublists of strings. I wrote this
> function:
>
>
> (define (to-txt lst)
> (if (empty? lst)
> lst
> (let ((line (car lst)))
> (begin
> (di
On Tue, Sep 27, 2016 at 3:23 PM, Tim Brown wrote:
> I believe (because I can’t think of a counterexample) that
> (expt Real Real) is never Complex; and therefore expt can be of type
> (Real Real -> Real).
What about (expt -1 1/2) ?
--
You received this message because you are subscribed to the
Hello,
> I'm new to Racket and would like to know what is the trick to make accented
> characters display correctly at the Windows command prompt. For example,
> when I write at the Racket prompt:
>> "número"
> then it returns:
> "n´┐¢mero"
Here you can read an old discussion about this topic:
h
On Sat, Jun 4, 2016 at 1:23 AM, Gustavo Massaccesi wrote:
> > [...] I saw in the docs that case specifically mentions it can
> distribute in log(n) time [...]
> but both expand to a bunch of nested if, nothing fancy that may run in
> O(log(N)).
> (I don't expect that it has a smarter implementat
On Sun, Apr 10, 2016 at 1:29 PM, Joan Martin wrote:
> Hello,
> I try to write a programme (a game), where I use lots of mutable lists (named
> environment).Something like this:
> (define environment
> (mcons (mcons (mcons 1 (mcons (mcons 2(mcons 5(mcons 8 '('() ))
> (mcons
On my system it behaves almost exactly as described by Jon (6.3, windows).
The one difference is that DrRacket hasn't crashed yet, but the Task
manager reports one processor at 100% and memory use slowly growing.
Currently is at 7.5 GB.
On Fri, Feb 5, 2016 at 2:29 PM, Anthony Carrico wrote:
On Wed, Jan 27, 2016 at 12:46 AM, Brian Adkins wrote:
> Ok, this is odd, it works with both Chrome and Safari *if* they're not
> already open when (help filter) is evaluated. If they are already open, the
> URL is missing the anchor.
In my case, the default browser is Chrome, and it was alread
On Wed, Jan 27, 2016 at 12:35 AM, Brian Adkins wrote:
> Just out of curiosity, does this work for anyone else? In other words, in the
> Dr. Racket repl:
>
> (require racket/help)
> (help filter)
>
> does that scroll down to the filter description in section 4.9, or is your
> URL missing the anc
I tried swapping the two expressions. The result is that the one
executing first is always slower than the one executing second.
So, probably the timing is dominated by some memory/GC/locality effect
rather than the difference between set-member? and set-members?
On Fri, Jan 8, 2016 at 10:29 PM,
On Fri, Nov 13, 2015 at 9:45 AM, Tim Hanson wrote:
> hi,
>
> I was hoping yesterday to read UTF-16 characters from a file
I think you need reencode-input-port.
> p.s. maybe there's an easier way to get an arbitrary counter than what i did
> here?
>
> (define (integers-starting-from n)
> (stre
On Thu, Oct 22, 2015 at 8:09 PM, Andrew Gwozdziewycz wrote:
> Surely there are books about this subject. Does anyone have any
> recommendations for future self?
This course has a module on voting theory:
https://www.coursera.org/course/mathphil
The course is not heavy-handed and can be taken ev
On Wed, Oct 14, 2015 at 11:34 PM, Neil Van Dyke wrote:
> Alex Knauth wrote on 10/14/2015 04:37 PM:
>>
>> You can use
>> #lang colon-kw racket
>> for :kw syntax, and
>> #lang kw-colon racket
>> for kw: syntax.
>
>
> If the standard `#lang racket` and `#lang racket/base` don't support
> `:keyword` o
On Wed, Sep 23, 2015 at 6:18 PM, Kaushik Ghose wrote:
> Can I have any statements in this block that I could have in a (define ...)
> block? Can I have (defines ) for example?
Yes, and yes :)
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
T
On Wed, Sep 23, 2015 at 3:20 PM, Kaushik Ghose wrote:
> e.g.
>
> (define (f-recur x y)
> (if (< x 1)
> 10
> (f-recur-2 x y)))
>
> (define (f-recur-2 x y)
> ... something complex here
> (f-recur x' y')
(define (f-recur x y)
(cond ((< x 1)
10)
(else
On Mon, Aug 24, 2015 at 1:25 PM, Jens Axel Søgaard
wrote:
> It looks very odd to me.
Maybe this is due to calling TR functions from plain Racket?
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receivin
On Fri, Jul 24, 2015 at 4:31 PM, Hendrik Boom wrote:
> You might be interested in the language Styx, the language that goes with
> the Inferno operating system. I believe it uses reference counting up
> front, with full garbage collection as a backstop.
The language is called Limbo. Styx is In
On Fri, Jul 10, 2015 at 11:40 PM, Pekka Niiranen
wrote:
> Thanks Sir,
>
> This was exactly what I tried to reason.
> It never occured to me that parameter "failure" can be used
> in both for/fold -constructs.
I must fix once again my code. Sigh. I fixed a mistake, and renamed
one of the two failu
On Fri, Jul 10, 2015 at 11:11 PM, Stephen Chang wrote:
> Perhaps I don't understand the problem, but why is the inner loop necessary?
He asked how to test each value against each of the limit pairs. I
assume this is a simplified/demo problem and in the problem he really
cares about there's a rea
On Fri, Jul 10, 2015 at 10:45 PM, Pierpaolo Bernardi
wrote:
> If I understand correctly the spec, this should do what you ask?
which, fixing the typo, becomes:
(define (validate-ranges value-list low-list high-list)
(for/fold ((failures 0))
((low (in-list low-l
If I understand correctly the spec, this should do what you ask?
(define (validate-ranges value-list low-list high-list)
(for/fold ((failures 0))
((low (in-list value-list))
(high (in-list high-list)))
(for/fold ((failures 0))
((value (in-list value-lis
On Fri, Jul 3, 2015 at 8:36 PM, Neil Van Dyke wrote:
> BTW, Emacs users can get this feature through Quack.
> The feature turns causes a typed "[" to insert "(".
>
> Separately, typed "]" always inserts the character to agree with the
> matching open paren/bracket.
>
> To really insert "[", do th
BTW, since you are looking at the preferences, I wish there was a way
to have automatic conversion of square brackets to parentheses
*always*. That is, I don't want square brackets in my racket code,
but I like the convenience of typing them over typing parentheses.
Looks like a combination of pre
On Sat, Jan 24, 2015 at 7:43 AM, Matthew Butterick wrote:
> PS. I remain curious what one can do with an immutable `hash` function that
> takes no arguments, but perhaps it is meant to be a TR koan.
It has about the same uses as an immutable empty list. You start with
an empty table then add thi
Here's a straightforward way:
(define (cumulative-sum list)
(let loop ([list list] [acc 0])
(if (null? list)
list
(let ([s (+ (first list) acc)])
(cons s (loop (rest list) s))
On Thu, Jan 22, 2015 at 2:53 PM, Alexandr M wrote:
> Hello,
>
> I am trying to replicate
On Thu, Jan 8, 2015 at 10:49 PM, Neil Van Dyke wrote:
> I generally recommend against using non-ASCII characters in Racket source
> code.
>
> Besides the human readability question (and the searchability question),
> non-ASCII still presents a significant risk of your characters getting
> corrupte
Just for excluding any possibility of user error: do you use any
unsafe features?
On Tue, Dec 30, 2014 at 8:43 PM, Matthew Butterick wrote:
> No, it's all Racket libraries.
>
> OTOH I may be the one causing the memory-management problems. The issues are
> arising in my typesetting program, which
I think you need define-runtime-path instead.
Here's an example of its use:
;; Access a file "data.txt" at run-time that is originally
;; located in the same directory as the module source file:
(define-runtime-path sofa.dll
(format "sofa-~a-~a~a" sofa-version arch ""))
P.
===
sing the code for (still lot of
work to do):
https://farm6.staticflickr.com/5599/15337830979_c4bccae56a_o.png
https://farm4.staticflickr.com/3940/15337812549_5ec924e207_o.png
P.
> At Sat, 11 Oct 2014 20:59:09 +0200,
> Pierpaolo Bernardi wrote:
>>
>> For the record, in case some
ps://github.com/acmeism/RosettaCodeData/blob/master/Task/Bitmap-Flood-fill/Racket/bitmap-flood-fill.rkt
>
> /Jens Axel
>
>
> 2014-10-05 22:14 GMT+02:00 Pierpaolo Bernardi :
>> Hello,
>>
>> here's a couple of dumb questions: I did not find a flood-fill method
>
On Sun, Oct 5, 2014 at 10:30 PM, Jens Axel Søgaard
wrote:
> Maybe this can be used?
>
> https://github.com/acmeism/RosettaCodeData/blob/master/Task/Bitmap-Flood-fill/Racket/bitmap-flood-fill.rkt
Yes! Much better than mine. Thank you.
However, it uses a straight deep-first recursion with no auxi
Hello,
here's a couple of dumb questions: I did not find a flood-fill method
for bitmaps. Am I right it's not there, or I missed it?
I tried implementing one myself, but the result is way too slow to be
useful. Any recommendation?
Cheers
P.
Racket Users list:
http://lis
On Mon, Aug 11, 2014 at 8:07 AM, Matthew Flatt wrote:
> +1
>
> In the grand scheme of things, using `eval` to solve a problem (because
> you want to get something done now) is nowhere near as bad as, say,
but, to come back to the original question, in order to not confuse
further the OP: in this
On Sun, Jul 27, 2014 at 5:10 AM, Henry Lenzi wrote:
> #lang racket
>
> #|
>
> Dear Racketeers -
>
> I would like to create a little function
> that would write a line of a medical recipe.
>
> I would pass to "read" a shorthand form,
> and the program would expand the text. Like so:
>
> When I answ
On Wed, Feb 5, 2014 at 12:38 AM, Gustavo Massaccesi wrote:
> Why are you using Racket, and why it's "better" than C?
Can you make an example of something that's worse than C?
Racket Users list:
http://lists.racket-lang.org/users
On Wed, Jan 15, 2014 at 8:43 AM, Eric Dobson wrote:
> I'm not sure what you mean by random, but does gensym do what you want?
I think Marco means interned. Gensym produces uninterned symbols.
AFAIK, and checking briefly the manual, there doesn't seem to exists a
single function to do this.
But i
On Thu, Jan 2, 2014 at 4:09 PM, 亀田馬志 wrote:
> Is this O.K? or do I have to put (flush-output) every time after (display)?
without flush-output what you write in the stream remains in a buffer
and is actually written out only when the buffer is full. You must use
flush-output when you want to be
On Thu, Jan 2, 2014 at 1:05 AM, 亀田馬志 wrote:
> Does anybody know how to tell Racket's compiler "I wanna see this in UTF-8"?
Are you sure that your DOS windows is using UTF-8?
AFAIK if you do nothing racket sends UTF-8 to the console.
Maybe your console is not using UTF-8. If this is the case yo
On Tue, Dec 24, 2013 at 4:30 PM, Dmitry Pavlov wrote:
> Hello,
>
> It seems that ~r formatting function, when given a negative
> number and a #:min-width argument, does not treat the "-"
> character as part of the number bound by #:min-width,
> and moreover, it detaches the "-" from the number:
U
On Fri, Nov 29, 2013 at 9:25 PM, Robby Findler
wrote:
> To find other keys that do the same thing (there aren't any others, I don't
> believe, that work in on all platforms with the default settings), you can
> use the menu item "Show Active Keybindings" in the "Edit" menu. Search for
> "put-prev
ESC-x and ALT-x usually are synonims.
With ALT-x you can keep ALT pressed and repeat only the x.
The ESC variant is useful on classical keyboards which do not have an
ALT key or equivalent.
On Fri, Nov 29, 2013 at 7:30 PM, Michael Jensen
wrote:
> I have a question/suggestion. if this is goi
On Wed, Nov 20, 2013 at 12:09 PM, Bo Gus wrote:
> My tail recursive implementation of length is like this:
>
> (define (length2 l)
> (define (l-iter l count)
> (if (null? 1) count
> (l-iter (cdr l) (+ count 1
> (l-iter l 0))
> I am fairly new to scheme. What am I doing wrong?
On Tue, Oct 29, 2013 at 11:19 PM, Andrews, Kyle (KC) wrote:
> I just tried running your code 3 times on `(main 7)' and twice on `(main 6)'
> and it has crashed each time. But I was worried that somehow I was running
> out of memory (even though I have 16 Gb available),
I confirm the crashes (tr
Why don't you simply use a hash-table? (mutable or immutable
according to your need).
On Fri, Aug 23, 2013 at 9:49 PM, Rian Shams wrote:
> Hello All,
>
> My name is Rian and I am a new Racket user and a novice programmer (Racket
> is my first language). First let me say that I am very grateful
(Neil, sorry for the duplicate.)
Maybe abc notation is adeguate for such simple requirements, and it
should be easy to implement.
http://abcnotation.com/
On Sat, Aug 10, 2013 at 1:25 AM, Neil Van Dyke wrote:
> Anyone currently working with music mini-languages in Racket?
>
> Reason I ask... In
On Wed, Jul 24, 2013 at 5:28 PM, Ben Duan wrote:
> I have a question here. `esc' is used as the Meta key for key bindings in
> Windows, for example key `esc;c:k' for `M-C-k'. Why not use `Alt' key
> instead? Is it because Windows captured these keys?
In the default configuration, the Alt key is
Looks like Sean wishes, like I do, that DrRacket would warn about
buffers and files not being in sync.
I submitted a PR about this:
http://bugs.racket-lang.org/query/?cmd=view&pr=12810
Now we are two, that's a start! ;^)
On Sat, Jun 22, 2013 at 9:40 PM, Robby Findler
wrote:
> The requires d
I don't see how your function count-times implements the required algorithm.
Please explain.
On Mon, May 27, 2013 at 12:01 AM, Tomás Coiro wrote:
> I'm trying to do this Rosetta Code problem:
> http://rosettacode.org/wiki/Average_loop_length
>
> Now, this is my code
> #lang racket
> (require (o
On Fri, May 10, 2013 at 7:25 PM, Kejia柯嘉 wrote:
> hi,
>
> i build my racket program to win7 execution file, but it needs some
> dll on another win7 machine: cannot load dll libracket3m_8bh3lk.dll.
> how can i build a standalone distribution program include all
> dependencies for my case?
You must
On Fri, Apr 26, 2013 at 4:19 AM, Robby Findler
wrote:
> You wouldn't happen to have a citation for this traditional way, would you?
>
No. But I'll take note if I happen to remember some place where it is
explained in this way.
Racket Users list:
http://lists.racket-lang.
Ah, yes, right.
On Fri, Apr 26, 2013 at 4:09 AM, Robby Findler
wrote:
> Yes, except that we do know something about what happens when it returns
> #t in the "in all other cases" case.
>
> Robby
>
>
> On Thu, Apr 25, 2013 at 9:03 PM, Pierpaolo Bernardi
>
The traditional way of explaining eq? is that it works when one of the
arguments is a symbol or a mutable data structure. In all other cases the
result is implementation dependent. Is this explanation still valid for
racket?
On Fri, Apr 26, 2013 at 1:37 AM, Robby Findler
wrote:
> I don't thin
Or, maybe, what he's after is
(for-each display '("" "0" "" "0")) ?
(just guessing)
Cheers
P.
On Sat, Apr 20, 2013 at 2:56 AM, Danny Yoo wrote:
> On Fri, Apr 19, 2013 at 6:47 PM, Kejia柯嘉 wrote:
> > Hi Yoo,
> >
> > You may try (display '("" "0" "" "0")), and you will find two whitepaces
> >
Cool!
On Fri, Apr 12, 2013 at 6:00 AM, Asumu Takikawa wrote:
> Hi all,
>
> I just found out about this neat version control visualization tool
> called "gource"[1] that creates animations of your git repo. I tried
> using it on the Racket repo from the last few weeks. Here is the result:
>
>
On Tue, Apr 9, 2013 at 3:30 PM, Pierpaolo Bernardi wrote:
while the for version should be almost all big x big.
>
oops, no. The for version should be almost all fix x big.
Here's a count considering also the type of the result of the
multiplication:
> (fact 100)
#hash(((fix
On Tue, Apr 9, 2013 at 2:51 PM, Laurent wrote:
> On Tue, Apr 9, 2013 at 2:42 PM, Matthew Flatt wrote:
>
>> (for/product ([p (in-range (+ m 1) (+ n 1))]) p)
>
>
>
> But I don't fully understand why a simple (for/product ([p (in-range 1
> (add1 n))]) p) is as fast as the iota variants.
>
I don't
On Tue, Apr 9, 2013 at 2:02 PM, Laurent wrote:
> But if you write all 10 cases, aren't the lists constructed anyway before
> calling `*'?
>
I'll leave the answer to someone who knows exactly how the compiler works.
Intuitively, I thought my case should be better, but measuring them gives
no app
to))
(define (fact n)
(if (zero? n)
1
(mult 2 (add1 n
On Tue, Apr 9, 2013 at 1:43 PM, Pierpaolo Bernardi wrote:
> But why generate lists which are immediately discarded?
>
> ;; from excluded; to included
> (define (mult from to)
> (case (- to from)
>
But why generate lists which are immediately discarded?
;; from excluded; to included
(define (mult from to)
(case (- to from)
((0) 1)
((1) to)
((2) (* (- to 1) to))
((3) (* (- to 2) (- to 1) to))
;; ...
(else
(let ((middle (quotient (+ from to) 2)))
(* (mult
On Mon, Apr 1, 2013 at 12:31 AM, Matthew Flatt wrote:
> At Tue, 26 Mar 2013 18:29:00 +0100, Pierpaolo Bernardi wrote:
> > On Tue, Mar 26, 2013 at 5:25 PM, Pierpaolo Bernardi
> wrote:
> > > On Tue, Mar 26, 2013 at 5:00 PM, Matthew Flatt
> wrote:
> > >
> &g
On Wed, Mar 27, 2013 at 4:46 AM, J. Ian Johnson wrote:
> I can't really test what you've posted (no stress-testing code), and you also
> compare safe versus unsafe accessors, which skews things.
It was not meant to be testable code, just an example to frame the
specific case I was talking about.
On Tue, Mar 26, 2013 at 5:25 PM, Pierpaolo Bernardi wrote:
> On Tue, Mar 26, 2013 at 5:00 PM, Matthew Flatt wrote:
>
>> I think you want `reencode-output-port', probably using "" (which
>> represents the user's default encoding) as the target encoding.
>
On Tue, Mar 26, 2013 at 5:00 PM, Matthew Flatt wrote:
> I think you want `reencode-output-port', probably using "" (which
> represents the user's default encoding) as the target encoding.
I tried the following:
#lang racket
(current-output-port (reencode-output-port (current-output-port)
On Tue, Mar 26, 2013 at 4:42 PM, Michael Wilber wrote:
> Does this do what you want?
>
>> (display (string->bytes/latin-1 "à"))
> à
This does not work when run from inside DrRacket.
> See also: http://docs.racket-lang.org/reference/encodings.html?q=locale
Ooops. I had looked only at the Guide,
Hello,
suppose I have this program:
#lang racket
(display "à")
This works as intended when run from DrRacket, but it displays
mojibake if I generate an executable and run it from a console (on
windows).
How do I tell Racket what encoding to use for current-output?
Cheers
P.
___
On Mon, Mar 25, 2013 at 2:41 PM, J. Ian Johnson wrote:
> Let me know how you like my library. I'm thinking of adding some more
> ergonomics to it:
> 1) support right folds so a for/list-like comprehension has better allocation
> behavior.
> 2) add a keyword for-clause for starting an inner itera
On Thu, Mar 21, 2013 at 11:55 PM, Tim Nelson wrote:
> Dear All,
>
> I've recently started hacking Racket again, and am loving the for/*
> constructs.
> Awesome stuff. However, I have two questions about for/hash.
>
> (1) How can I *not* add a hash entry for a given iteration?
>
> When I use for/li
On Wed, Mar 13, 2013 at 4:29 AM, Stephen Chang wrote:
> Does real->decimal-string do what you want?
yes, except for the width. It can substitute the ~r in
(~a (~r (- pi) #:precision 6) #:width 12 #:align 'right)
but not the ~a.
Srfi/48 still wins in convenience and readability. 8^)
Cheers
Hello,
suppose I want to format a real number, with a fixed number of digits
after the comma, rigth-padded in a given width, and I want the sign to
be attached to the digits (i.e. not what ~r does).
This is the usual way of printing reals in a table, and can be done
trivially using standard funct
On Sat, Mar 9, 2013 at 6:22 PM, Neil Toronto wrote:
> I think you could also define the cstruct in a submodule, provide it using
> `all-defined-out', and re-provide it from the enclosing module using
> `all-from-out'.
Ah, yes, that would have been another possibility.
Thanks.
__
On Sat, Mar 9, 2013 at 9:32 AM, Tobias Hammer wrote:
> (struct-out id), not _id still works. Only the 'special' names like _id,
> _id-pointer etc. are not included.
Exactly what I needed, thanks!
You have spared me a weekend of typing. 8^)
Racket Users list:
http://list
Hello,
I understand that there isn't an abbreviation equivalent to (provide
(struct-out ...)), but for cstructs?
Is this correct?
(I have a cstrut with 62 fields to provide. Both readers and setters... 8^)
P.
Racket Users list:
http://lists.racket-lang.org/users
On Wed, Feb 13, 2013 at 7:05 PM, Robby Findler
wrote:
> It wasn't a specific plan: DrRacket just tries to make creating an
> executable behave like Run.
>
> But Pierpaolo: if you're regularly creating executables using this method,
> maybe you'd rather script this process (and then, in the script,
On Wed, Feb 13, 2013 at 6:23 PM, Michael Wilber wrote:
> Why not have a `run.rkt` that does something like
>
> #lang racket
> (require "main.rkt")
> (main)
>
> than you tell your users to run, and then just develop main.rkt inside
> DrRacket?
That's one possibility. However, having a separate f
On Wed, Feb 13, 2013 at 6:51 PM, Danny Yoo wrote:
> On Wed, Feb 13, 2013 at 10:49 AM, Pierpaolo Bernardi
> wrote:
>> On Wed, Feb 13, 2013 at 6:14 PM, Danny Yoo wrote:
>>
>>> Other than that, this should work ok. Can you confirm?
>>
>> Yes, it works. Than
On Wed, Feb 13, 2013 at 6:14 PM, Danny Yoo wrote:
> Other than that, this should work ok. Can you confirm?
Yes, it works. Thanks!
What's the difference between _byte and _int8 ?
Racket Users list:
http://lists.racket-lang.org/users
On Wed, Feb 13, 2013 at 6:29 PM, Sam Tobin-Hochstadt wrote:
> You can change what submodules DrRacket executes when you press the
> Run button. The setting for this is in the "Language" dialog.
Sam, Danny,
I can do this. And this solves half the problem: the main is not run
from DrRacket. That'
On Wed, Feb 13, 2013 at 5:59 PM, Danny Yoo wrote:
>> Is there a way for a program to know if it's running from inside DrRacket or
>> from the command line?
>>
>> I would like to run a main function when from command line, and don't run it
>> when in DrRacket.
>
> Yes; you can look at Test and Main
On Wed, Feb 13, 2013 at 5:53 PM, Robby Findler
wrote:
> You can use submodules to do that. Tell the racket command-line to run the
> submodule and drracket won't run it (drracket does run the 'main' submodule
> by default, tho, so either use a different name or tell it not to do that).
hmmm... so
Hello,
Is there a way for a program to know if it's running from inside DrRacket
or from the command line?
I would like to run a main function when from command line, and don't run
it when in DrRacket.
Thanks!
P.
Racket Users list:
http://lists.racket-lang.org/users
Another FFI question:
I want to interface a C function which has the following signature:
void iauA2tf(int ndp, double angle, char *sign, int ihmsf[4])
The "char *sign" parameter is a single char, not a string, output only, and
is giving me problems.
The C code uses this parameter simply:
*
On Tue, Feb 5, 2013 at 5:57 PM, Dmitry Pavlov wrote:
> Any hints will be much appreciated.
Does the following help?
(define (function-which-returns-an-unknown-number-of-values)
(apply values (make-list (random 10) 'foo)))
> (call-with-values function-which-returns-an-unknown-number-of-values
On Tuesday, January 29, 2013, Danny Yoo wrote:
By the way, you can probably use (system-type 'so-suffix))
>
> you'll probably want to use a define-runtime-path
Thanks! I'll certainly put this to use.
Cheers
P.
Racket Users list:
http://lists.racket-lang.org/users
On Tuesday, January 29, 2013, Matthew Flatt wrote:
> At Tue, 29 Jan 2013 19:18:13 +0100, Pierpaolo Bernardi wrote:
>
> Here's one way to do that:
>
> (module sofa-params racket/base
This worked.
Thanks!
P.
Racket Users list:
http://lists.racket-lang.org/users
Hello,
what's the incantation needed to make the following work:
#lang racket
(provide sofa-version)
(require ffi/unsafe)
(require ffi/unsafe/define)
(require racket/runtime-path)
(define sofa-version "20120301_a")
(define arch
(if (fixnum? #e10e15) 'x64 'x86))
;; Access a file "d
Hello,
what's the most convenient way to convert between math/matrices and
FFI/arrays?
To reduce the scope of the question, at the moment I'm only interested in
conversions from and to the following FFI types:
(_array _double 3 3)
(_array _double 3)
(_array _double 2 3)
Thanks!
P.
__
It works. Thanks!
2013/1/9, Ryan Culpepper :
> On 01/09/2013 05:16 PM, Pierpaolo Bernardi wrote:
>> Hello all,
>>
>> Can someone show me what's the correct FFI type for this C function:
>>
>> int foo(double a, double b, double *c, double *d)
>>
>&g
Hello all,
Can someone show me what's the correct FFI type for this C function:
int foo(double a, double b, double *c, double *d)
where c and d are output only parameters, and I want back *c, *d, and
the int return value.
Thanks!
Racket Users list:
http://lists.racket-l
On Mon, Dec 17, 2012 at 1:55 PM, Jens Axel Søgaard
wrote:
>>
>> moebius-mu
> Would it be enough to add "distinct" ?
IMO, yes.
>>
>> multinomial
>>
>> "(multinomial n ks) → Natural
>>n : Integer
>> ks : (Listof Integer)
>> ...
>>> (multinomial 5 3 2)
>> 10"
>>
>> The example doe
Some comments after scanning the manual.
flulp-error
"For non-rational arguments such as +nan.0, flulp-error returns 0.0 if
(eqv? x r); otherwise it returns +inf.0."
However one example is:
> (flulp-error +inf.0 +nan.0)
+nan.0
Which does not agree with the doc.
"2.3.2 Flonum Constan
ocs.
>
> Neil ⊥
>
>
> On 12/12/2012 08:16 AM, Robby Findler wrote:
>>
>> But it could be elided for the docs.
>>
>> Robby
>>
>> On Wed, Dec 12, 2012 at 8:33 AM, J. Ian Johnson wrote:
>>>
>>> I imagine that's there more for Typed
On Fri, Dec 7, 2012 at 9:33 PM, Neil Toronto wrote:
> I've just pushed the last commits that make the new math library ready for
> wider testing. Almost everything ready for use is documented, the tests keep
> passing, and everything *seems* to work.
(max-math-threads) → Positive-Integer
On Tue, Dec 11, 2012 at 7:09 PM, Neil Toronto wrote:
> I've had good success running DrRacket and selecting "No debugging or
> profiling" and deselecting "Preserve stacktrace" in the Language dialog.
> Most of the time, I get performance similar to command-line Racket. I think
> the only signific
BTW, I seem to remember that GMP stores the table of small primes as a
vector of the differences between consecutive primes. Storing a byte
per prime goes a long way.
Let's see... there are 50847534 primes under 10^9, the max difference
between a consecutive pair of them is 282. We can store that
On Tue, Dec 11, 2012 at 5:11 PM, Stephen Bloch wrote:
> How many primes are below ten million? A hundred million? At some point
> storing the primes will take less memory than storing primality flags, but
> that point may be above the size of tables we can realistically store today.
> (for
On Tue, Dec 11, 2012 at 5:28 PM, Sam Tobin-Hochstadt wrote:
>> This looks like you are testing from inside DrRacket. As I already
>> wrote you should generate an executable and measure that.
>>
>> If you run the test from inside DrRacket, you are measuring DrRacket
>> overhead, which is far from
On Tue, Dec 11, 2012 at 5:23 PM, Pierpaolo Bernardi wrote:
> If you run the test from inside DrRacket, you are measuring DrRacket
> overhead, which is far from negligible.
As an example, the test I just sent, with the limit changed to 60999,
on my machine runs in 20083 ms from inside Dr
1 - 100 of 177 matches
Mail list logo