all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 'package-name-version' and 'strip-store-file-name' does the same thing with different ways
@ 2018-10-15 19:26 Alex Vong
  2018-10-16 11:54 ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Vong @ 2018-10-15 19:26 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 622 bytes --]

Hi guix,

Currently, I am attempting to create clojure-build-system.

In the process of doing so, I discover 2 procedures with different names
actually does the same thing with different ways. The 2 procedures
are 'package-name-version' and 'strip-store-file-name'.

'strip-store-file-name' is defined in (guix build utils), while
'package-name-version' is defined in (guix build haskell-build-system)
and (guix java-utils).

I think we should remove the ones not defined in (guix build utils) and
provide 'package-name-version' as alias for 'strip-store-file-name' in
(guix build utils). What do you think?

Cheers,
Alex

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 'package-name-version' and 'strip-store-file-name' does the same thing with different ways
  2018-10-15 19:26 'package-name-version' and 'strip-store-file-name' does the same thing with different ways Alex Vong
@ 2018-10-16 11:54 ` Ludovic Courtès
  2018-10-16 22:04   ` Alex Vong
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2018-10-16 11:54 UTC (permalink / raw)
  To: Alex Vong; +Cc: guix-devel

Hello Alex,

Alex Vong <alexvong1995@gmail.com> skribis:

> I think we should remove the ones not defined in (guix build utils) and
> provide 'package-name-version' as alias for 'strip-store-file-name' in
> (guix build utils). What do you think?

I think we can simply keep ‘strip-store-file-name’, without the alias,
and modify existing code to use it.

(That may trigger a lot of rebuilds though, so we’ll have to see which
branch to apply it to.)

Thanks for noticing!

Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 'package-name-version' and 'strip-store-file-name' does the same thing with different ways
  2018-10-16 11:54 ` Ludovic Courtès
@ 2018-10-16 22:04   ` Alex Vong
  2018-10-19 13:52     ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Vong @ 2018-10-16 22:04 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

Hi Ludo,

ludo@gnu.org (Ludovic Courtès) writes:

> Hello Alex,
>
> Alex Vong <alexvong1995@gmail.com> skribis:
>
>> I think we should remove the ones not defined in (guix build utils) and
>> provide 'package-name-version' as alias for 'strip-store-file-name' in
>> (guix build utils). What do you think?
>
> I think we can simply keep ‘strip-store-file-name’, without the alias,
> and modify existing code to use it.
>
OK.

> (That may trigger a lot of rebuilds though, so we’ll have to see which
> branch to apply it to.)
>
> Thanks for noticing!
>
You're welcomed!

> Ludo’.

Btw, I also noticed that the procedure 'flatten' are defined in
(gnu services telephony), (gnu services web) and (guix import utils).
[I was about to define my own version of it...]
I like the version using 'fold-right' together with 'match-lambda*' the
most. Should we move it (guix build utils) and remove the rest?

Similarly, 'file-sans-extension' are defined in both (guix utils) and
(guix build guile-build-system). They are both the same. Should we move
them to (guix build utils) as well?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 'package-name-version' and 'strip-store-file-name' does the same thing with different ways
  2018-10-16 22:04   ` Alex Vong
@ 2018-10-19 13:52     ` Ludovic Courtès
  2018-10-19 18:28       ` Alex Vong
  2018-10-20  8:37       ` Ricardo Wurmus
  0 siblings, 2 replies; 8+ messages in thread
From: Ludovic Courtès @ 2018-10-19 13:52 UTC (permalink / raw)
  To: Alex Vong; +Cc: guix-devel

Hello Alex,

Alex Vong <alexvong1995@gmail.com> skribis:

> Btw, I also noticed that the procedure 'flatten' are defined in
> (gnu services telephony), (gnu services web) and (guix import utils).
> [I was about to define my own version of it...]
> I like the version using 'fold-right' together with 'match-lambda*' the
> most. Should we move it (guix build utils) and remove the rest?

About ‘flatten’ specifically, I feel like it’s not a good sign in terms
of programming style when we end up using it (though we’d need to study
these specific use cases), so I’m reluctant to “standardizing” it.  :-)

> Similarly, 'file-sans-extension' are defined in both (guix utils) and
> (guix build guile-build-system). They are both the same. Should we move
> them to (guix build utils) as well?

Yes, sounds like a good idea!

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 'package-name-version' and 'strip-store-file-name' does the same thing with different ways
  2018-10-19 13:52     ` Ludovic Courtès
@ 2018-10-19 18:28       ` Alex Vong
  2018-10-20 13:24         ` Ludovic Courtès
  2018-10-20  8:37       ` Ricardo Wurmus
  1 sibling, 1 reply; 8+ messages in thread
From: Alex Vong @ 2018-10-19 18:28 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]

ludo@gnu.org (Ludovic Courtès) writes:

> Hello Alex,
>
> Alex Vong <alexvong1995@gmail.com> skribis:
>
>> Btw, I also noticed that the procedure 'flatten' are defined in
>> (gnu services telephony), (gnu services web) and (guix import utils).
>> [I was about to define my own version of it...]
>> I like the version using 'fold-right' together with 'match-lambda*' the
>> most. Should we move it (guix build utils) and remove the rest?
>
> About ‘flatten’ specifically, I feel like it’s not a good sign in terms
> of programming style when we end up using it (though we’d need to study
> these specific use cases), so I’m reluctant to “standardizing” it.  :-)
>
Your comment lead me to find out that 'append-map' is actually what I
want. I am curious why it is an indication of bad style.

>> Similarly, 'file-sans-extension' are defined in both (guix utils) and
>> (guix build guile-build-system). They are both the same. Should we move
>> them to (guix build utils) as well?
>
> Yes, sounds like a good idea!
>
OK!

> Thanks,
> Ludo’.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 'package-name-version' and 'strip-store-file-name' does the same thing with different ways
  2018-10-19 13:52     ` Ludovic Courtès
  2018-10-19 18:28       ` Alex Vong
@ 2018-10-20  8:37       ` Ricardo Wurmus
  2018-10-20 13:57         ` Ludovic Courtès
  1 sibling, 1 reply; 8+ messages in thread
From: Ricardo Wurmus @ 2018-10-20  8:37 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


Ludovic Courtès <ludo@gnu.org> writes:
>> Similarly, 'file-sans-extension' are defined in both (guix utils) and
>> (guix build guile-build-system). They are both the same. Should we move
>> them to (guix build utils) as well?
>
> Yes, sounds like a good idea!

‘file-sans-extension’ is used on the host-side, e.g. in scripts/build.scm.
Is it still fine to move it to a build-side module only?

--
Ricardo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 'package-name-version' and 'strip-store-file-name' does the same thing with different ways
  2018-10-19 18:28       ` Alex Vong
@ 2018-10-20 13:24         ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2018-10-20 13:24 UTC (permalink / raw)
  To: Alex Vong; +Cc: guix-devel

Hi Alex,

Alex Vong <alexvong1995@gmail.com> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Hello Alex,
>>
>> Alex Vong <alexvong1995@gmail.com> skribis:
>>
>>> Btw, I also noticed that the procedure 'flatten' are defined in
>>> (gnu services telephony), (gnu services web) and (guix import utils).
>>> [I was about to define my own version of it...]
>>> I like the version using 'fold-right' together with 'match-lambda*' the
>>> most. Should we move it (guix build utils) and remove the rest?
>>
>> About ‘flatten’ specifically, I feel like it’s not a good sign in terms
>> of programming style when we end up using it (though we’d need to study
>> these specific use cases), so I’m reluctant to “standardizing” it.  :-)
>>
> Your comment lead me to find out that 'append-map' is actually what I
> want. I am curious why it is an indication of bad style.

My intuition is that often, when one feels a need for ‘flatten’, they’d
probably be using ‘append’, ‘concatenate’, etc., or perhaps they’re
using the wrong data structure in the first place.  But again, we’d have
to look more closely at the existing use cases to see more concretely to
what extent they could be written differently.

Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 'package-name-version' and 'strip-store-file-name' does the same thing with different ways
  2018-10-20  8:37       ` Ricardo Wurmus
@ 2018-10-20 13:57         ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2018-10-20 13:57 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <rekado@elephly.net> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>>> Similarly, 'file-sans-extension' are defined in both (guix utils) and
>>> (guix build guile-build-system). They are both the same. Should we move
>>> them to (guix build utils) as well?
>>
>> Yes, sounds like a good idea!
>
> ‘file-sans-extension’ is used on the host-side, e.g. in scripts/build.scm.
> Is it still fine to move it to a build-side module only?

I think so because in practice we already use (guix build utils) quite a
lot on the “host side”.

More generally, while I think it’s important to arrange things so that
we don’t end up importing all of Guix on the build side, the advantage
of using the same language on both sides is that we can share code.  I
think we should take advantage of it when there are no downsides.

Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-10-20 13:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-15 19:26 'package-name-version' and 'strip-store-file-name' does the same thing with different ways Alex Vong
2018-10-16 11:54 ` Ludovic Courtès
2018-10-16 22:04   ` Alex Vong
2018-10-19 13:52     ` Ludovic Courtès
2018-10-19 18:28       ` Alex Vong
2018-10-20 13:24         ` Ludovic Courtès
2018-10-20  8:37       ` Ricardo Wurmus
2018-10-20 13:57         ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.