~radgerayden

~radgerayden/patchtesting

Last active 4 years ago
View more

Recent activity

[PATCH] Fixed emplace-append-many for String and Array, used to overwrite initial elements. 3 years ago

From Westerbly Snaydley to ~duangle/scopes-patch

# HG changeset patch
# User Westerbly Snaydley <westerbly@gmail.com>
# Date 1611216958 18000
#      Thu Jan 21 03:15:58 2021 -0500
# Node ID b29318f530d6a5a5f7aa9e3315e50373eaac4e62
# Parent  dd7c4222a645e58addcd21aa1048a54e3a79c336
Fixed emplace-append-many for String and Array, used to overwrite
initial elements.

diff -r dd7c4222a645 -r b29318f530d6 lib/scopes/Array.sc
--- a/lib/scopes/Array.sc    Sat Jan 16 23:31:36 2021 +0100
+++ b/lib/scopes/Array.sc    Thu Jan 21 03:15:58 2021 -0500
@@ -186,7 +186,8 @@
         let dest = (append-slots self size)

[PATCH] core: add safety check for b < a in va-range 3 years ago

From Westerbly Snaydley to ~duangle/scopes-patch

# HG changeset patch
# User Westerbly Snaydley <westerbly@gmail.com>
# Date 1610940228 18000
#      Sun Jan 17 22:23:48 2021 -0500
# Node ID 555e3aa819277c97aaba8cc595bff3991455b61b
# Parent  dd7c4222a645e58addcd21aa1048a54e3a79c336
core: add safety check for b < a in va-range

diff -r dd7c4222a645 -r 555e3aa81927 lib/scopes/core.sc
--- a/lib/scopes/core.sc    Sat Jan 16 23:31:36 2021 +0100
+++ b/lib/scopes/core.sc    Sun Jan 17 22:23:48 2021 -0500
@@ -5911,6 +5911,9 @@
                 hide-traceback;
                 error "too many elements specified for range"

[PATCH] enum: fix `copy` failing on unit tags 3 years ago

From Westerbly Snaydley to ~duangle/scopes-patch

# HG changeset patch
# User Westerbly Snaydley <westerbly@gmail.com>
# Date 1610725698 18000
#      Fri Jan 15 10:48:18 2021 -0500
# Node ID f11c24d3f63ac1568eed22e89277a5ff3f0cab42
# Parent  75f9938f120a1f63d18859d34093a14bc8497f31
enum: fix `copy` failing on unit tags

diff -r 75f9938f120a -r f11c24d3f63a lib/scopes/enum.sc
--- a/lib/scopes/enum.sc    Thu Jan 14 21:29:59 2021 +0100
+++ b/lib/scopes/enum.sc    Fri Jan 15 10:48:18 2021 -0500
@@ -410,7 +410,13 @@
                                         spice-quote
                                             inline (args...)

Re: unexpected behavior with arrays? 4 years ago

From Westerbly Snaydley to ~duangle/scopes


On Sat, Jul 4, 2020 at 14:28, Shawn Walker <binarycrusader@gmail.com> 
wrote:

> So if I'm guessing correctly, the borrow checker you're referring to
> is the "view propagation" mechanism?  However, that can't be used with
> the lower-level constructs and some of the APIs?

Correct. Non-unique ("plain") types - the case for most (all?) of the 
low level parts - aren't checked and constructs like `drop` or `view` 
are ignored when used on them.

> I was trying to puzzle out the subtleties between let, local, etc.

Re: unexpected behavior with arrays? 4 years ago

From Westerbly Snaydley to ~duangle/scopes


On Sat, Jul 4, 2020 at 14:48, Westerbly Snaydley <westerbly@gmail.com> 
wrote:
> 
> 
> On Sat, Jul 4, 2020 at 12:34, Shawn Walker <binarycrusader@gmail.com> 
> wrote:
>> I guess I’m spoiled by the rust compiler’s reasoning about 
>> lifetimes.  If I try to use ‘x’ once the binding has expired it 
>> won’t let me and tells me why.  Here it seems like Scopes should 
>> know the lifetime of the storage and then could prevent or warn 
>> about further use.
> 

Re: unexpected behavior with arrays? 4 years ago

From Westerbly Snaydley to ~duangle/scopes


On Sat, Jul 4, 2020 at 12:34, Shawn Walker <binarycrusader@gmail.com> 
wrote:
> I guess I’m spoiled by the rust compiler’s reasoning about 
> lifetimes.  If I try to use ‘x’ once the binding has expired it 
> won’t let me and tells me why.  Here it seems like Scopes should 
> know the lifetime of the storage and then could prevent or warn about 
> further use.

Scopes' borrow checker is opt-in, and the core is designed such that 
lower level constructs / APIs are not checked. The higher level APIs on 
the other hand are built on top of those but with security added in. In 
this particular example, it's usually recommended to use the Array

Re: unexpected behavior with arrays? 4 years ago

From Westerbly Snaydley to ~duangle/scopes


On Fri, Jul 3, 2020 at 22:45, Shawn Walker <binarycrusader@gmail.com> 
wrote:
> $0 ► x @ 0
> $0 = 0

TL;DR: you have a stale stack pointer.

As you probably know, `alloca`'d pointers are not meant to survive 
beyond the function frame, and the way the REPL works is that it wraps 
every evaluated expression in a function; the result of this is that 
it's impossible to keep function-local pointers valid between 
evaluations. What you may do is use a global array instead, or even one

Re: test 4 years ago

From Westerbly Snaydley to ~radgerayden/patchtesting

On Sat, Jul 4, 2020 at 12:14, Westerbly Snaydley <westerbly@gmail.com> 
wrote:
> test2

test3

Re: test 4 years ago

From Westerbly Snaydley to ~radgerayden/patchtesting

test2

test 4 years ago

From Westerbly Snaydley to ~radgerayden/patchtesting

test