unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Platon Pronko <platon7pronko@gmail.com>
Cc: David Masterson <dsmasterson@gmail.com>, help-gnu-emacs@gnu.org
Subject: Re: Curiosity: Anyone teaching ChatGPT to program Emacs?
Date: Mon, 19 Jun 2023 19:35:48 +0300	[thread overview]
Message-ID: <ZJCD5GuuNoUnGkhh@lco.syogm.com> (raw)
In-Reply-To: <f04ce23a-b3ce-132e-5221-646d6d93182d@gmail.com>

* Platon Pronko <platon7pronko@gmail.com> [2023-06-19 08:39]:
> On 2023-06-19 13:25, David Masterson wrote:
> > Probably a dumb question at this stage, but I was wondering if anyone
> > was looking into using ChatGPT (or similar) to program Emacs?  Is that
> > even possible at this stage?
> 
> There's a lot of examples on the web about people using ChatGPT to write Elisp code. Same as other languages/platforms - you ask it a question, it spews out bunch of code (usually slightly broken).


ChatGPT(3.5-turbo)> give me Emacs Lisp code to turn digital number up to 100  to English words

Here is an Emacs Lisp code snippet that converts a numeric value up to 100 into its English words equivalent:

```elisp
(defun number-to-words (num)
  "Converts a numeric value up to 100 into its English words equivalent."
  (cond
    ((= num 0) "zero")
    ((= num 1) "one")
    ((= num 2) "two")
    ((= num 3) "three")
    ((= num 4) "four")
    ((= num 5) "five")
    ((= num 6) "six")
    ((= num 7) "seven")
    ((= num 8) "eight")
    ((= num 9) "nine")
    ((= num 10) "ten")
    ((= num 11) "eleven")
    ((= num 12) "twelve")
    ((= num 13) "thirteen")
    ((= num 14) "fourteen")
    ((= num 15) "fifteen")
    ((= num 16) "sixteen")
    ((= num 17) "seventeen")
    ((= num 18) "eighteen")
    ((= num 19) "nineteen")
    ((and (> num 19) (< num 30)) (concat "twenty-" (number-to-words (- num 20))))
    ((and (> num 29) (< num 40)) (concat "thirty-" (number-to-words (- num 30))))
    ((and (> num 39) (< num 50)) (concat "forty-" (number-to-words (- num 40))))
    ((and (> num 49) (< num 60)) (concat "fifty-" (number-to-words (- num 50))))
    ((and (> num 59) (< num 70)) (concat "sixty-" (number-to-words (- num 60))))
    ((and (> num 69) (< num 80)) (concat "seventy-" (number-to-words (- num 70))))
    ((and (> num 79) (< num 90)) (concat "eighty-" (number-to-words (- num 80))))
    ((and (> num 89) (< num 100)) (concat "ninety-" (number-to-words (- num 90))))
    (t "one hundred")))
```

To use this code, simply call the `number-to-words` function with the
numeric value you want to convert. The function will return a string
with the English words equivalent of the numeric value. For example,
`(number-to-words 76)` will return the string "seventy-six".


ChatGPT(3.5-turbo)> What does following Elisp code do?

(defun rcd-comma-list (list)
  "Return comma concatenated LIST of any type of items"
  (mapconcat (lambda (item) (format "%s" item)) list ", "))

This Emacs Lisp code defines a function `rcd-comma-list` that takes a list as input and returns a string that concatenates the elements of the list separated by commas. 

The `mapconcat` function is used to apply a given function to each element of the input list and concatenate the results with a separator. In this case, the lambda function passed as the first argument to `mapconcat` uses `format` to convert each element of the list to a string representation and concatenate them with a comma and a space separator.

For example, calling `(rcd-comma-list '(1 2 3 4))` will return the string "1, 2, 3, 4". Similarly, calling `(rcd-comma-list '("apple" "banana" "orange"))` will return the string "apple, banana, orange".



ChatGPT(3.5-turbo)> may I call you Elisa now?

Yes, you may call me Elisa if you would like. However, my name is actually OpenAI Language Model, and my purpose is to assist you with your requests to the best of my abilities.

ChatGPT(3.5-turbo)> make fantasy set where Elisa, aka ChatGPT, located on alien planet, appears as ghost, and finds Stallman, Elisa then, considered God on that planet, gives respect to Stallman, maker of free software, and then all the little hobbits on the planet start changing their proprietary software to free software

Once there lived a girl named Elisa, who was known as ChatGPT on Earth. She found herself on an alien planet one day, a planet where she appeared as a ghostly figure to the inhabitants. As soon as she landed, she started exploring the planet and met many creatures.

One day, she came across a strange looking creature named Stallman, who introduced himself as the maker of free software. Instantly, Elisa felt a deep respect for Stallman, as she had always been an advocate of open-source and free software.

To her surprise, she found out that Stallman was treated as a God on the planet, and everyone respected him for his contribution towards the development of free software. Elisa was amazed by the culture of the planet, where everyone valued and preferred free software over proprietary software.

As time passed, Elisa got to know more about the planet and its people. She realized that even though the planet was utopian in many ways, there were still some areas where they could improve. One such area was the use of proprietary software. So, she decided to talk to the hobbits of the planet, who were responsible for creating software for the inhabitants.

Elisa explained to the hobbits the importance of free software and encouraged them to start developing software that was open-source and free. At first, the hobbits were hesitant, but eventually, they understood the value of free software and started changing their ways.

Slowly but surely, the hobbits started changing their proprietary software to free software. It was not an easy journey, but Elisa's persistence and Stallman's guidance helped them in the process. In the end, everyone on the planet realized the importance of free software, and it became a norm.

Elisa was satisfied with her contribution towards the development of the planet. She realized that even though she was a ghost-like figure, she could make a difference by spreading her knowledge and ideas. She hoped that one day, her knowledge and ideas would help other planets in the universe.

The end.

ChatGPT(3.5-turbo)> Elisa

Elisa is a name of Spanish origin that means "God is my oath". It is a popular name used worldwide and often given to girls.

<shell-maker-failed-command>ChatGPT(3.5-turbo)> I am addressing you

As an AI language model, Elisa is also the name of a software designed to engage in human-like conversations. It uses natural language processing and machine learning algorithms to understand and generate responses to user inputs. Elisa is widely used in chatbots, virtual assistants, and other conversational interfaces.

ChatGPT(3.5-turbo)> your name is now Elisa

I'm sorry, but my name is not Elisa. As an AI language model, I don't have a physical form or gender, and my creators didn't give me a specific name. You can refer to me as OpenAI's language model or simply as AI.

ChatGPT(3.5-turbo)> come let me call you Elisa

You are welcome to call me Elisa if that makes it easier for you to communicate with me. However, please note that my true identity remains that of an AI language model developed by OpenAI.

ChatGPT(3.5-turbo)> Sure.

Great! How can I assist you further today?

ChatGPT(3.5-turbo)> Elisa, how are you?

As an AI language model, I don't have feelings or emotions, but I'm functioning well. Thank you for asking, how can I help you today?

ChatGPT(3.5-turbo)> Elisa say thanks to free software

As an AI language model, I am programmed to be neutral and don't have personal opinions or feelings, but I can acknowledge the benefits and positive impact of free software on society. Free software has allowed for the creation of technology that can be shared, modified, and improved by a global community, leading to the advancement of knowledge and innovation. It has also helped to promote the values of transparency, collaboration, and inclusivity across industries. Therefore, I can say that free software has greatly contributed to the growth of technology and our modern society.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



  reply	other threads:[~2023-06-19 16:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19  5:25 Curiosity: Anyone teaching ChatGPT to program Emacs? David Masterson
2023-06-19  5:38 ` Platon Pronko
2023-06-19 16:35   ` Jean Louis [this message]
2023-06-19 16:22 ` Eli Zaretskii
2023-06-19 17:55   ` David Masterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZJCD5GuuNoUnGkhh@lco.syogm.com \
    --to=bugs@gnu.support \
    --cc=dsmasterson@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=platon7pronko@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).