Re: A value for "nothing"

2018-08-27 Thread Matt Wette
Is it reasonable to expect that if a value can be assigned to a variable then a predicate exists to test for that value type? So, if (define a (if #f #f)) does not signal an error then there should be a predicate to indicate the value associated with a is unspecified? If the define allowed i

Re: Comparing two hash tables for equality?

2018-08-27 Thread Aleksandar Sandic
I did not know about HAMTs, looks interesting. It's not relevant to my use- case, but it's an interesting topic to look into. Thanks. On Monday, 27th August 2018 01:37:54 CEST you wrote: > ...

Re: Comparing two hash tables for equality?

2018-08-27 Thread Aleksandar Sandic
> An equality test on hash tables needs to know how to compare the keys > and how to compare the values. There's no way to pass those additional > arguments to 'equal?', so it can't do that job. It has to compare the values, but not the keys. If you take a look at my code, what it does is first c

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
John Cowan writes: > However, in formats like JSON where map keys are always strings, > it can save a lot of space to represent them as symbols, since > they are often repeated from one object to the next. There is no such > limitation in MessagePack, although I bet strings are the most common >

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
John Cowan writes: > On Mon, Aug 27, 2018 at 12:54 AM Mark H Weaver wrote: > > However, in most cases, symbols are precisely what's needed to represent > distinguished atomic objects such as this. > > The problem with symbols in Scheme is that they are not namespaced, so > two different modu

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
I wrote: > If he would like people to be able to write code that uses his library > and works on multiple Scheme implementations, then it will certainly be > an impediment to use a Racket-specific value for Nil on Racket, and a > Guile-specific value for Nil on Guile. It would be much better to us

Re: A value for "nothing"

2018-08-27 Thread Hans Åberg
> On 27 Aug 2018, at 22:12, Mark H Weaver wrote: > > More generally, even for people only interested in supporting Guile, if > they would like their libraries to be usable from Elisp code on Guile, > which may become important some day if Guile-Emacs matures, then it's > problematic to use #nil

Re: How to get started in guile & programming generally

2018-08-27 Thread Arne Babenhauserheide
Joshua Branson writes: > Amirouche Boubekki writes: >>> Is there a programming resource for >>> userspace/kernel software >> >> what do you mean by kernel software? > > My short term goal right now is to be able to write GNU/Hurd translators > in guile. My long term goal is to be a GNU/Hurd de

Re: How to get started in guile & programming generally

2018-08-27 Thread Arne Babenhauserheide
Thompson, David writes: > without strapping them to an opinionated engine. So, Starling is going > to be one of those opinionated engines! The core abstractions are > inspired by Godot and Python's Cocos2D which I used many years ago; > it's 2D only for the time being; it uses GOOPS heavily (this

Re: Comparing two hash tables for equality?

2018-08-27 Thread Arne Babenhauserheide
Mark H Weaver writes: > Hi Aleksandar, > Hash table implementations typically don't offer an equality test on the > hash tables themselves, and I don't recall anyone ever asking for such > an operation before now. I already wrote diff-algorithms for Python dictionaries, which is close to implem

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
writes: > On Sun, Aug 26, 2018 at 04:07:13PM -0400, Mark H Weaver wrote: > >> I would also avoid Guile's #nil. That is a very special value, for one >> purpose relating to Elisp compatibility, and ideally it should not be >> used for anything else. > > I must admit that I'm... pretty confused ab

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
l...@gnu.org (Ludovic Courtès) writes: > I would suggesting returning zero values, using: > > (values) > > That way, if a caller wrongfully attempts to get at the return value of > that procedure, it’ll get an error. > > Fibers does that in several places, and I think it’s a good convention > as

Re: How to get started in guile & programming generally

2018-08-27 Thread John Cowan
On Mon, Aug 27, 2018 at 2:51 PM Amirouche Boubekki wrote: > Sorry, I don't know what is a GNU/Hurd translators. > It's the Hurd equivalent of a FUSE file system < https://en.wikipedia.org/wiki/Filesystem_in_Userspace>, except that you can mount a filesystem on any directory that you own, withou

Re: How to get started in guile & programming generally

2018-08-27 Thread Amirouche Boubekki
On 2018-08-26 20:16, Joshua Branson wrote: Amirouche Boubekki writes: On 2018-08-25 19:16, Joshua Branson wrote: You can play with Guile without much C knowledge and I dare to say that you need little of C with things like guile-bytestructures or nyacc's ffi-helper to use the full power

Re: How to get started in guile & programming generally

2018-08-27 Thread Thompson, David
On Sun, Aug 26, 2018 at 3:12 PM, Pierre Neidhardt wrote: > >> I've heard about chickadee! I've tried to install it before, but I >> haven't been successful yet. Perhaps I'll have to try again. > > What's the issue? Please post a backtrace. > I can chickadee flawlessly here, maybe I can help. I

Re: How to get started in guile & programming generally

2018-08-27 Thread Thompson, David
On Mon, Aug 27, 2018 at 8:39 AM, Ludovic Courtès wrote: > Pierre Neidhardt skribis: > >>> [0] https://libfive.com/studio/ >> >> Wow, this looks awesome! >> Is there a Guix package for the studio? :) > > To get started: > > guix environment --ad-hoc libfive -- Studio > > :-) > > Really great pac

Re: A value for "nothing"

2018-08-27 Thread Ludovic Courtès
Hi, I would suggesting returning zero values, using: (values) That way, if a caller wrongfully attempts to get at the return value of that procedure, it’ll get an error. Fibers does that in several places, and I think it’s a good convention as it conveys exactly what you want. Ludo’.

Re: How to get started in guile & programming generally

2018-08-27 Thread Ludovic Courtès
Pierre Neidhardt skribis: >> [0] https://libfive.com/studio/ > > Wow, this looks awesome! > Is there a Guix package for the studio? :) To get started: guix environment --ad-hoc libfive -- Studio :-) Really great package, indeed! Ludo’.

Re: A value for "nothing"

2018-08-27 Thread John Cowan
On Mon, Aug 27, 2018 at 12:54 AM Mark H Weaver wrote: > However, in most cases, symbols are precisely what's needed to represent > distinguished atomic objects such as this. > The problem with symbols in Scheme is that they are not namespaced, so two different modules can use the same symbols i

Re: What should the constructor for a record look like?

2018-08-27 Thread Ludovic Courtès
Hi, HiPhish skribis: > Hello, it's me again, the guy who wants to implement MessagePack [1] in > Guile. > The specification defines a type of "extension" [2], a pair of an 8-bit > integer and a byte array for data. Implementing this type as a record is > obvious, but what should be the name

Re: A value for "nothing"

2018-08-27 Thread HiPhish
I think I understand: it just so happens that `(if #f #f)` evaluates to `#`, but it would still be valid if it evaluated to 5 or "roflcopter". > "The return value of a function that returns nothing" is a > self-contradictory notion, if you think about it :) I was under the impression that in Lis

Re: A value for "nothing"

2018-08-27 Thread Panicz Maciej Godek
pon., 27 sie 2018 o 10:17 napisał(a): > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Mon, Aug 27, 2018 at 02:17:06AM +0200, Panicz Maciej Godek wrote: > > niedz., 26 sie 2018 o 16:09 HiPhish napisał(a): > > > > > Hello Schemers, > > > > > > I am writing an implementation of MessagePack

Re: A value for "nothing"

2018-08-27 Thread HiPhish
On Montag, 27. August 2018 02:17:06 CEST you wrote: > In my experience, if #f doesn't make sense as a legal value, then using #f > is probably the idiomatic Scheme way to go. > It composes with SRFI-2's and-let* in a way similar to Haskell's Nothing > within the "do" notation. > I did find it usefu

Re: A value for "nothing"

2018-08-27 Thread HiPhish
Yes, this sounds like the best solution so far. On Sonntag, 26. August 2018 23:07:26 CEST you wrote: > The eq? predicate is able to distinguish the three. But I think using a > singleton record is best: > > (define-record-type ( nil? make-nil)) > (define nil (make-nil)) > > and thene export nji

Re: A value for "nothing"

2018-08-27 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Aug 26, 2018 at 04:07:13PM -0400, Mark H Weaver wrote: [...] > It's true that Guile historically has a special object distinct from all > other objects, which (if #f #f) and various other expressions return, > and which prints as "#". > > Ho

Re: A value for "nothing"

2018-08-27 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Aug 27, 2018 at 02:17:06AM +0200, Panicz Maciej Godek wrote: > niedz., 26 sie 2018 o 16:09 HiPhish napisał(a): > > > Hello Schemers, > > > > I am writing an implementation of MessagePack [1] for Guile and a part of > > the > > spec is the pre