Re: [racket-users] Random values in Typed Racket?

2017-07-05 Thread Alasdair McAndrew
Well, after a bit of fiddling, I've discovered I can indeed do what I need to, with a judicious use of "let" for creating a swag of random values, and ensuring that their use is all within the scope of let. So far, all good! On Thursday, 6 July 2017 10:54:53 UTC+10, Royall Spence wrote: >

[racket-users] Drracket crashing on startup

2017-07-05 Thread Alasdair McAndrew
This morning, when I attempted to start Drracket from a terminal (I'm using Archlinux, 64 bit, with the most recently upgraded versions of Racket and Drracket), I obtained this error: SIGSEGV MAPERR si_code 1 fault on addr 0xe8042caa [2]26140 abort (core dumped) drracket A bit of

Re: [racket-users] Random values in Typed Racket?

2017-07-05 Thread 'Royall Spence' via Racket Users
Sounds like two questions wrapped into one. When it comes to setting names to values, Scheme programming encourages the use of a "let" expression to bind values to names inside of a (usually narrow) scope rather than assigning a value to a variable. See more here:

[racket-users] Random values in Typed Racket?

2017-07-05 Thread Alasdair McAndrew
I'm doing a little programming which requires the use of some random numbers. Basically I add a random value at one stage, and subtract it a bit later. Something like this pseudo-code (where "x" is an existing variable): set rand_value <- (random) set new_value <- x + rand_value ...

Re: [racket-users] Forwarding syntax or srcloc

2017-07-05 Thread William G Hatch
The reason why you are getting the source location from b.rkt is that in `mk-data` you are getting the info from `stx`. In this case, `stx` is the filled-in template you get from `simple-data` in b.rkt. The pattern variables `name` and `x` are filled in with `unlucky` and `262`, which do have

Re: [racket-users] Forwarding syntax or srcloc

2017-07-05 Thread Alex Knauth
> On Jul 4, 2017, at 4:39 PM, reilithion wrote: > > I need to somehow forward the srcloc of its use-location. Look up syntax/loc. You should use it in simple-data to forward the source location to mk-data. > There are going to be a lot of macros like simple-data, and

Re: [racket-users] Forwarding syntax or srcloc

2017-07-05 Thread Matthew Butterick
> On Jul 4, 2017, at 1:39 PM, reilithion wrote: > > I'd like to be able to get source location information from behind two or > more layers of macros. > > Unfortunately, the srcloc that gets stored ends up being the location of the > simplifying macro. Not what I want.

Re: [racket-users] Racket (or Scheme) macros for C

2017-07-05 Thread Jens Axel Søgaard
Have you looked at SuperC for inspiration? An example: https://github.com/jeapostrophe/superc/blob/master/tests/superc/math.rkt /Jens Axel 2017-07-04 22:52 GMT+02:00 spearman : > I have built up a good toolchain for C programming including static > analysis and runtime