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:
>
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
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:
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
...
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
> 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
> 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.
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
8 matches
Mail list logo