GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Currying by diogoosz · Pull Request #488 · javascript-tutorial/pt.javascript.info

Conversation

@diogoosz

@diogoosz diogoosz commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Tradução do artigo "Currying" para o português.

Conforme comentado na #1.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@diogoosz @claude
Translate "Currying" article to Portuguese
f8d2b66
Co-Authored-By: Claude Sonnet 5 <[email protected]>
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md
- When it is called like `curriedSum(1)`, the argument is saved in the Lexical Environment, and a new wrapper is returned `function(b)`.
- Then this wrapper is called with `2` as an argument, and it passes the call to the original `sum`.
- O resultado de `curry(func)` é um invólucro `function(a)`.
- Quando ele é chamado como `curriedSum(1)`, o argumento é salvo no Ambiente Léxico, e um novo invólucro é retornado, `function(b)`.

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminologia inconsistente: "Ambiente Léxico" aqui, mas o repo já usa "Ambiente Lexical" (ex.: 1-js/06-advanced-functions/07-new-function/article.md, linhas 49/51/123). Leitores que seguem o link mental para info:closure vão ver dois termos para o mesmo conceito. Sugestão: "Ambiente Lexical".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md

1. If passed `args` count is the same or more than the original function has in its definition (`func.length`) , then just pass the call to it using `func.apply`.
2. Otherwise, get a partial: we don't call `func` just yet. Instead, another wrapper is returned, that will re-apply `curried` providing previous arguments together with the new ones.
1. Se a quantidade de `args` passados for igual ou maior do que a função original tem na sua definição (`func.length`), então só passa a chamada pra ela usando `func.apply`.

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"igual ou maior do que a função original tem na sua definição" — comparação quebrada: falta o objeto ("do que a quantidade que a função original tem..."). Além disso, "então só passa a chamada" soa como imperativo/coloquial; sugestão: "então simplesmente repassa a chamada para ela usando func.apply".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md
```

Now we can easily make a convenience function for current logs:
Agora podemos facilmente fazer uma função de conveniência para os logs atuais:

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"logs atuais" muda o sentido: o original "current logs" = logs com a data/hora atual (o logNow fixa new Date()). "Logs atuais" lê-se como "os logs existentes agora". Sugestão: "logs com a hora atual" (idem na linha 100: "logs de debug com a hora atual").

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md
```

When we run it, there are two `if` execution branches:
Quando rodamos ela, existem duas ramificações de execução do `if`:

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Quando rodamos ela" — pronome reto como objeto direto; em texto didático prefira "Quando a executamos" (padrão do resto do tutorial).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md
O currying exige que a função tenha um número fixo de argumentos.

A function that uses rest parameters, such as `f(...args)`, can't be curried this way.
Uma função que usa parâmetros rest, como `f(...args)`, não pode ter o currying feito dessa forma.

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"não pode ter o currying feito dessa forma" é construção truncada/não idiomática. Sugestão: "não pode passar por currying dessa forma" ou "não pode ser "curryficada" dessa forma".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gabifs
gabifs reviewed Nov 12, 2026
View reviewed changes
Comment thread 1-js/99-js-misc/03-currying-partials/article.md
Por definição, o currying deveria converter `sum(a, b, c)` em `sum(a)(b)(c)`.

But most implementations of currying in JavaScript are advanced, as described: they also keep the function callable in the multi-argument variant.
Mas a maioria das implementações de currying no JavaScript são avançadas, como descrito: elas também mantêm a função chamável na variante com múltiplos argumentos.

@gabifs gabifs Nov 12, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"a maioria das implementações ... são avançadas" — concordância: com "a maioria de + plural" ambas são aceitas, mas o original "as described" + "elas também mantêm" fica ambíguo. Considere "a maioria das implementações ... é avançada, como descrito: também mantém a função chamável..." para manter sujeito único e evitar "elas" referindo-se a implementações vs. funções.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gabifs gabifs mentioned this pull request Nov 12, 2026
Portuguese Translation Progress #1
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gabifs gabifs gabifs left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@diogoosz @gabifs
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.