~torresjrjr

Europe/London

https://torresjrjr.com/

~torresjrjr/public-inbox

Last active 1 year, 3 months ago

~torresjrjr/nest-devel

Last active 1 year, 9 months ago

~torresjrjr/nest-announce

Last active 1 year, 9 months ago

~torresjrjr/lateximgbot-devel

Last active 2 years ago

~torresjrjr/lateximgbot-announce

Last active 2 years ago

~torresjrjr/bezier.py-devel

Last active 2 years ago

~torresjrjr/bezier.py-announce

Last active 2 years ago

~torresjrjr/go-nestedtext-discuss

Last active 2 years ago

~torresjrjr/go-nestedtext-devel

Last active 2 years ago

~torresjrjr/go-nestedtext-announce

Last active 2 years ago
View more

Recent activity

Re: Type assertion failure in time::date::new a day ago

From Byron Torres to ~sircmpwn/hare-users

On Thu Sep 21, 2023 at 11:46 AM BST, Drew DeVault wrote:
> use time::chrono;
> use time::date;
>
> export fn main() void = {
> 	date::new(chrono::UTC, void, 2023, 9, 7)!;
> };
>
> // Abort: time/date/date.ha:156:36: type assertion failed
> // Aborted
>
> Not reproducible if 0 is used instead of void.

The functionality for deducing omitted zone offsets was never properly

[PATCH hautils] Update for stdlib changes a month ago

From Byron Torres to ~sircmpwn/hare-dev

---
 head.ha |  2 +-
 nl.ha   |  2 +-
 tee.ha  |  4 ++--
 uniq.ha |  6 +++---
 wc.ha   | 16 ++++++++--------
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/head.ha b/head.ha
index c06b7ea..4b3394e 100644
--- a/head.ha
+++ b/head.ha
@@ -41,7 +41,7 @@ export fn utilmain() (void | main::error) = {
			yield file;
[message trimmed]

Re: [PATCH hare] time::date: add static sample timezone for tests 3 months ago

From Byron Torres to ~sircmpwn/hare-dev

Thanks for your patience.

After some thought, I think it's best we leave non-UTC timezones out of
tests for now. The usage of tz() in `@test from_str` and `@test reckon`
are pretty much useless. Reckon isn't non-UTC-proof yet anyway.

We will need to write a comprehensive test suite which covers timezones
properly, amongst other things like a greater range of dates, etc.

I'm gonna forego this patch, and remove tz() from the tests.

---

Review nonetheless.

Re: [PATCH hare v7] strio,bufio: merge memstream implementation into memio 3 months ago

From Byron Torres to ~sircmpwn/hare-dev

On Thu Jun 15, 2023 at 11:58 PM BST, Ember Sawady wrote:
> On Thu Jun 15, 2023 at 10:36 PM UTC, Autumn! wrote:
> > i think new() for alloc'ing functions and init() for non-alloc'ing 
> > functions makes sense. i'm gona send a v8 with s/new/init/g
>
> to clarify: new() for things that need to be paired with a destructor,
> init() otherwise

IMO:

* mk(), mkobject():    for (allocated) things needing a destructor.
* new(), newobject():  for things NOT needing a destructor.
* init(*obj), init_object(*obj):  takes pointer, initializes state.

Re: [PATCH hare v7] strio,bufio: merge memstream implementation into memio 3 months ago

From Byron Torres to ~sircmpwn/hare-dev

On Wed Jun 14, 2023 at 10:11 PM BST, Ember Sawady wrote:
> On Fri Jun 9, 2023 at 9:31 PM UTC, Byron Torres wrote:
> > > <https://harelang.org/style/#verbs-for-allocation-strategies>
> > >
> > > For functions which initialize a value and return it, either via
> > > allocation or via the stack, name these functions after the object
> > > being initialized. For example, to initialize a SHA-256 hash, you use
> > > crypto::sha256::sha256().
> >
> > This part is bad. Like the theoretical "stream()" example, name clashes
> > are inevitable. This should be changed to:
> >
> > > For functions which initialize a value and return it, either via
> > > allocation or via the stack, name these functions "newobject" after

Re: Can't get example from docs works 3 months ago

From Byron Torres to ~sircmpwn/hare-users

On Mon Jun 12, 2023 at 3:30 PM BST, Dmitry B wrote:
-%<-
> // Asks the user to provide their name.
> fn askname() str = {
> fmt::println("Hello! Please enter your name:")!;
> const name = bufio::scanline(os::stdin)! as []u8;
> return strings::fromutf8(name)!;
-%<-
> [dima@DESKTOP-19AN2NV hare]$ hare run app.ha
> Error /mnt/d/code/hare/app.ha:15:40: Cannot use error propagation on
> non-tagged type str

You are likely using an old version of Hare, whose strings::fromutf8()
function has a different return type.

[PATCH hautils 1/2] uniq: fix config initialization 3 months ago

From Byron Torres to ~sircmpwn/hare-dev

Signed-off-by: Byron Torres <b@torresjrjr.com>
---
 uniq.ha | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/uniq.ha b/uniq.ha
index 77b4e1b..3209184 100644
--- a/uniq.ha
+++ b/uniq.ha
@@ -106,7 +106,11 @@ export fn utilmain() (main::error | void) = {
	const cmd = getopt::parse(os::args, help...);
	defer getopt::finish(&cmd);

	let cfg = config{...};
[message trimmed]

[PATCH hautils 2/2] main: add usage() 3 months ago

From Byron Torres to ~sircmpwn/hare-dev

Signed-off-by: Byron Torres <b@torresjrjr.com>
---
 basename.ha  |  3 +--
 dirname.ha   |  3 +--
 head.ha      |  9 ++++++---
 main/main.ha | 23 +++++++++++++++++++++++
 nl.ha        | 39 +++++++++++++++------------------------
 sleep.ha     |  9 ++-------
 uname.ha     |  3 +--
 uniq.ha      |  5 +----
 wc.ha        |  4 ++--
 9 files changed, 52 insertions(+), 46 deletions(-)

diff --git a/basename.ha b/basename.ha
[message trimmed]

Re: [PATCH hare v7] strio,bufio: merge memstream implementation into memio 3 months ago

From Byron Torres to ~sircmpwn/hare-dev

On Fri Jun 9, 2023 at 9:02 PM BST, Ember Sawady wrote:
> On Fri Jun 9, 2023 at 4:09 AM UTC, Autumn! wrote:
> > diff --git a/bufio/buffered.ha b/bufio/stream.ha
> > similarity index 50%
> > rename from bufio/buffered.ha
> > rename to bufio/stream.ha
> > index a08a12b6..e16b37e5 100644
> > --- a/bufio/buffered.ha
> > +++ b/bufio/stream.ha
> > @@ -53,29 +53,29 @@ export type bufstream = struct {
> >  //
> >  // 	let rbuf: [os::BUFSIZ]u8 = [0...];
> >  // 	let wbuf: [os::BUFSIZ]u8 = [0...];
> > -// 	let buffered = bufio::buffered(source, rbuf, wbuf);

Re: [PATCH hare 2/2] time::date: remove pad param from scan_int 3 months ago

From Byron Torres to ~sircmpwn/hare-dev

On Wed Jun 7, 2023 at 8:35 AM UTC, Sebastian wrote:
> On Tue Jun 6, 2023 at 6:21 PM EDT, Byron Torres wrote:
> > On Sun Jun 4, 2023 at 1:44 AM UTC, Sebastian wrote:
> > > This didn't have any effect.
> > -%<-
> > >  	case 'N' => v.nanosecond =
> > > -		scan_int(iter, 9, true)?;
> > > +		scan_int(iter, 9)?;
> >
> > It does have an effect here. `true` is given here, because nanoseconds
> > are always right-padded with at least 9 (sometimes imaginary) zeros.
> > Otherwise, the ".123" would set .nsec to 000000123, not 123000000.
>
> Currently the scan_int function currently doesn't do anything with the